Minor - format code.

1.9.x
Julio Montoya 12 years ago
parent b6df93a346
commit bc00fdf0c9
  1. 24
      main/dashboard/block.class.php
  2. 23
      plugin/dashboard/block_course/block_course.class.php
  3. 8
      plugin/dashboard/block_daily/block_daily.class.php
  4. 13
      plugin/dashboard/block_global_info/block_global_info.class.php
  5. 2
      plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php

@ -12,28 +12,38 @@
* @package chamilo.dashboard * @package chamilo.dashboard
*/ */
class Block { class Block
{
/** /**
* Contructor * Contructor
*/ */
public function __construct() {} public function __construct()
{
}
/** /**
* Display small blocks, @todo it will be implemented for next version * 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 * Display larges blocks, @todo it will be implemented for next version
*/ */
public function display_large() {} public function display_large()
{
public function get_block_path(){ }
public function get_block_path()
{
$result = get_class($this); $result = get_class($this);
return $result; return $result;
} }
} }
?> ?>

@ -32,13 +32,7 @@ class BlockCourse extends Block
$this->user_id = $user_id; $this->user_id = $user_id;
$this->path = 'block_course'; $this->path = 'block_course';
if ($this->is_block_visible_for_user($user_id)) { if ($this->is_block_visible_for_user($user_id)) {
/*if (api_is_platform_admin()) { $this->courses = CourseManager::get_courses_followed_by_drh($user_id);
$this->courses = CourseManager::get_real_course_list();
} else {*/
$this->courses = CourseManager::get_courses_followed_by_drh(
$user_id
);
//}
} }
} }
@ -72,8 +66,6 @@ class BlockCourse extends Block
global $charset; global $charset;
$column = 2; $column = 2;
$data = array(); $data = array();
$content = '';
$data_table = '';
$content = $this->get_content_html(); $content = $this->get_content_html();
$html = ' $html = '
<li class="widget color-green" id="intro"> <li class="widget color-green" id="intro">
@ -107,7 +99,6 @@ class BlockCourse extends Block
*/ */
public function get_content_html() public function get_content_html()
{ {
$course_data = $this->get_course_information_data(); $course_data = $this->get_course_information_data();
$content = '<div style="margin:10px;">'; $content = '<div style="margin:10px;">';
$content .= '<h3><font color="#000">' . get_lang( $content .= '<h3><font color="#000">' . get_lang(
@ -119,12 +110,8 @@ class BlockCourse extends Block
$data_table .= '<tr> $data_table .= '<tr>
<th>' . get_lang('CourseTitle') . '</th> <th>' . get_lang('CourseTitle') . '</th>
<th width="20%">' . get_lang('NbStudents') . '</th> <th width="20%">' . get_lang('NbStudents') . '</th>
<th width="20%">' . get_lang( <th width="20%">' . get_lang('AvgTimeSpentInTheCourse') . '</th>
'AvgTimeSpentInTheCourse' <th width="20%">' . get_lang('ThematicAdvance') . '</th>
) . '</th>
<th width="20%">' . get_lang(
'ThematicAdvance'
) . '</th>
</tr>'; </tr>';
$i = 1; $i = 1;
foreach ($course_data as $course) { foreach ($course_data as $course) {
@ -149,9 +136,7 @@ class BlockCourse extends Block
} }
$content .= $data_table; $content .= $data_table;
if (!empty($course_data)) { if (!empty($course_data)) {
$content .= '<div style="text-align:right;margin-top:10px;"><a href="' . api_get_path( $content .= '<div style="text-align:right;margin-top:10px;"><a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/course.php">' . get_lang('SeeMore') . '</a></div>';
WEB_CODE_PATH
) . 'mySpace/course.php">' . get_lang('SeeMore') . '</a></div>';
} }
$content .= '</div>'; $content .= '</div>';

@ -36,13 +36,9 @@ class BlockDaily extends Block
$this->user_id = $user_id; $this->user_id = $user_id;
$this->path = 'block_daily'; $this->path = 'block_daily';
if ($this->is_block_visible_for_user($user_id)) { 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( $this->courses = CourseManager::get_courses_followed_by_drh(
$user_id $user_id
); );
//}
} }
} }
@ -75,11 +71,8 @@ class BlockDaily extends Block
{ {
global $charset; global $charset;
$column = 2; $column = 2;
$data = array(); $data = array();
$content = '';
$data_table = '';
$content = $this->get_content_html(); $content = $this->get_content_html();
$html = '<li class="widget color-green" id="intro"> $html = '<li class="widget color-green" id="intro">
<div class="widget-head"> <div class="widget-head">
@ -112,7 +105,6 @@ class BlockDaily extends Block
*/ */
public function get_content_html() public function get_content_html()
{ {
$course_data = $this->get_course_information_data(); $course_data = $this->get_course_information_data();
$content = '<div style="margin:10px;">'; $content = '<div style="margin:10px;">';
$content .= '<h3><font color="#000">' . get_lang( $content .= '<h3><font color="#000">' . get_lang(

@ -61,15 +61,12 @@ class BlockGlobalInfo extends Block
* it's important to use the name 'get_block' for beeing used from dashboard controller * it's important to use the name 'get_block' for beeing used from dashboard controller
* @return array column and content html * @return array column and content html
*/ */
public function get_block() { public function get_block()
{
global $charset; global $charset;
$column = 2; $column = 2;
$data = array(); $data = array();
$content = ''; $content = $this->get_content_html();
$data_table = '';
$content = $this->get_content_html();
$html = ' $html = '
<li class="widget color-red" id="intro"> <li class="widget color-red" id="intro">
<div class="widget-head"> <div class="widget-head">
@ -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 * This method return a content html, it's used inside get_block method for showing it inside dashboard interface
* @return string content html * @return string content html
*/ */
public function get_content_html() { public function get_content_html()
{
$global_data = $this->get_global_information_data(); $global_data = $this->get_global_information_data();
$content = '<div style="margin:10px;">'; $content = '<div style="margin:10px;">';
$content .= '<h3><font color="#000">'.get_lang('GlobalPlatformInformation').'</font></h3>'; $content .= '<h3><font color="#000">'.get_lang('GlobalPlatformInformation').'</font></h3>';

@ -23,7 +23,6 @@ require_once api_get_path(LIBRARY_PATH).'pchart/pCache.class.php';
*/ */
class BlockTeacherGraph extends Block class BlockTeacherGraph extends Block
{ {
private $user_id; private $user_id;
private $teachers; private $teachers;
private $path; private $path;
@ -64,7 +63,6 @@ class BlockTeacherGraph extends Block
*/ */
public function get_block() public function get_block()
{ {
global $charset; global $charset;
$column = 1; $column = 1;
$data = array(); $data = array();

Loading…
Cancel
Save