Minor - format code

pull/2731/head
Julio Montoya 7 years ago
parent d13365c194
commit c1eedf18b0
  1. 2
      main/admin/dashboard_add_users_to_user.php
  2. 15
      main/auth/courses.php
  3. 12
      main/auth/courses_controller.php
  4. 6
      main/course_home/activity.php
  5. 7
      main/inc/lib/pear/HTML/Common.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();

@ -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) {

@ -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'),

@ -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 .= '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;">

@ -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

Loading…
Cancel
Save