$text = get_lang('Save'); $form->setDefaults($categoryInfo); $form->addButtonSave($text); } else { $class = "add"; $text = get_lang('AddCategory'); $form->setDefaults(array('auth_course_child' => 'TRUE')); $form->addButtonCreate($text); } $form->display(); } else { // If multiple URLs and not main URL, prevent deletion and inform user if ($action == 'delete' && api_get_multiple_access_url() && api_get_current_access_url_id() != 1) { Display::display_warning_message(get_lang('CourseCategoriesAreGlobal')); } echo '<div class="actions">'; $link = null; if (!empty($parentInfo)) { $parentCode = $parentInfo['parent_id']; echo Display::url(Display::return_icon('back.png', get_lang("Back"), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'admin/course_category.php?category=' . $parentCode); } if (empty($parentInfo) || $parentInfo['auth_cat_child'] == 'TRUE') { echo Display::url(Display::return_icon('new_folder.png', get_lang("AddACategory"), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'admin/course_category.php?action=add&category=' . Security::remove_XSS($category)); } echo '</div>'; if (!empty($parentInfo)) { echo Display::page_subheader($parentInfo['name'] . ' (' . $parentInfo['code'] . ')'); } echo CourseCategory::listCategories($category); } Display::display_footer();