diff --git a/main/dashboard/block.class.php b/main/dashboard/block.class.php index 9e85d71d6b..b08055c9d4 100644 --- a/main/dashboard/block.class.php +++ b/main/dashboard/block.class.php @@ -2,38 +2,48 @@ /* For licensing terms, see /license.txt */ /** - * This file contains class used parent class for blocks plugins + * This file contains class used parent class for blocks plugins * @author Christian Fasanando * @package chamilo.dashboard */ /** * Parent class for controller Blocks from dashboard plugin - * @package chamilo.dashboard + * @package chamilo.dashboard */ - -class Block { +class Block +{ /** * Contructor */ - public function __construct() {} - + public function __construct() + { + + } + /** * Display small blocks, @todo it will be implemented for next version */ - public function display_small() {} - + public function display_small() + { + + } + /** * Display larges blocks, @todo it will be implemented for next version */ - public function display_large() {} - - public function get_block_path(){ + public function display_large() + { + + } + + public function get_block_path() + { $result = get_class($this); + return $result; } - } -?> \ No newline at end of file +?> diff --git a/plugin/dashboard/block_course/block_course.class.php b/plugin/dashboard/block_course/block_course.class.php index 1e705f4591..1a45c4b8c4 100644 --- a/plugin/dashboard/block_course/block_course.class.php +++ b/plugin/dashboard/block_course/block_course.class.php @@ -32,13 +32,7 @@ class BlockCourse extends Block $this->user_id = $user_id; $this->path = 'block_course'; if ($this->is_block_visible_for_user($user_id)) { - /*if (api_is_platform_admin()) { - $this->courses = CourseManager::get_real_course_list(); - } else {*/ - $this->courses = CourseManager::get_courses_followed_by_drh( - $user_id - ); - //} + $this->courses = CourseManager::get_courses_followed_by_drh($user_id); } } @@ -72,8 +66,6 @@ class BlockCourse extends Block global $charset; $column = 2; $data = array(); - $content = ''; - $data_table = ''; $content = $this->get_content_html(); $html = '
  • @@ -107,7 +99,6 @@ class BlockCourse extends Block */ public function get_content_html() { - $course_data = $this->get_course_information_data(); $content = '
    '; $content .= '

    ' . get_lang( @@ -119,12 +110,8 @@ class BlockCourse extends Block $data_table .= ' ' . get_lang('CourseTitle') . ' ' . get_lang('NbStudents') . ' - ' . get_lang( - 'AvgTimeSpentInTheCourse' - ) . ' - ' . get_lang( - 'ThematicAdvance' - ) . ' + ' . get_lang('AvgTimeSpentInTheCourse') . ' + ' . get_lang('ThematicAdvance') . ' '; $i = 1; foreach ($course_data as $course) { @@ -149,9 +136,7 @@ class BlockCourse extends Block } $content .= $data_table; if (!empty($course_data)) { - $content .= ''; + $content .= ''; } $content .= '

    '; diff --git a/plugin/dashboard/block_daily/block_daily.class.php b/plugin/dashboard/block_daily/block_daily.class.php index 892ef6657c..895e754a73 100644 --- a/plugin/dashboard/block_daily/block_daily.class.php +++ b/plugin/dashboard/block_daily/block_daily.class.php @@ -36,13 +36,9 @@ class BlockDaily extends Block $this->user_id = $user_id; $this->path = 'block_daily'; if ($this->is_block_visible_for_user($user_id)) { - /*if (api_is_platform_admin()) { - $this->courses = CourseManager::get_real_course_list(); - } else {*/ $this->courses = CourseManager::get_courses_followed_by_drh( $user_id ); - //} } } @@ -75,11 +71,8 @@ class BlockDaily extends Block { global $charset; - $column = 2; $data = array(); - $content = ''; - $data_table = ''; $content = $this->get_content_html(); $html = '
  • @@ -112,7 +105,6 @@ class BlockDaily extends Block */ public function get_content_html() { - $course_data = $this->get_course_information_data(); $content = '
    '; $content .= '

    ' . get_lang( 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 89f63e6fea..240b73355c 100644 --- a/plugin/dashboard/block_global_info/block_global_info.class.php +++ b/plugin/dashboard/block_global_info/block_global_info.class.php @@ -61,15 +61,12 @@ class BlockGlobalInfo extends Block * it's important to use the name 'get_block' for beeing used from dashboard controller * @return array column and content html */ - public function get_block() { - + public function get_block() + { global $charset; - $column = 2; $data = array(); - $content = ''; - $data_table = ''; - $content = $this->get_content_html(); + $content = $this->get_content_html(); $html = '
  • @@ -91,8 +88,8 @@ class BlockGlobalInfo extends Block * This method return a content html, it's used inside get_block method for showing it inside dashboard interface * @return string content html */ - public function get_content_html() { - + public function get_content_html() + { $global_data = $this->get_global_information_data(); $content = '
    '; $content .= '

    '.get_lang('GlobalPlatformInformation').'

    '; diff --git a/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php b/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php index 52e05fa746..bd81c97a7d 100644 --- a/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php +++ b/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php @@ -23,7 +23,6 @@ require_once api_get_path(LIBRARY_PATH).'pchart/pCache.class.php'; */ class BlockTeacherGraph extends Block { - private $user_id; private $teachers; private $path; @@ -64,7 +63,6 @@ class BlockTeacherGraph extends Block */ public function get_block() { - global $charset; $column = 1; $data = array();