Add user_portal_load_notification_by_ajax validation

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 8ffb7fe912
commit 8a97b51b4a
  1. 40
      user_portal.php

@ -39,27 +39,29 @@ $load_dirs = api_get_setting('show_documents_preview');
$displayMyCourseViewBySessionLink = api_get_setting('my_courses_view_by_session') === 'true';
$nameTools = get_lang('MyCourses');
// Load notification by ajax
$htmlHeadXtra[] = '<script>
$(function() {
$(".course_notification").each(function(index) {
var div = $(this);
var id = $(this).attr("id");
var idList = id.split("_");
var courseId = idList[1];
var sessionId = idList[2];
var status = idList[3];
$.ajax({
type: "GET",
url: "'.api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=get_notification&course_id="+courseId+"&session_id="+sessionId+"&status="+status,
success: function(data) {
div.append(data);
}
// Load course notification by ajax
$loadNotificationsByAjax = api_get_configuration_value('user_portal_load_notification_by_ajax');
if ($loadNotificationsByAjax) {
$htmlHeadXtra[] = '<script>
$(function() {
$(".course_notification").each(function(index) {
var div = $(this);
var id = $(this).attr("id");
var idList = id.split("_");
var courseId = idList[1];
var sessionId = idList[2];
var status = idList[3];
$.ajax({
type: "GET",
url: "'.api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=get_notification&course_id="+courseId+"&session_id="+sessionId+"&status="+status,
success: function(data) {
div.append(data);
}
});
});
});
});
</script>';
</script>';
}
/*
Header

Loading…
Cancel
Save