Minor - format code

pull/2487/head
jmontoyaa 9 years ago
parent 9f15314831
commit dd2d7edff6
  1. 4
      main/gradebook/lib/fe/exportgradebook.php
  2. 20
      main/gradebook/lib/fe/flatviewtable.class.php
  3. 18
      main/gradebook/lib/fe/gradebooktable.class.php
  4. 2
      plugin/vchamilo/views/editinstance.php
  5. 10
      plugin/vchamilo/views/editinstance_form.php

@ -97,7 +97,7 @@ a:active {text-decoration: none; font-weight : bold; color : black;}
*/
function export_pdf_attendance($headers_table, $data_table, $headers_pdf, $footers_pdf, $title_pdf)
{
$mpdf = new mPDF('UTF-8', 'A4-L', '', '', 15, 10, 35, 20, 4, 2, 'L');
$mpdf = new mPDF('UTF-8', 'A4-L', '', '', 15, 10, 35, 20, 4, 2, 'L');
$mpdf->useOnlyCoreFonts = true;
$mpdf->mirrorMargins = 0;
// Use different Odd/Even headers and footers and mirror margins
@ -146,7 +146,7 @@ function export_pdf_attendance($headers_table, $data_table, $headers_pdf, $foote
// preparing content pdf
$css_file = api_get_path(SYS_CSS_PATH).'themes/'.api_get_setting('stylesheets').'/print.css';
if (file_exists($css_file)) {
$css = @file_get_contents($css_file);
} else {

@ -44,7 +44,12 @@ class FlatViewTable extends SortableTable
$addparams = null,
$mainCourseCategory = null
) {
parent :: __construct('flatviewlist', null, null, api_is_western_name_order() ? 1 : 0);
parent:: __construct(
'flatviewlist',
null,
null,
api_is_western_name_order() ? 1 : 0
);
$this->selectcat = $selectcat;
@ -103,7 +108,6 @@ class FlatViewTable extends SortableTable
//if (empty($this->datagen->get_total_items_count()) || empty($total_users)) {
if (empty($user_results) || empty($total_users)) {
echo get_lang('NoResults');
return '';
}
@ -123,7 +127,6 @@ class FlatViewTable extends SortableTable
}
$i = 0;
$show_draw = false;
$resource_list = array();
$pre_result2 = array();
@ -149,8 +152,9 @@ class FlatViewTable extends SortableTable
}
foreach ($customdisplays as $display) {
if (!in_array($display['display'], $key_list))
if (!in_array($display['display'], $key_list)) {
$resource_list[$key][$display['display']] = 0;
}
}
$i++;
}
@ -161,7 +165,6 @@ class FlatViewTable extends SortableTable
$new_list = array();
foreach ($resource_list as $key => $value) {
$new_value = array();
foreach ($customdisplays as $item) {
if ($value[$item['display']] > $max) {
$max = $value[$item['display']];
@ -379,7 +382,6 @@ class FlatViewTable extends SortableTable
}
// retrieve sorting type
if ($is_western_name_order) {
$users_sorting = ($this->column == 0 ? FlatViewDataGenerator :: FVDG_SORT_FIRSTNAME : FlatViewDataGenerator :: FVDG_SORT_LASTNAME);
} else {
@ -468,13 +470,13 @@ class FlatViewTable extends SortableTable
}
/**
* @param $user_id
* @param $userId
* @param $name
*
* @return string
*/
private function build_name_link($user_id, $name)
private function build_name_link($userId, $name)
{
return '<a href="user_stats.php?userid=' . $user_id . '&selectcat=' . $this->selectcat->get_id() . '&'.api_get_cidreq().'">' . $name . '</a>';
return '<a href="user_stats.php?userid=' . $userId . '&selectcat=' . $this->selectcat->get_id() . '&'.api_get_cidreq().'">' . $name . '</a>';
}
}

@ -493,7 +493,6 @@ class GradebookTable extends SortableTable
if (count($eval_n_links)> 0) {
$value_data = isset($data[4]) ? $data[4] : null;
if (!is_null($value_data)) {
//$score = $item->calc_score(api_get_user_id());
//$new_score = $data[3] * $score[0] / $score[1];
@ -501,7 +500,6 @@ class GradebookTable extends SortableTable
// Result
$row[] = $value_data;
$best = isset($data['best']) ? $data['best'] : null;
$average = isset($data['average']) ? $data['average'] : null;
$ranking = isset($data['ranking']) ? $data['ranking'] : null;
@ -806,8 +804,19 @@ class GradebookTable extends SortableTable
$pChart->Antialias = false;
/* Add a border to the picture */
$pChart->drawRectangle(0,0,$xSize-10,$ySize-10,array("R"=>0,"G"=>0,"B"=>0));
$pChart->drawText(10,16,get_lang('Results'),array("FontSize"=>11,"Align"=> TEXT_ALIGN_BOTTOMMIDDLE));
$pChart->drawRectangle(
0,
0,
$xSize - 10,
$ySize - 10,
array("R" => 0, "G" => 0, "B" => 0)
);
$pChart->drawText(
10,
16,
get_lang('Results'),
array("FontSize" => 11, "Align" => TEXT_ALIGN_BOTTOMMIDDLE)
);
$pChart->setGraphArea(50, 30, $xSize-50, $ySize-50);
$pChart->setFontProperties(
array(
@ -945,7 +954,6 @@ class GradebookTable extends SortableTable
// category
case 'C':
$prms_uri='?selectcat=' . $item->get_id() . '&amp;view='.$view;
if (isset($_GET['isStudentView'])) {
if ( isset($is_student) || (isset($_SESSION['studentview']) && $_SESSION['studentview']=='studentview') ) {
$prms_uri=$prms_uri.'&amp;isStudentView='.Security::remove_XSS($_GET['isStudentView']);

@ -26,7 +26,7 @@ if ($id) {
$mode = $registeronly ? 'register' : 'add' ;
}
$vhost = (array) Virtual::getInstance($id);
$vhost = (array) Virtual::getInstance($id);
$form = new InstanceForm($plugin, $mode, $vhost);

@ -438,22 +438,24 @@ class InstanceForm extends ChamiloForm
$form->addLabel(
'archive_real_root',
Virtual::getConfig('vchamilo', 'archive_real_root').$this->instance['slug']
api_add_trailing_slash(Virtual::getConfig('vchamilo', 'archive_real_root')).
$this->instance['slug']
);
$form->addLabel(
'course_real_root',
Virtual::getConfig('vchamilo', 'course_real_root').$this->instance['slug']
api_add_trailing_slash(Virtual::getConfig('vchamilo', 'course_real_root')).
$this->instance['slug']
);
$form->addLabel(
'home_real_root',
Virtual::getConfig('vchamilo', 'home_real_root').$this->instance['slug']
api_add_trailing_slash(Virtual::getConfig('vchamilo', 'home_real_root')).$this->instance['slug']
);
$form->addLabel(
'upload_real_root',
Virtual::getConfig('vchamilo', 'upload_real_root').$this->instance['slug']
api_add_trailing_slash(Virtual::getConfig('vchamilo', 'upload_real_root')).$this->instance['slug']
);
$form->addLabel(

Loading…
Cancel
Save