} return $retval; } // Show message function showMessage() { $msg = COM_applyFilter($_REQUEST['msg'], true); return $msg > 0 ? COM_showMessage($msg, 'downloads') : ''; } // MAIN $op = COM_applyFilter($_REQUEST['op']); $_page = COM_applyFilter($_REQUEST['page']); $listing_cid = COM_applyFilter($_REQUEST['listing_cid']); $display = ''; require_once $_CONF['path'] . 'plugins/downloads/include/gltree.class.php'; $mytree = new GLTree($_TABLES['downloadcategories'], 'cid', 'pid', 'title', '', ROOTID); // Not set $_DLM_CONF['lang_id'] $mytree->setRoot($LANG_DLM['main']); $mode = !empty($_REQUEST['mode']) ? $_REQUEST['mode'] : ''; $cid = !empty($_REQUEST['cid']) ? COM_sanitizeID(trim($_REQUEST['cid'])) : ''; $lid = !empty($_REQUEST['lid']) ? COM_sanitizeID(trim($_REQUEST['lid'])) : ''; $itemenable = array(); $itemenable = $_POST['itemenable']; if (isset($itemenable) && SEC_checkToken()) { DLM_changeMenuitemStatus($itemenable); } $op = $mode == 'editsubmission' ? $mode : $op; $op = $mode == 'edit' ? 'uploadFile' : $op; if (in_array($op, array('newCategory', 'modCat', 'cloneCat', 'addCategory', 'delCat', 'saveCategory'))) { // only users who belong to the Root group can access if (!SEC_inGroup('Root')) {
break; default: $orderbyTrans = $LANG_DLM['datenew']; break; } $T->set_var(array('cid0' => $cid, 'nppage' => $nppage, 'lang_datenew' => $LANG_DLM['datenew'], 'lang_titleatoz' => $LANG_DLM['titleatoz'], 'lang_popularitymtol' => $LANG_DLM['popularitymtol'], 'lang_ratinghtol' => $LANG_DLM['ratinghtol'], 'lang_sortby' => $LANG_DLM['sortby'], 'lang_numperpage' => $LANG_DLM['numperpage'], 'lang_rating' => $LANG_DLM['rating'], 'orderby' => $orderby, 'current_ord_d' => $orderby == 'dated' ? 'current' : 'dummy', 'current_ord_t' => $orderby == 'titlea' ? 'current' : 'dummy', 'current_ord_h' => $orderby == 'hitsd' ? 'current' : 'dummy', 'current_ord_r' => $orderby == 'ratingd' ? 'current' : 'dummy', 'current_num_5' => $show == 5 ? 'current' : 'dummy', 'current_num_10' => $show == 10 ? 'current' : 'dummy', 'current_num_20' => $show == 20 ? 'current' : 'dummy', 'current_num_50' => $show == 50 ? 'current' : 'dummy', 'orderbyTrans' => $orderbyTrans)); return $T->finish($T->parse('sort_menu', 'sortmenu')); } function DLM_makeForm_hidden($name, $value) { return '<input type="hidden" name="' . $name . '" value="' . $value . '"' . XHTML . '>' . LB; } // MAIN $_DLM_CONF['has_edit_rights'] = SEC_hasRights('downloads.edit'); $permsql = $_DLM_CONF['has_edit_rights'] ? '' : COM_getPermSQL('AND'); $mytree = new GLTree($_TABLES['downloadcategories'], 'cid', 'pid', 'title', $permsql . 'AND is_enabled=1 ', ROOTID, $_DLM_CONF['lang_id']); $mytree->setSepalator(BCSEPALATOR); $mytree->setRoot($LANG_DLM['main']); $display = ''; $pagetitle = $LANG_DLM['plugin_name']; // display message if (isset($_REQUEST['msg'])) { $msg = COM_applyFilter($_REQUEST['msg'], true); if ($msg > 0) { $display .= COM_showMessage($msg, 'downloads'); } } $T = new Template($_DLM_CONF['path_layout']); $T->set_file(array('page' => 'filelisting.thtml', 'filedetail' => 'filedetail.thtml', 'records' => 'filelisting_record.thtml', 'tsnapshot' => 'filelisting_snapshot.thtml', 'tsnaplinkicon' => 'filelisting_snaplinkicon.thtml', 'filedetail_notn' => 'filedetail_no_tn.thtml', 'records_notn' => 'filelisting_record_no_tn.thtml', 'categoryselbox' => 'filelisting_category_selbox.thtml')); if (!$_DLM_CONF['show_tn_image']) { $T->set_file(array('filedetail' => 'filedetail_no_tn.thtml', 'records' => 'filelisting_record_no_tn.thtml'));