diff --git a/main/auth/courses.php b/main/auth/courses.php index 28a0394236..aa4fec2885 100755 --- a/main/auth/courses.php +++ b/main/auth/courses.php @@ -203,6 +203,7 @@ switch ($action) { ); } else { header('Location: ' . api_get_self()); + exit; } break; case 'display_random_courses': diff --git a/main/auth/courses_controller.php b/main/auth/courses_controller.php index 7d34a95ff5..2fe6da29b2 100755 --- a/main/auth/courses_controller.php +++ b/main/auth/courses_controller.php @@ -43,8 +43,7 @@ class CoursesController $data['user_courses'] = $this->model->get_courses_of_user($user_id); $data['user_course_categories'] = $this->model->get_user_course_categories(); $data['courses_in_category'] = $this->model->get_courses_in_category(); - $data['all_user_categories'] = $this->model->get_user_course_categories( - ); + $data['all_user_categories'] = $this->model->get_user_course_categories(); $data['action'] = $action; $data['message'] = $message; @@ -116,7 +115,6 @@ class CoursesController $data['browse_course_categories'] = $browse_course_categories; $data['code'] = Security::remove_XSS($category_code); - // getting all the courses to which the user is subscribed to $curr_user_id = api_get_user_id(); $user_courses = $this->model->get_courses_of_user($curr_user_id); @@ -353,7 +351,9 @@ class CoursesController /** * Unsubscribe user from a course * render to listing view - * @param string Course code + * @param string $course_code + * @param string $search_term + * @param string $category_code */ public function unsubscribe_user_from_course($course_code, $search_term = null, $category_code = null) { @@ -383,9 +383,7 @@ class CoursesController public function getCoursesCategoriesBlock($code = null, $hiddenLinks = false, $limit = null) { $categories = $this->model->browse_course_categories(); - $html = ''; - if (!empty($categories)) { $action = 'display_courses'; foreach ($categories[0] as $category) { @@ -517,8 +515,7 @@ class CoursesController $sessionId, $sessionName, $checkRequirements = false - ) - { + ) { if ($checkRequirements) { $url = api_get_path(WEB_AJAX_PATH); $url .= 'sequence.ajax.php?'; @@ -544,9 +541,7 @@ class CoursesController $catalogSessionAutoSubscriptionAllowed = false; - if ( - api_get_setting('catalog_allow_session_auto_subscription') === 'true' - ) { + if (api_get_setting('catalog_allow_session_auto_subscription') === 'true') { $catalogSessionAutoSubscriptionAllowed = true; } diff --git a/main/auth/gotocourse.php b/main/auth/gotocourse.php index d0b2d65d77..0984b6336d 100755 --- a/main/auth/gotocourse.php +++ b/main/auth/gotocourse.php @@ -11,8 +11,8 @@ * */ -require '../inc/global.inc.php'; -require_once(api_get_path(SYS_PATH).'main/auth/cas/authcas.php'); +require_once '../inc/global.inc.php'; +require_once api_get_path(SYS_PATH).'main/auth/cas/authcas.php'; $msg = null; if (isset($_GET['firstpage'])) { $firstpage = $_GET['firstpage']; diff --git a/main/auth/inscription.php b/main/auth/inscription.php index e49289bd31..58320a56df 100755 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -1,13 +1,13 @@ diff --git a/main/badge/class.php b/main/badge/class.php index 59588f3679..06b23059af 100644 --- a/main/badge/class.php +++ b/main/badge/class.php @@ -1,5 +1,6 @@ diff --git a/main/badge/criteria.php b/main/badge/criteria.php index 0c75af30c4..70ee3171cf 100644 --- a/main/badge/criteria.php +++ b/main/badge/criteria.php @@ -1,5 +1,6 @@ diff --git a/main/badge/issued.php b/main/badge/issued.php index 1ec05bc9f7..9d41778c06 100644 --- a/main/badge/issued.php +++ b/main/badge/issued.php @@ -1,5 +1,6 @@ diff --git a/main/badge/issued_all.php b/main/badge/issued_all.php index 08698715fa..f5a3668ebd 100644 --- a/main/badge/issued_all.php +++ b/main/badge/issued_all.php @@ -149,8 +149,8 @@ foreach ($userSkills as $index => $skillIssue) { } $formAcquiredLevel = new FormValidator( - 'acquired_level'.$skillIssue->getId(), - 'post', + 'acquired_level'.$skillIssue->getId(), + 'post', $skillIssue->getIssueUrlAll() ); $formAcquiredLevel->addSelect('acquired_level', get_lang('AcquiredLevel'), $acquiredLevel); @@ -202,8 +202,8 @@ foreach ($userSkills as $index => $skillIssue) { exit; } - $badgeInfoError = ""; - $personalBadge = ""; + $badgeInfoError = ''; + $personalBadge = ''; if ($allowDownloadExport) { $backpack = 'https://backpack.openbadges.org/'; diff --git a/main/blog/blog.php b/main/blog/blog.php index 4c449bf2bd..2debc40211 100755 --- a/main/blog/blog.php +++ b/main/blog/blog.php @@ -311,39 +311,39 @@ Display::display_introduction_section(TOOL_BLOGS);
- -
-
-
- -
+
+
+
+
- -
-
-
-
-
- - - -
- -
-
+
+ +
+
+
+
+
+ + + +
+ +
+
-
-
-
- -
+
+
+
+
- +

'; Blog :: display_assigned_task_list($blog_id); echo '

'; - } - else - api_not_allowed(); + } else { + api_not_allowed(); + } break; case 'execute_task' : - if (isset ($_GET['post_id'])) - Blog :: display_post($blog_id, intval($_GET['post_id'])); - else - Blog :: display_select_task_post($blog_id, intval($_GET['task_id'])); - + if (isset ($_GET['post_id'])) { + Blog:: display_post($blog_id, intval($_GET['post_id'])); + } else { + Blog:: display_select_task_post($blog_id, intval($_GET['task_id'])); + } break; case 'view_search_result' : Blog :: display_search_results($blog_id, Database::escape_string($_GET['q'])); break; - case '' : - default : + case '': + default: if (isset ($_GET['filter']) && !empty ($_GET['filter'])) { Blog :: display_day_results($blog_id, Database::escape_string($_GET['filter'])); } else { Blog :: display_blog_posts($blog_id); } + break; } ?>
0) { $row = Database::fetch_array($result); diff --git a/main/calendar/agenda_js.php b/main/calendar/agenda_js.php index 036098c8a8..48716cdbdb 100755 --- a/main/calendar/agenda_js.php +++ b/main/calendar/agenda_js.php @@ -9,9 +9,9 @@ use ChamiloSession as Session; // use anonymous mode when accessing this course tool $use_anonymous = true; - +$typeList = array('personal', 'course', 'admin', 'platform'); // Calendar type -$type = isset($_REQUEST['type']) && in_array($_REQUEST['type'], array('personal', 'course', 'admin', 'platform')) ? $_REQUEST['type'] : 'personal'; +$type = isset($_REQUEST['type']) && in_array($_REQUEST['type'], $typeList) ? $_REQUEST['type'] : 'personal'; $userId = isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : null; if ($type == 'personal' || $type == 'admin') { @@ -125,7 +125,8 @@ $tpl->assign('month_names', json_encode($months)); $tpl->assign('month_names_short', json_encode($months_short)); $tpl->assign('day_names', json_encode($days)); $tpl->assign('day_names_short', json_encode($day_short)); -$tpl->assign('button_text', +$tpl->assign( + 'button_text', json_encode(array( 'today' => get_lang('Today'), 'month' => get_lang('Month'),