|
|
|
|
@ -22,29 +22,29 @@ if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { |
|
|
|
|
$htmlHeadXtra[] = ' |
|
|
|
|
<script> |
|
|
|
|
$(document).ready(function() { |
|
|
|
|
$(\'.ajax\').live(\'click\', function() { |
|
|
|
|
$(\'.ajax\').on(\'click\', function() { |
|
|
|
|
var url = this.href; |
|
|
|
|
var dialog = $("#dialog"); |
|
|
|
|
if ($("#dialog").length == 0) { |
|
|
|
|
dialog = $(\'<div id="dialog" style="display:hidden"></div>\').appendTo(\'body\'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// load remote content |
|
|
|
|
dialog.load( |
|
|
|
|
url, |
|
|
|
|
url, |
|
|
|
|
{}, |
|
|
|
|
function(responseText, textStatus, XMLHttpRequest) { |
|
|
|
|
dialog.dialog({ |
|
|
|
|
modal : true, |
|
|
|
|
width : 540, |
|
|
|
|
height : 400, |
|
|
|
|
}); |
|
|
|
|
modal : true, |
|
|
|
|
width : 540, |
|
|
|
|
height : 400, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
//prevent the browser to follow the link |
|
|
|
|
return false; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -78,7 +78,7 @@ if (isset($_GET['action']) && in_array($_GET['action'],$actions)) { |
|
|
|
|
$action = $_GET['action']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($action == 'createcoursecategory') { |
|
|
|
|
if ($action == 'createcoursecategory') { |
|
|
|
|
$nameTools = get_lang('CreateCourseCategory'); |
|
|
|
|
} |
|
|
|
|
if ($action == 'subscribe') { |
|
|
|
|
@ -99,13 +99,13 @@ $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'user_portal.php', 'n |
|
|
|
|
if (empty($nameTools)) { |
|
|
|
|
$nameTools = get_lang('CourseManagement'); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!in_array($action, array('sortmycourses', 'createcoursecategory', 'display_random_courses', 'display_courses', 'subscribe'))) { |
|
|
|
|
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'auth/courses.php', 'name' => get_lang('CourseManagement')); |
|
|
|
|
} |
|
|
|
|
if ($action == 'createcoursecategory') { |
|
|
|
|
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'auth/courses.php?action=sortmycourses', 'name' => get_lang('SortMyCourses')); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$interbreadcrumb[] = array('url' => '#', 'name' => $nameTools); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -155,7 +155,7 @@ if ($action == 'deletecoursecategory' && isset($_GET['id'])) { |
|
|
|
|
// We are creating a new user defined course category (= Create Course Category). |
|
|
|
|
if (isset($_POST['create_course_category']) && isset($_POST['title_course_category']) && strlen(trim($_POST['title_course_category'])) > 0) { |
|
|
|
|
if ($ctok == $_POST['sec_token']) { |
|
|
|
|
$courses_controller->add_course_category($_POST['title_course_category']); |
|
|
|
|
$courses_controller->add_course_category($_POST['title_course_category']); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -168,9 +168,9 @@ if (isset($_REQUEST['search_course'])) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Subscribe user to course |
|
|
|
|
if (isset($_REQUEST['subscribe_course'])) { |
|
|
|
|
if (isset($_REQUEST['subscribe_course'])) { |
|
|
|
|
if ($ctok == $_GET['sec_token']) { |
|
|
|
|
$courses_controller->subscribe_user($_GET['subscribe_course'], $_GET['search_term'], $_GET['category_code']); |
|
|
|
|
$courses_controller->subscribe_user($_GET['subscribe_course'], $_GET['search_term'], $_GET['category_code']); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// We are unsubscribing from a course (=Unsubscribe from course). |
|
|
|
|
@ -188,8 +188,8 @@ if (isset($_POST['unsubscribe'])) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
switch ($action) { |
|
|
|
|
case 'subscribe_user_with_password': |
|
|
|
|
$courses_controller->subscribe_user($_POST['subscribe_user_with_password'], $_POST['search_term'], $_POST['category_code']); |
|
|
|
|
case 'subscribe_user_with_password': |
|
|
|
|
$courses_controller->subscribe_user($_POST['subscribe_user_with_password'], $_POST['search_term'], $_POST['category_code']); |
|
|
|
|
exit; |
|
|
|
|
break; |
|
|
|
|
case 'createcoursecategory': |
|
|
|
|
@ -198,16 +198,16 @@ switch ($action) { |
|
|
|
|
case 'deletecoursecategory': |
|
|
|
|
$courses_controller->courses_list($action); |
|
|
|
|
break; |
|
|
|
|
case 'sortmycourses': |
|
|
|
|
case 'sortmycourses': |
|
|
|
|
$courses_controller->courses_list($action); |
|
|
|
|
break; |
|
|
|
|
case 'subscribe': |
|
|
|
|
case 'subscribe': |
|
|
|
|
case 'display_random_courses': |
|
|
|
|
if ($user_can_view_page) { |
|
|
|
|
$courses_controller->courses_categories($action); |
|
|
|
|
} else { |
|
|
|
|
api_not_allowed(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 'display_courses': |
|
|
|
|
$courses_controller->courses_categories($action, $_GET['category_code']); |
|
|
|
|
|