firstselected: false, onselect: check, filter_selected: true, newel: true }); }); </script>'; // Breadcrumbs $interbreadcrumb[] = array("url" => "exercice.php", "name" => get_lang('Exercices')); Display::display_header(get_lang('Category')); // Action handling: add, edit and remove if (isset($_GET['action']) && $_GET['action'] == 'addcategory') { add_category_form($_GET['action'], $type); } else { if (isset($_GET['action']) && $_GET['action'] == 'addcategoryglobal') { add_category_form($_GET['action'], $type); } else { if (isset($_GET['action']) && $_GET['action'] == 'editcategory') { edit_category_form($_GET['action'], $type); } else { if (isset($_GET['action']) && $_GET['action'] == 'deletecategory') { delete_category_form($_GET['action'], $type); } else { display_add_category($type); display_categories($type); } } } } Display::display_footer(); // FUNCTIONS
</script>'; $nameTools = ""; require_once '../inc/global.inc.php'; $this_section = SECTION_COURSES; if (!api_is_allowed_to_edit()) { api_not_allowed(true); } $category = new TestCategory(); $courseId = api_get_course_int_id(); $sessionId = api_get_session_id(); // breadcrumbs $interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises')); Display::display_header(get_lang('Category')); // Action handling: add, edit and remove if (isset($_GET['action']) && $_GET['action'] == 'addcategory') { add_category_form($_GET['action']); display_add_category(); } else { if (isset($_GET['action']) && $_GET['action'] == 'editcategory') { edit_category_form($_GET['action']); } else { if (isset($_GET['action']) && $_GET['action'] == 'deletecategory') { delete_category_form($_GET['action']); display_add_category(); } else { display_add_category(); } } } echo $category->displayCategories($courseId, $sessionId); Display::display_footer();
$nameTools = ""; ////require_once '../inc/global.inc.php'; $this_section = SECTION_COURSES; if (!api_is_allowed_to_edit()) { api_not_allowed(true); } $category = new TestCategory(); $courseId = api_get_course_int_id(); $sessionId = api_get_session_id(); // breadcrumbs $interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises')); $action = isset($_GET['action']) ? $_GET['action'] : ''; $content = ''; switch ($action) { case 'addcategory': $content = add_category_form('addcategory'); break; case 'editcategory': $content = edit_category_form('editcategory'); break; case 'deletecategory': delete_category_form('deletecategory'); break; case 'export_category': $archiveFile = 'export_exercise_categoroes_' . api_get_course_id() . '_' . api_get_local_time(); $categories = $category->getCategories($courseId, $sessionId); $export = []; $export[] = ['title', 'description']; if (!empty($categories)) { foreach ($categories as $category) { $export[] = [$category['title'], $category['description']];