diff --git a/main/admin/index.php b/main/admin/index.php index 39e6f0b99e..55728c3a0c 100644 --- a/main/admin/index.php +++ b/main/admin/index.php @@ -353,8 +353,8 @@ function check_system_version() { $number_of_courses = Statistics::count_courses(); // The number of users - $number_of_users = statistics::count_users(); - $number_of_active_users = statistics::count_users(null,null,null,true); + $number_of_users = Statistics::count_users(); + $number_of_active_users = Statistics::count_users(null,null,null,true); $data = array( 'url' => api_get_path(WEB_PATH), diff --git a/plugin/dashboard/block_global_info/block_global_info.class.php b/plugin/dashboard/block_global_info/block_global_info.class.php index b261ea9e90..ec301154a2 100644 --- a/plugin/dashboard/block_global_info/block_global_info.class.php +++ b/plugin/dashboard/block_global_info/block_global_info.class.php @@ -1,7 +1,7 @@ user_id = $user_id; - $this->path = 'block_global_info'; + $this->path = 'block_global_info'; if ($this->is_block_visible_for_user($user_id)) { //$this->courses = CourseManager::get_courses_followed_by_drh($user_id); } } - + /** * This method check if a user is allowed to see the block inside dashboard interface * @param int User id * @return bool Is block visible for user - */ - public function is_block_visible_for_user($user_id) { + */ + public function is_block_visible_for_user($user_id) + { $user_info = api_get_user_info($user_id); $user_status = $user_info['status']; $is_block_visible_for_user = false; if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { $is_block_visible_for_user = true; - } - return $is_block_visible_for_user; + } + return $is_block_visible_for_user; } - + /** * This method return content html containing information about courses and its position for showing it inside dashboard interface @@ -91,6 +94,7 @@ class BlockGlobalInfo extends Block { $global_data = $this->get_global_information_data(); $content = '
'; $content .= '

'.get_lang('GlobalPlatformInformation').'

'; + $data_table = null; if (!empty($global_data)) { $data_table = ''; $i = 1; @@ -110,7 +114,7 @@ class BlockGlobalInfo extends Block { $data_table .= '
'; } else { $data_table .= get_lang('ThereIsNoInformationAboutThePlatform'); - } + } $content .= $data_table; $content .= '
'; @@ -121,22 +125,22 @@ class BlockGlobalInfo extends Block { * Get global information data * @return array */ - function get_global_information_data() { + function get_global_information_data() + { // Two-dimensional array with data about the system - $global_info = array(); $path = api_get_path(WEB_CODE_PATH); // Check total number of users - $global_info[] = array(get_lang('CountUsers'), ''.statistics::count_users().''); - // Check only active users - $global_info[] = array(get_lang('NumberOfUsersActive'), ''.statistics::count_users(null,null,null,true).''); - // Check number of courses - $global_info[] = array(get_lang('NumberOfCoursesTotal'), ''.statistics::count_courses().''); - $global_info[] = array(get_lang('NumberOfCoursesPublic'), ''.statistics::count_courses_by_visibility(COURSE_VISIBILITY_OPEN_WORLD).''); - $global_info[] = array(get_lang('NumberOfCoursesOpen'), ''.statistics::count_courses_by_visibility(COURSE_VISIBILITY_OPEN_PLATFORM).''); - $global_info[] = array(get_lang('NumberOfCoursesPrivate'), ''.statistics::count_courses_by_visibility(COURSE_VISIBILITY_REGISTERED).''); - $global_info[] = array(get_lang('NumberOfCoursesClosed'), ''.statistics::count_courses_by_visibility(COURSE_VISIBILITY_CLOSED).''); + $global_info = array( + array(get_lang('CountUsers'), ''.Statistics::count_users().''), + // Check only active users + array(get_lang('NumberOfUsersActive'), ''.Statistics::count_users(null,null,null,true).''), + // Check number of courses + array(get_lang('NumberOfCoursesTotal'), ''.Statistics::count_courses().''), + array(get_lang('NumberOfCoursesPublic'), ''.Statistics::count_courses_by_visibility(COURSE_VISIBILITY_OPEN_WORLD).''), + array(get_lang('NumberOfCoursesOpen'), ''.Statistics::count_courses_by_visibility(COURSE_VISIBILITY_OPEN_PLATFORM).''), + array(get_lang('NumberOfCoursesPrivate'), ''.Statistics::count_courses_by_visibility(COURSE_VISIBILITY_REGISTERED).''), + array(get_lang('NumberOfCoursesClosed'), ''.Statistics::count_courses_by_visibility(COURSE_VISIBILITY_CLOSED).'') + ); return $global_info; } - } -