Forráskód Böngészése

Minor - format code.

jmontoyaa 7 éve
szülő
commit
b882339875

+ 5 - 12
main/gradebook/gradebook_flatview.php

@@ -22,7 +22,7 @@ if (!$isDrhOfCourse) {
     GradebookUtils::block_students();
 }
 
-if (isset ($_POST['submit']) && isset ($_POST['keyword'])) {
+if (isset($_POST['submit']) && isset($_POST['keyword'])) {
     header('Location: '.api_get_self().'?selectcat='.intval($_GET['selectcat']).'&search='.Security::remove_XSS($_POST['keyword']));
     exit;
 }
@@ -40,21 +40,16 @@ if (($showlink == '0') && ($showeval == '0')) {
 }
 
 $cat = Category::load($_REQUEST['selectcat']);
-
-if (isset($_GET['userid'])) {
-    $userid = Security::remove_XSS($_GET['userid']);
-} else {
-    $userid = '';
-}
+$userId = isset($_GET['userid']) ? (int) $_GET['userid'] : 0;
 
 if ($showeval) {
-    $alleval = $cat[0]->get_evaluations($userid, true);
+    $alleval = $cat[0]->get_evaluations($userId, true);
 } else {
     $alleval = null;
 }
 
 if ($showlink) {
-    $alllinks = $cat[0]->get_links($userid, true);
+    $alllinks = $cat[0]->get_links($userId, true);
 } else {
     $alllinks = null;
 }
@@ -124,7 +119,6 @@ $flatviewtable = new FlatViewTable(
 );
 
 $flatviewtable->setAutoFill(false);
-
 $parameters = array('selectcat' => intval($_GET['selectcat']));
 $flatviewtable->set_additional_parameters($parameters);
 
@@ -272,7 +266,7 @@ $this_section = SECTION_COURSES;
 if (isset($_GET['exportpdf'])) {
     $export_pdf_form->display();
 } else {
-    Display :: display_header(get_lang('FlatView'));
+    Display::display_header(get_lang('FlatView'));
 }
 
 if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') {
@@ -284,7 +278,6 @@ if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') {
     );
     $flatviewtable->display();
 } elseif (isset($_GET['selectcat']) && ($_SESSION['studentview'] == 'teacherview')) {
-
     DisplayGradebook:: display_header_reduce_flatview(
         $cat[0],
         $showeval,

+ 7 - 2
main/gradebook/lib/fe/flatviewtable.class.php

@@ -330,8 +330,13 @@ class FlatViewTable extends SortableTable
     /**
      * Function used by SortableTable to generate the data to display
      */
-    public function get_table_data($from = 1, $per_page = null, $column = null, $direction = null, $sort = null)
-    {
+    public function get_table_data(
+        $from = 1,
+        $per_page = null,
+        $column = null,
+        $direction = null,
+        $sort = null
+    ) {
         $is_western_name_order = api_is_western_name_order();
 
         // create page navigation if needed

+ 7 - 2
main/gradebook/lib/scoredisplay.class.php

@@ -321,13 +321,18 @@ class ScoreDisplay
             // if no custom display set, use default display
             $display = $this->display_default($my_score, $type);
         }
-
         if ($this->coloring_enabled && $no_color != false) {
             $my_score_denom = isset($score[1]) && !empty($score[1]) && $score[1] > 0 ? $score[1] : 1;
             $scoreCleaned = isset($score[0]) ? $score[0] : 0;
+
             if (($scoreCleaned / $my_score_denom) < ($this->color_split_value / 100)) {
-                $display = Display::tag('font', $display, array('color'=>'red'));
+                $display = Display::tag(
+                    'font',
+                    $display,
+                    array('color' => 'red')
+                );
             }
+
         }
 
         return $display;