Minor - format code.

1.9.x
Julio Montoya 12 years ago
parent b6df93a346
commit bc00fdf0c9
  1. 36
      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

@ -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 <christian1827@gmail.com>
* @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;
}
}
?>
?>

@ -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 = '
<li class="widget color-green" id="intro">
@ -107,7 +99,6 @@ class BlockCourse extends Block
*/
public function get_content_html()
{
$course_data = $this->get_course_information_data();
$content = '<div style="margin:10px;">';
$content .= '<h3><font color="#000">' . get_lang(
@ -119,12 +110,8 @@ class BlockCourse extends Block
$data_table .= '<tr>
<th>' . get_lang('CourseTitle') . '</th>
<th width="20%">' . get_lang('NbStudents') . '</th>
<th width="20%">' . get_lang(
'AvgTimeSpentInTheCourse'
) . '</th>
<th width="20%">' . get_lang(
'ThematicAdvance'
) . '</th>
<th width="20%">' . get_lang('AvgTimeSpentInTheCourse') . '</th>
<th width="20%">' . get_lang('ThematicAdvance') . '</th>
</tr>';
$i = 1;
foreach ($course_data as $course) {
@ -149,9 +136,7 @@ class BlockCourse extends Block
}
$content .= $data_table;
if (!empty($course_data)) {
$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>';
$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>';
}
$content .= '</div>';

@ -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 = '<li class="widget color-green" id="intro">
<div class="widget-head">
@ -112,7 +105,6 @@ class BlockDaily extends Block
*/
public function get_content_html()
{
$course_data = $this->get_course_information_data();
$content = '<div style="margin:10px;">';
$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
* @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 = '
<li class="widget color-red" id="intro">
<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
* @return string content html
*/
public function get_content_html() {
public function get_content_html()
{
$global_data = $this->get_global_information_data();
$content = '<div style="margin:10px;">';
$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
{
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();

Loading…
Cancel
Save