diff --git a/main/admin/course_category.php b/main/admin/course_category.php index dc1bec913b..ad8de7447e 100644 --- a/main/admin/course_category.php +++ b/main/admin/course_category.php @@ -25,13 +25,22 @@ $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); $tbl_category = Database::get_main_table(TABLE_MAIN_CATEGORY); $errorMsg = ''; - +$delError = 0; if (!empty($action)) { if ($action == 'delete') { - deleteNode($_GET['id']); - - header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category)); - exit(); + if (api_get_multiple_access_url()) { + if (api_get_current_access_url_id() != 1) { + deleteNode($_GET['id']); + header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category)); + exit(); + } else { + $delError = 1; + } + } else { + deleteNode($_GET['id']); + header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category)); + exit(); + } } elseif (($action == 'add' || $action == 'edit') && $_POST['formSent']) { $_POST['categoryCode'] = trim($_POST['categoryCode']); $_POST['categoryName'] = trim($_POST['categoryName']); @@ -92,103 +101,107 @@ if (empty($action)) { } if ($action == 'add' || $action == 'edit') { - ?> -
- -
- addElement('header', '', $form_title); - $form->display(); - ?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
:
:
- /> - /> -
 
-
- + if ((api_get_multiple_access_url() && api_get_current_access_url_id() != 1) || !api_get_multiple_access_url() ) { + +?>
+ +
+ addElement('header', '', $form_title); + $form->display(); + ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
:
:
+ /> + /> +
 
+
+ + +
+ 0) { + $parent_id = Database::fetch_array($result); + } + + $parent_id['parent_id'] ? $link = ' (' . $parent_id['parent_id'] . ')' : $link = ''; ?> -
+ + + 0) { - $parent_id = Database::fetch_array($result); - } - - $parent_id['parent_id'] ? $link = ' (' . $parent_id['parent_id'] . ')' : $link = ''; - ?> - - - + } + ?> - - -
-
+