<?php define('NO_SESSION_LOCATION', true); require_once '../kernel/begin.php'; require_once '../kernel/header_no_display.php'; if ($User->check_level(ADMIN_LEVEL)) { include_once 'download_cats.class.php'; $download_categories = new DownloadCats(); $id_up = retrieve(GET, 'id_up', 0); $id_down = retrieve(GET, 'id_down', 0); $id_show = retrieve(GET, 'show', 0); $id_hide = retrieve(GET, 'hide', 0); $cat_to_del = retrieve(GET, 'del', 0); $result = false; if ($id_up > 0) { $result = $download_categories->move($id_up, MOVE_CATEGORY_UP); } elseif ($id_down > 0) { $result = $download_categories->move($id_down, MOVE_CATEGORY_DOWN); } elseif ($id_show > 0) { $result = $download_categories->change_visibility($id_show, CAT_VISIBLE, LOAD_CACHE); } elseif ($id_hide > 0) { $result = $download_categories->change_visibility($id_hide, CAT_UNVISIBLE, LOAD_CACHE); } if ($result) { $cat_config = array('xmlhttprequest_file' => 'xmlhttprequest_cats.php', 'administration_file_name' => 'admin_download_cat.php', 'url' => array('unrewrited' => 'download.php?id=%d', 'rewrited' => 'category-%d+%s.php')); $download_categories->set_display_config($cat_config); $Cache->load('download', RELOAD_CACHE); echo $download_categories->build_administration_interface(AJAX_MODE); } } include_once '../kernel/footer_no_display.php';
} else { $Template->set_filenames(array('admin_download_cat' => 'download/admin_download_cat.tpl')); include_once 'admin_download_menu.php'; if (!empty($error)) { switch ($error) { case 'e_required_fields_empty': $Errorh->handler($DOWNLOAD_LANG['required_fields_empty'], E_USER_WARNING); break; case 'e_unexisting_category': $Errorh->handler($DOWNLOAD_LANG['unexisting_category'], E_USER_WARNING); break; case 'e_new_cat_does_not_exist': $Errorh->handler($DOWNLOAD_LANG['new_cat_does_not_exist'], E_USER_WARNING); break; case 'e_infinite_loop': $Errorh->handler($DOWNLOAD_LANG['infinite_loop'], E_USER_WARNING); break; case 'e_success': $Errorh->handler($DOWNLOAD_LANG['successful_operation'], E_USER_SUCCESS); break; case 'e_recount_success': $Errorh->handler($DOWNLOAD_LANG['recount_success'], E_USER_SUCCESS); break; } } $cat_config = array('xmlhttprequest_file' => 'xmlhttprequest_cats.php', 'administration_file_name' => 'admin_download_cat.php', 'url' => array('unrewrited' => 'download.php?cat=%d', 'rewrited' => 'category-%d+%s.php')); $download_categories->set_display_config($cat_config); $Template->assign_vars(array('CATEGORIES' => $download_categories->build_administration_interface(), 'L_RECOUNT_SUBFILES' => $DOWNLOAD_LANG['recount_subfiles'], 'U_RECOUNT_SUBFILES' => url('admin_download_cat.php?recount=1'))); $Template->pparse('admin_download_cat'); } require_once '../admin/admin_footer.php';