From dd2d7edff65c7ae0fe47ab2f705632b3f5e27591 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 31 Jan 2017 13:44:15 +0100 Subject: [PATCH] Minor - format code --- main/gradebook/lib/fe/exportgradebook.php | 4 ++-- main/gradebook/lib/fe/flatviewtable.class.php | 20 ++++++++++--------- .../gradebook/lib/fe/gradebooktable.class.php | 18 ++++++++++++----- plugin/vchamilo/views/editinstance.php | 2 +- plugin/vchamilo/views/editinstance_form.php | 10 ++++++---- 5 files changed, 33 insertions(+), 21 deletions(-) diff --git a/main/gradebook/lib/fe/exportgradebook.php b/main/gradebook/lib/fe/exportgradebook.php index f5d31ad73a..38a7114911 100755 --- a/main/gradebook/lib/fe/exportgradebook.php +++ b/main/gradebook/lib/fe/exportgradebook.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 { diff --git a/main/gradebook/lib/fe/flatviewtable.class.php b/main/gradebook/lib/fe/flatviewtable.class.php index b138d5d97e..bc21211838 100755 --- a/main/gradebook/lib/fe/flatviewtable.class.php +++ b/main/gradebook/lib/fe/flatviewtable.class.php @@ -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 '' . $name . ''; + return '' . $name . ''; } } diff --git a/main/gradebook/lib/fe/gradebooktable.class.php b/main/gradebook/lib/fe/gradebooktable.class.php index 7e246abe47..7e05fa2a4d 100755 --- a/main/gradebook/lib/fe/gradebooktable.class.php +++ b/main/gradebook/lib/fe/gradebooktable.class.php @@ -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() . '&view='.$view; - if (isset($_GET['isStudentView'])) { if ( isset($is_student) || (isset($_SESSION['studentview']) && $_SESSION['studentview']=='studentview') ) { $prms_uri=$prms_uri.'&isStudentView='.Security::remove_XSS($_GET['isStudentView']); diff --git a/plugin/vchamilo/views/editinstance.php b/plugin/vchamilo/views/editinstance.php index 41fe36568d..0a9e069e8a 100644 --- a/plugin/vchamilo/views/editinstance.php +++ b/plugin/vchamilo/views/editinstance.php @@ -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); diff --git a/plugin/vchamilo/views/editinstance_form.php b/plugin/vchamilo/views/editinstance_form.php index 8c501e25ad..44f7734fc9 100644 --- a/plugin/vchamilo/views/editinstance_form.php +++ b/plugin/vchamilo/views/editinstance_form.php @@ -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(