diff --git a/main/admin/dashboard_add_users_to_user.php b/main/admin/dashboard_add_users_to_user.php index acca6bc53d..713645da51 100755 --- a/main/admin/dashboard_add_users_to_user.php +++ b/main/admin/dashboard_add_users_to_user.php @@ -32,7 +32,7 @@ $tbl_user = Database::get_main_table(TABLE_MAIN_USER); $tbl_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); // initializing variables -$user_id = intval($_GET['user']); +$user_id = isset($_GET['user']) ? (int) $_GET['user'] : 0; $user_info = api_get_user_info($user_id); $user_anonymous = api_get_anonymous_id(); $current_user_id = api_get_user_id(); diff --git a/main/auth/courses.php b/main/auth/courses.php index 9e4926f5d9..20ef35fc5a 100755 --- a/main/auth/courses.php +++ b/main/auth/courses.php @@ -199,7 +199,7 @@ switch ($action) { exit; break; case 'createcoursecategory': - $courseController->categoryList($action); + $courseController->categoryList(); break; case 'deletecoursecategory': $courseController->courseList($action); @@ -213,19 +213,6 @@ switch ($action) { } header('Location: '.api_get_self()); exit; - /* if (!CoursesAndSessionsCatalog::is(CATALOG_SESSIONS)) { - $courseController->courses_categories( - $action, - $categoryCode, - null, - null, - null, - $limit - ); - } else { - header('Location: ' . api_get_self()); - exit; - }*/ break; case 'display_random_courses': if (!$user_can_view_page) { diff --git a/main/auth/courses_controller.php b/main/auth/courses_controller.php index 1e4eea6b48..c892ff21ef 100755 --- a/main/auth/courses_controller.php +++ b/main/auth/courses_controller.php @@ -57,20 +57,12 @@ class CoursesController } /** - * It's used for listing categories, - * render to categories_list view. + * It's used for listing categories, render to categories_list view. * - * @param string $action - * @param string $message confirmation message(optional) - * @param string $error error message(optional) */ - public function categoryList($action, $message = '', $error = '') + public function categoryList() { api_block_anonymous_users(); - - $data = []; - $data['user_course_categories'] = CourseManager::get_user_course_categories(api_get_user_id()); - $stok = Security::get_token(); $actions = Display::url( Display::return_icon('back.png', get_lang('Back'), '', '32'), diff --git a/main/course_home/activity.php b/main/course_home/activity.php index b52534ccd9..b51be242eb 100755 --- a/main/course_home/activity.php +++ b/main/course_home/activity.php @@ -12,7 +12,7 @@ * * @package chamilo.course_home */ -$id = isset($_GET['id']) ? intval($_GET['id']) : null; +$id = isset($_GET['id']) ? (int) $_GET['id'] : null; $course_id = api_get_course_int_id(); $session_id = api_get_session_id(); @@ -29,8 +29,6 @@ if (api_is_platform_admin()) { /* * Process hiding a tools from available tools. */ - //where $id is set? - $id = intval($id); Database::query("DELETE FROM $tool_table WHERE c_id = $course_id AND id='$id' AND added_tool=1"); } } @@ -45,9 +43,7 @@ if ($enabled === 'true') { } // COURSE ADMIN ONLY VIEW - $blocks = []; - // Start of tools for CourseAdmins (teachers/tutors) if ($session_id === 0 && api_is_course_admin() && api_is_allowed_to_edit(null, true)) { $content .= '
diff --git a/main/inc/lib/pear/HTML/Common.php b/main/inc/lib/pear/HTML/Common.php index 822e08a3c8..21cb6f1840 100755 --- a/main/inc/lib/pear/HTML/Common.php +++ b/main/inc/lib/pear/HTML/Common.php @@ -241,7 +241,7 @@ class HTML_Common if (isset($attributes[$attr])) { unset($attributes[$attr]); } - } //end func _removeAttr + } /** * Returns the value of the given attribute @@ -251,14 +251,15 @@ class HTML_Common * @access public * @return string|null returns null if an attribute does not exist */ - function getAttribute($attr) + public function getAttribute($attr) { $attr = strtolower($attr); if (isset($this->_attributes[$attr])) { return $this->_attributes[$attr]; } + return null; - } //end func getAttribute + } /** * Sets the value of the attribute