Completed
Push — 1.10.x ( 4c5f4c...61bcd5 )
by Yannick
419:40 queued 371:43
created
main/gradebook/get_badges.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 foreach ($userSkills as $skill) {
34 34
     $skillId = current($skill);
35 35
 
36
-    $assertionUrl = api_get_path(WEB_CODE_PATH) . "badge/assertion.php?";
36
+    $assertionUrl = api_get_path(WEB_CODE_PATH)."badge/assertion.php?";
37 37
     $assertionUrl .= http_build_query(array(
38 38
         'user' => $userId,
39 39
         'skill' => $skillId,
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
     $backpack = $configBackpack;
52 52
 }
53 53
 
54
-$htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>';
54
+$htmlHeadXtra[] = '<script src="'.$backpack.'issuer.js"></script>';
55 55
 
56 56
 $tpl = new Template(get_lang('Badges'), false, false);
57 57
 
58 58
 $tpl->assign(
59 59
     'content',
60 60
     "<script>"
61
-    . "$(document).on('ready', function (){ OpenBadges.issue_no_modal(" . json_encode($assertions) . "); });"
61
+    . "$(document).on('ready', function (){ OpenBadges.issue_no_modal(".json_encode($assertions)."); });"
62 62
     . "</script>"
63 63
 );
64 64
 
Please login to merge, or discard this patch.
main/gradebook/gradebook_add_result.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 //$cidReset = true;
9 9
 require_once '../inc/global.inc.php';
10
-$current_course_tool  = TOOL_GRADEBOOK;
10
+$current_course_tool = TOOL_GRADEBOOK;
11 11
 
12 12
 api_protect_course_script(true);
13 13
 api_block_anonymous_users();
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
     $resultadd,
24 24
     'add_result_form',
25 25
     null,
26
-    api_get_self() . '?selectcat=' . Security::remove_XSS($category) . '&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()
26
+    api_get_self().'?selectcat='.Security::remove_XSS($category).'&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()
27 27
 );
28 28
 $table = $add_result_form->toHtml();
29 29
 if ($add_result_form->validate()) {
30 30
     $values = $add_result_form->exportValues();
31 31
     $nr_users = $values['nr_users'];
32 32
     if ($nr_users == '0') {
33
-        header('Location: gradebook_view_result.php?addresultnostudents=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
33
+        header('Location: gradebook_view_result.php?addresultnostudents=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
34 34
         exit;
35 35
     }
36 36
     $scores = ($values['score']);
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $res->add();
44 44
         next($scores);
45 45
     }
46
-    header('Location: gradebook_view_result.php?addresult=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
46
+    header('Location: gradebook_view_result.php?addresult=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
47 47
     exit;
48 48
 }
49 49
 $interbreadcrumb[] = array(
@@ -51,6 +51,6 @@  discard block
 block discarded – undo
51 51
     'name' => get_lang('Gradebook')
52 52
 );
53 53
 Display :: display_header(get_lang('AddResult'));
54
-DisplayGradebook :: display_header_result ($evaluation[0], null, 0,0);
54
+DisplayGradebook :: display_header_result($evaluation[0], null, 0, 0);
55 55
 echo $table;
56 56
 Display :: display_footer();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@
 block discarded – undo
39 39
         $res->set_evaluation_id($values['evaluation_id']);
40 40
         $res->set_user_id(key($scores));
41 41
         //if no scores are given, don't set the score
42
-        if ((!empty ($row)) || ($row == '0')) $res->set_score($row);
42
+        if ((!empty ($row)) || ($row == '0')) {
43
+            $res->set_score($row);
44
+        }
43 45
         $res->add();
44 46
         next($scores);
45 47
     }
Please login to merge, or discard this patch.
main/gradebook/gradebook_add_eval.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     null,
31 31
     'add_eval_form',
32 32
     null,
33
-    api_get_self() . '?selectcat=' . $select_cat.'&'.api_get_cidreq()
33
+    api_get_self().'?selectcat='.$select_cat.'&'.api_get_cidreq()
34 34
 );
35 35
 
36 36
 if ($form->validate()) {
@@ -69,23 +69,23 @@  discard block
 block discarded – undo
69 69
             //header('Location: gradebook_add_user.php?selecteval=' . $eval->get_id());
70 70
             exit;
71 71
         } else {
72
-            header('Location: ' . Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $eval->get_category_id().'&'.api_get_cidreq());
72
+            header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$eval->get_category_id().'&'.api_get_cidreq());
73 73
             exit;
74 74
         }
75 75
     } else {
76 76
         $val_addresult = isset($values['addresult']) ? $values['addresult'] : null;
77 77
         if ($val_addresult == 1) {
78
-            header('Location: gradebook_add_result.php?selecteval=' . $eval->get_id().'&'.api_get_cidreq());
78
+            header('Location: gradebook_add_result.php?selecteval='.$eval->get_id().'&'.api_get_cidreq());
79 79
             exit;
80 80
         } else {
81
-            header('Location: ' . Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $eval->get_category_id().'&'.api_get_cidreq());
81
+            header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$eval->get_category_id().'&'.api_get_cidreq());
82 82
             exit;
83 83
         }
84 84
     }
85 85
 }
86 86
 
87 87
 $interbreadcrumb[] = array(
88
-    'url' => Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $select_cat.'&'.api_get_cidreq(),
88
+    'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$select_cat.'&'.api_get_cidreq(),
89 89
     'name' => get_lang('Gradebook'))
90 90
 ;
91 91
 $this_section = SECTION_COURSES;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
        $("#hid_category_id option:selected").each(function () {
97 97
            var cat_id = $(this).val();
98 98
             $.ajax({
99
-                url: "' . api_get_path(WEB_AJAX_PATH) . 'gradebook.ajax.php?a=get_gradebook_weight",
99
+                url: "' . api_get_path(WEB_AJAX_PATH).'gradebook.ajax.php?a=get_gradebook_weight",
100 100
                 data: "cat_id="+cat_id,
101 101
                 success: function(return_value) {
102 102
                     if (return_value != 0 ) {
Please login to merge, or discard this patch.
main/gradebook/gradebook_add_link_select_course.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 require_once '../inc/global.inc.php';
10
-$current_course_tool  = TOOL_GRADEBOOK;
10
+$current_course_tool = TOOL_GRADEBOOK;
11 11
 
12 12
 api_protect_course_script(true);
13 13
 api_block_anonymous_users();
@@ -16,13 +16,13 @@  discard block
 block discarded – undo
16 16
 $catadd = new Category();
17 17
 $catadd->set_user_id(api_get_user_id());
18 18
 $catadd->set_parent_id($_GET['selectcat']);
19
-$catcourse = Category :: load ($_GET['selectcat']);
19
+$catcourse = Category :: load($_GET['selectcat']);
20 20
 $form = new CatForm(
21 21
     CatForm :: TYPE_SELECT_COURSE,
22 22
     $catadd,
23 23
     'add_cat_form',
24 24
     null,
25
-    api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq()
25
+    api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq()
26 26
 );
27 27
 
28 28
 if ($form->validate()) {
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
     $cat = new Category();
31 31
     $cat->set_course_code($values['select_course']);
32 32
     $cat->set_name($values['name']);
33
-    header('location: gradebook_add_link.php?selectcat=' .Security::remove_XSS($_GET['selectcat']).'&course_code='.Security::remove_XSS($values['select_course']).'&'.api_get_cidreq());
33
+    header('location: gradebook_add_link.php?selectcat='.Security::remove_XSS($_GET['selectcat']).'&course_code='.Security::remove_XSS($values['select_course']).'&'.api_get_cidreq());
34 34
     exit;
35 35
 }
36 36
 
37
-$interbreadcrumb[] = array (
37
+$interbreadcrumb[] = array(
38 38
     'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(),
39 39
     'name' => get_lang('Gradebook')
40 40
 );
Please login to merge, or discard this patch.
main/gradebook/lib/fe/userform.class.php 3 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -9,71 +9,71 @@
 block discarded – undo
9 9
  */
10 10
 class UserForm extends FormValidator
11 11
 {
12
-	const TYPE_USER_INFO= 1;
13
-	const TYPE_SIMPLE_SEARCH = 3;
14
-	/**
15
-	 * Builds a form containing form items based on a given parameter
16
-	 * @param int form_type 1 = user_info
17
-	 * @param user array
18
-	 * @param string form name
19
-	 * @param method
20
-	 * @param action
21
-	 */
22
-	public function UserForm($form_type, $user, $form_name, $method= 'post', $action= null)
23
-	{
24
-		parent :: __construct($form_name, $method, $action);
25
-		$this->form_type= $form_type;
26
-		if (isset ($user)) {
27
-			$this->user_info= $user;
28
-		}
29
-		if (isset ($result_object)) {
30
-			$this->result_object= $result_object;
31
-		}
32
-		if ($this->form_type == self :: TYPE_USER_INFO) {
33
-			$this->build_user_info_form();
34
-		}
35
-		elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) {
36
-			$this->build_simple_search();
37
-		}
38
-		$this->setDefaults();
39
-	}
12
+    const TYPE_USER_INFO= 1;
13
+    const TYPE_SIMPLE_SEARCH = 3;
14
+    /**
15
+     * Builds a form containing form items based on a given parameter
16
+     * @param int form_type 1 = user_info
17
+     * @param user array
18
+     * @param string form name
19
+     * @param method
20
+     * @param action
21
+     */
22
+    public function UserForm($form_type, $user, $form_name, $method= 'post', $action= null)
23
+    {
24
+        parent :: __construct($form_name, $method, $action);
25
+        $this->form_type= $form_type;
26
+        if (isset ($user)) {
27
+            $this->user_info= $user;
28
+        }
29
+        if (isset ($result_object)) {
30
+            $this->result_object= $result_object;
31
+        }
32
+        if ($this->form_type == self :: TYPE_USER_INFO) {
33
+            $this->build_user_info_form();
34
+        }
35
+        elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) {
36
+            $this->build_simple_search();
37
+        }
38
+        $this->setDefaults();
39
+    }
40 40
 
41
-	protected function build_simple_search()
42
-	{
43
-		if (isset($_GET['search']) && (!empty($_GET['search']))) {
44
-			$this->setDefaults(array(
45
-				'keyword' => Security::remove_XSS($_GET['search'])
46
-			));
47
-		}
48
-		$renderer =& $this->defaultRenderer();
49
-		$renderer->setCustomElementTemplate('<span>{element}</span> ');
50
-		$this->addElement('text','keyword','');
51
-		$this->addButtonSearch(get_lang('Search'), 'submit');
52
-	}
41
+    protected function build_simple_search()
42
+    {
43
+        if (isset($_GET['search']) && (!empty($_GET['search']))) {
44
+            $this->setDefaults(array(
45
+                'keyword' => Security::remove_XSS($_GET['search'])
46
+            ));
47
+        }
48
+        $renderer =& $this->defaultRenderer();
49
+        $renderer->setCustomElementTemplate('<span>{element}</span> ');
50
+        $this->addElement('text','keyword','');
51
+        $this->addButtonSearch(get_lang('Search'), 'submit');
52
+    }
53 53
 
54
-	protected function build_user_info_form()
55
-	{
56
-		if (api_is_western_name_order()) {
57
-			$this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']);
58
-			$this->addElement('static', 'lname', get_lang('LastName'), $this->user_info['lastname']);
59
-		} else {
60
-			$this->addElement('static', 'lname', get_lang('LastName'), $this->user_info['lastname']);
61
-			$this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']);
62
-		}
63
-		$this->addElement('static', 'uname', get_lang('UserName'), $this->user_info['username']);
64
-		$this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:' . $this->user_info['email'] . '">' . $this->user_info['email'] . '</a>');
65
-		$this->addElement('static', 'ofcode', get_lang('OfficialCode'), $this->user_info['official_code']);
66
-		$this->addElement('static', 'phone', get_lang('Phone'), $this->user_info['phone']);
67
-		$this->addButtonSave(get_lang('Back'), 'submit');
68
-	}
54
+    protected function build_user_info_form()
55
+    {
56
+        if (api_is_western_name_order()) {
57
+            $this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']);
58
+            $this->addElement('static', 'lname', get_lang('LastName'), $this->user_info['lastname']);
59
+        } else {
60
+            $this->addElement('static', 'lname', get_lang('LastName'), $this->user_info['lastname']);
61
+            $this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']);
62
+        }
63
+        $this->addElement('static', 'uname', get_lang('UserName'), $this->user_info['username']);
64
+        $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:' . $this->user_info['email'] . '">' . $this->user_info['email'] . '</a>');
65
+        $this->addElement('static', 'ofcode', get_lang('OfficialCode'), $this->user_info['official_code']);
66
+        $this->addElement('static', 'phone', get_lang('Phone'), $this->user_info['phone']);
67
+        $this->addButtonSave(get_lang('Back'), 'submit');
68
+    }
69 69
 
70
-	function display()
71
-	{
72
-		parent :: display();
73
-	}
70
+    function display()
71
+    {
72
+        parent :: display();
73
+    }
74 74
 
75
-	function setDefaults($defaults= array(), $filter = null)
76
-	{
77
-		parent :: setDefaults($defaults, $filter);
78
-	}
75
+    function setDefaults($defaults= array(), $filter = null)
76
+    {
77
+        parent :: setDefaults($defaults, $filter);
78
+    }
79 79
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  */
10 10
 class UserForm extends FormValidator
11 11
 {
12
-	const TYPE_USER_INFO= 1;
12
+	const TYPE_USER_INFO = 1;
13 13
 	const TYPE_SIMPLE_SEARCH = 3;
14 14
 	/**
15 15
 	 * Builds a form containing form items based on a given parameter
@@ -19,15 +19,15 @@  discard block
 block discarded – undo
19 19
 	 * @param method
20 20
 	 * @param action
21 21
 	 */
22
-	public function UserForm($form_type, $user, $form_name, $method= 'post', $action= null)
22
+	public function UserForm($form_type, $user, $form_name, $method = 'post', $action = null)
23 23
 	{
24 24
 		parent :: __construct($form_name, $method, $action);
25
-		$this->form_type= $form_type;
25
+		$this->form_type = $form_type;
26 26
 		if (isset ($user)) {
27
-			$this->user_info= $user;
27
+			$this->user_info = $user;
28 28
 		}
29 29
 		if (isset ($result_object)) {
30
-			$this->result_object= $result_object;
30
+			$this->result_object = $result_object;
31 31
 		}
32 32
 		if ($this->form_type == self :: TYPE_USER_INFO) {
33 33
 			$this->build_user_info_form();
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 				'keyword' => Security::remove_XSS($_GET['search'])
46 46
 			));
47 47
 		}
48
-		$renderer =& $this->defaultRenderer();
48
+		$renderer = & $this->defaultRenderer();
49 49
 		$renderer->setCustomElementTemplate('<span>{element}</span> ');
50
-		$this->addElement('text','keyword','');
50
+		$this->addElement('text', 'keyword', '');
51 51
 		$this->addButtonSearch(get_lang('Search'), 'submit');
52 52
 	}
53 53
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 			$this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']);
62 62
 		}
63 63
 		$this->addElement('static', 'uname', get_lang('UserName'), $this->user_info['username']);
64
-		$this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:' . $this->user_info['email'] . '">' . $this->user_info['email'] . '</a>');
64
+		$this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:'.$this->user_info['email'].'">'.$this->user_info['email'].'</a>');
65 65
 		$this->addElement('static', 'ofcode', get_lang('OfficialCode'), $this->user_info['official_code']);
66 66
 		$this->addElement('static', 'phone', get_lang('Phone'), $this->user_info['phone']);
67 67
 		$this->addButtonSave(get_lang('Back'), 'submit');
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		parent :: display();
73 73
 	}
74 74
 
75
-	function setDefaults($defaults= array(), $filter = null)
75
+	function setDefaults($defaults = array(), $filter = null)
76 76
 	{
77 77
 		parent :: setDefaults($defaults, $filter);
78 78
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@
 block discarded – undo
31 31
 		}
32 32
 		if ($this->form_type == self :: TYPE_USER_INFO) {
33 33
 			$this->build_user_info_form();
34
-		}
35
-		elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) {
34
+		} elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) {
36 35
 			$this->build_simple_search();
37 36
 		}
38 37
 		$this->setDefaults();
Please login to merge, or discard this patch.
main/gradebook/lib/fe/displaygradebook.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -558,7 +558,7 @@
 block discarded – undo
558 558
                     $my_api_cidreq = 'cidReq=' . $my_category['course_code'];
559 559
                 }
560 560
                 if ($show_add_link && !$message_resource) {
561
-                   $actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' .
561
+                    $actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' .
562 562
                         Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM) . '</a>';
563 563
                     $cats = Category :: load($selectcat);
564 564
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -674,8 +674,9 @@
 block discarded – undo
674 674
             $scoretotal = $cattotal[0]->calc_score(api_get_user_id());
675 675
             $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable'));
676 676
             $scoreinfo = get_lang('StatsStudent') . ' :<b> ' . $user['complete_name']. '</b><br />';
677
-            if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search'])))
678
-                $scoreinfo.= '<br />' . get_lang('TotalForThisCategory') . ' : <b>' . $scorecourse_display . '</b>';
677
+            if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) {
678
+                            $scoreinfo.= '<br />' . get_lang('TotalForThisCategory') . ' : <b>' . $scorecourse_display . '</b>';
679
+            }
679 680
             $scoreinfo.= '<br />' . get_lang('Total') . ' : <b>' . $scoretotal_display . '</b>';
680 681
             Display :: display_normal_message($scoreinfo, false);
681 682
         }
Please login to merge, or discard this patch.
Spacing   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -20,37 +20,37 @@  discard block
 block discarded – undo
20 20
         if (api_is_allowed_to_edit(null, true)) {
21 21
             $header = '<div class="actions">';
22 22
             if ($page != 'statistics') {
23
-                $header .= '<a href="' . Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $selectcat . '&'.api_get_cidreq().'">' .
24
-                    Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM) . '</a>';
23
+                $header .= '<a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectcat.'&'.api_get_cidreq().'">'.
24
+                    Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM).'</a>';
25 25
                 if ($evalobj->get_course_code() == null) {
26 26
 
27 27
                 } elseif (!$evalobj->has_results()) {
28
-                    $header .= '<a href="gradebook_add_result.php?'.api_get_cidreq().'&selectcat=' . $selectcat . '&selecteval=' . $evalobj->get_id() . '">
29
-    				' . Display::return_icon('evaluation_rate.png', get_lang('AddResult'), '', ICON_SIZE_MEDIUM) . '</a>';
28
+                    $header .= '<a href="gradebook_add_result.php?'.api_get_cidreq().'&selectcat='.$selectcat.'&selecteval='.$evalobj->get_id().'">
29
+    				' . Display::return_icon('evaluation_rate.png', get_lang('AddResult'), '', ICON_SIZE_MEDIUM).'</a>';
30 30
                 }
31 31
 
32 32
                 if (api_is_platform_admin() || $evalobj->is_locked() == false) {
33
-                    $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&selecteval=' . $evalobj->get_id() . '&import=">' .
34
-                        Display::return_icon('import_evaluation.png', get_lang('ImportResult'), '', ICON_SIZE_MEDIUM) . '</a>';
33
+                    $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&selecteval='.$evalobj->get_id().'&import=">'.
34
+                        Display::return_icon('import_evaluation.png', get_lang('ImportResult'), '', ICON_SIZE_MEDIUM).'</a>';
35 35
                 }
36 36
 
37 37
                 if ($evalobj->has_results()) {
38
-                    $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&selecteval=' . $evalobj->get_id() . '&export=">' .
39
-                        Display::return_icon('export_evaluation.png', get_lang('ExportResult'), '', ICON_SIZE_MEDIUM) . '</a>';
38
+                    $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&selecteval='.$evalobj->get_id().'&export=">'.
39
+                        Display::return_icon('export_evaluation.png', get_lang('ExportResult'), '', ICON_SIZE_MEDIUM).'</a>';
40 40
 
41 41
                     if (api_is_platform_admin() || $evalobj->is_locked() == false) {
42
-                        $header .= '<a href="gradebook_edit_result.php?'.api_get_cidreq().'&selecteval=' . $evalobj->get_id() . '">' .
43
-                            Display::return_icon('edit.png', get_lang('EditResult'), '', ICON_SIZE_MEDIUM) . '</a>';
44
-                        $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&selecteval=' . $evalobj->get_id() . '&deleteall=" onclick="return confirmationall();">' .
45
-                            Display::return_icon('delete.png', get_lang('DeleteResult'), '', ICON_SIZE_MEDIUM) . '</a>';
42
+                        $header .= '<a href="gradebook_edit_result.php?'.api_get_cidreq().'&selecteval='.$evalobj->get_id().'">'.
43
+                            Display::return_icon('edit.png', get_lang('EditResult'), '', ICON_SIZE_MEDIUM).'</a>';
44
+                        $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&selecteval='.$evalobj->get_id().'&deleteall=" onclick="return confirmationall();">'.
45
+                            Display::return_icon('delete.png', get_lang('DeleteResult'), '', ICON_SIZE_MEDIUM).'</a>';
46 46
                     }
47 47
                 }
48 48
 
49
-                $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&print=&selecteval=' . $evalobj->get_id() . '" target="_blank">' .
50
-                    Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM) . '</a>';
49
+                $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&print=&selecteval='.$evalobj->get_id().'" target="_blank">'.
50
+                    Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>';
51 51
             } else {
52
-                $header .= '<a href="gradebook_view_result.php?'.api_get_cidreq().'&selecteval=' . Security::remove_XSS($_GET['selecteval']) . '"> ' .
53
-                    Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM) . '</a>';
52
+                $header .= '<a href="gradebook_view_result.php?'.api_get_cidreq().'&selecteval='.Security::remove_XSS($_GET['selecteval']).'"> '.
53
+                    Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM).'</a>';
54 54
             }
55 55
             $header .= '</div>';
56 56
         }
@@ -69,17 +69,17 @@  discard block
 block discarded – undo
69 69
             $score = $evalobj->calc_score();
70 70
 
71 71
             if ($score != null) {
72
-                $average = get_lang('Average') . ' :<b> ' . $scoredisplay->display_score($score, SCORE_AVERAGE) . '</b>';
72
+                $average = get_lang('Average').' :<b> '.$scoredisplay->display_score($score, SCORE_AVERAGE).'</b>';
73 73
                 $student_score = $evalobj->calc_score(api_get_user_id());
74 74
                 $student_score = Display::tag(
75 75
                     'h3',
76
-                    get_lang('Score') . ': ' . $scoredisplay->display_score($student_score, SCORE_DIV_PERCENT)
76
+                    get_lang('Score').': '.$scoredisplay->display_score($student_score, SCORE_DIV_PERCENT)
77 77
                 );
78 78
             }
79 79
         }
80 80
         $description = "";
81 81
         if (!$evalobj->get_description() == '') {
82
-            $description = get_lang('Description') . ' :<b> ' . $evalobj->get_description() . '</b><br>';
82
+            $description = get_lang('Description').' :<b> '.$evalobj->get_description().'</b><br>';
83 83
         }
84 84
 
85 85
         if ($evalobj->get_course_code() == null) {
@@ -89,17 +89,17 @@  discard block
 block discarded – undo
89 89
         }
90 90
 
91 91
         $evalinfo = '<table width="100%" border="0"><tr><td>';
92
-        $evalinfo .= '<h2>' . $evalobj->get_name() . '</h2><hr>';
92
+        $evalinfo .= '<h2>'.$evalobj->get_name().'</h2><hr>';
93 93
         $evalinfo .= $description;
94
-        $evalinfo .= get_lang('Course') . ' :<b> ' . $course . '</b><br />';
95
-        $evalinfo .= get_lang('QualificationNumeric') . ' :<b> ' . $evalobj->get_max() . '</b><br>' . $average;
94
+        $evalinfo .= get_lang('Course').' :<b> '.$course.'</b><br />';
95
+        $evalinfo .= get_lang('QualificationNumeric').' :<b> '.$evalobj->get_max().'</b><br>'.$average;
96 96
 
97 97
         if (!api_is_allowed_to_edit()) {
98 98
             $evalinfo .= $student_score;
99 99
         }
100 100
 
101 101
         if (!$evalobj->has_results()) {
102
-            $evalinfo .= '<br /><i>' . get_lang('NoResultsInEvaluation') . '</i>';
102
+            $evalinfo .= '<br /><i>'.get_lang('NoResultsInEvaluation').'</i>';
103 103
         } elseif ($scoredisplay->is_custom() && api_get_self() != '/main/gradebook/gradebook_statistics.php') {
104 104
             if (api_is_allowed_to_edit(null, true)) {
105 105
                 if ($page != 'statistics') {
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
         }
110 110
         if ($page != 'statistics') {
111 111
             if (api_is_allowed_to_edit(null, true)) {
112
-                $evalinfo .= '<br /><a href="gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . Security::remove_XSS($_GET['selecteval']) . '"> ' .
113
-                    Display::return_icon('statistics.png', get_lang('ViewStatistics'), '', ICON_SIZE_MEDIUM) . '</a>';
112
+                $evalinfo .= '<br /><a href="gradebook_statistics.php?'.api_get_cidreq().'&selecteval='.Security::remove_XSS($_GET['selecteval']).'"> '.
113
+                    Display::return_icon('statistics.png', get_lang('ViewStatistics'), '', ICON_SIZE_MEDIUM).'</a>';
114 114
             }
115 115
         }
116 116
         $evalinfo .= '</td><td>'.Display::return_icon('tutorial.gif', '', ['style' => 'float:right; position:relative;']).'</td></table>';
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
     public function display_header_flatview($catobj, $showeval, $showlink, $simple_search_form)
128 128
     {
129 129
         $header = '<table border="0" cellpadding="5">';
130
-        $header .= '<td style="vertical-align: top;"><a href="' . Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) . '">' . Display::return_icon('gradebook.gif') . get_lang('Gradebook') . '</a></td>';
131
-        $header .= '<td style="vertical-align: top;">' . get_lang('FilterCategory') . '</td><td style="vertical-align: top;"><form name="selector"><select name="selectcat" onchange="document.selector.submit()">';
130
+        $header .= '<td style="vertical-align: top;"><a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.Security::remove_XSS($_GET['selectcat']).'">'.Display::return_icon('gradebook.gif').get_lang('Gradebook').'</a></td>';
131
+        $header .= '<td style="vertical-align: top;">'.get_lang('FilterCategory').'</td><td style="vertical-align: top;"><form name="selector"><select name="selectcat" onchange="document.selector.submit()">';
132 132
         $cats = Category :: load();
133 133
         $tree = $cats[0]->get_tree();
134 134
         unset($cats);
@@ -137,35 +137,35 @@  discard block
 block discarded – undo
137 137
                 $line .= '&mdash;';
138 138
             }
139 139
             if ($_GET['selectcat'] == $cat[0]) {
140
-                $header .= '<option selected="selected" value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>';
140
+                $header .= '<option selected="selected" value='.$cat[0].'>'.$line.' '.$cat[1].'</option>';
141 141
             } else {
142
-                $header .= '<option value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>';
142
+                $header .= '<option value='.$cat[0].'>'.$line.' '.$cat[1].'</option>';
143 143
             }
144 144
             $line = '';
145 145
         }
146 146
         $header .= '</td></select></form>';
147 147
         if (!$catobj->get_id() == '0') {
148
-            $header .= '<td style="vertical-align: top;"><a href="' . api_get_self() . '?selectcat=' . $catobj->get_parent_id() . '">';
148
+            $header .= '<td style="vertical-align: top;"><a href="'.api_get_self().'?selectcat='.$catobj->get_parent_id().'">';
149 149
             $header .= Display::return_icon('gradebook.gif', get_lang('Up'));
150 150
             $header .= '</a></td>';
151 151
         }
152
-        $header .= '<td style="vertical-align: top;">' . $simple_search_form->toHtml() . '</td>';
152
+        $header .= '<td style="vertical-align: top;">'.$simple_search_form->toHtml().'</td>';
153 153
         $header .= '<td style="vertical-align: top;">
154
-                    <a href="' . api_get_self() . '?exportpdf=&offset=' . Security::remove_XSS($_GET['offset']) . '&search=' . Security::remove_XSS($_GET['search']) . '&selectcat=' . $catobj->get_id() . '">
154
+                    <a href="' . api_get_self().'?exportpdf=&offset='.Security::remove_XSS($_GET['offset']).'&search='.Security::remove_XSS($_GET['search']).'&selectcat='.$catobj->get_id().'">
155 155
                      '.Display::return_icon('pdf.png', get_lang('ExportPDF'), [], ICON_SIZE_MEDIUM).'
156
-                    ' . get_lang('ExportPDF') . '</a>';
156
+                    ' . get_lang('ExportPDF').'</a>';
157 157
         $header .= '<td style="vertical-align: top;">
158
-                    <a href="' . api_get_self() . '?print=&selectcat=' . $catobj->get_id() . '" target="_blank">
158
+                    <a href="' . api_get_self().'?print=&selectcat='.$catobj->get_id().'" target="_blank">
159 159
                      '.Display::return_icon('printer.png', get_lang('Print'), [], ICON_SIZE_MEDIUM).'
160
-                    ' . get_lang('Print') . '</a>';
160
+                    ' . get_lang('Print').'</a>';
161 161
         $header .= '</td></tr></table>';
162 162
         if (!$catobj->get_id() == '0') {
163
-            $header .= '<table border="0" cellpadding="5"><tr><td><form name="itemfilter" method="post" action="' . api_get_self() . '?selectcat=' . $catobj->get_id() . '">
164
-            <input type="checkbox" name="showeval" onclick="document.itemfilter.submit()" ' . (($showeval == '1') ? 'checked' : '') . '>Show Evaluations &nbsp;';
165
-            $header .= '<input type="checkbox" name="showlink" onclick="document.itemfilter.submit()" ' . (($showlink == '1') ? 'checked' : '') . '>' . get_lang('ShowLinks') . '</form></td></tr></table>';
163
+            $header .= '<table border="0" cellpadding="5"><tr><td><form name="itemfilter" method="post" action="'.api_get_self().'?selectcat='.$catobj->get_id().'">
164
+            <input type="checkbox" name="showeval" onclick="document.itemfilter.submit()" ' . (($showeval == '1') ? 'checked' : '').'>Show Evaluations &nbsp;';
165
+            $header .= '<input type="checkbox" name="showlink" onclick="document.itemfilter.submit()" '.(($showlink == '1') ? 'checked' : '').'>'.get_lang('ShowLinks').'</form></td></tr></table>';
166 166
         }
167 167
         if (isset($_GET['search'])) {
168
-            $header .= '<b>' . get_lang('SearchResults') . ' :</b>';
168
+            $header .= '<b>'.get_lang('SearchResults').' :</b>';
169 169
         }
170 170
         echo $header;
171 171
     }
@@ -186,23 +186,23 @@  discard block
 block discarded – undo
186 186
             $select_cat = $catobj->get_parent_id();
187 187
             $url = 'gradebook_flatview.php';
188 188
         }
189
-        $header .= '<a href="' . $url . '?' . api_get_cidreq() . '&selectcat=' . $select_cat . '">' .
190
-            Display::return_icon('back.png', get_lang('FolderView'), '', ICON_SIZE_MEDIUM) . '</a>';
189
+        $header .= '<a href="'.$url.'?'.api_get_cidreq().'&selectcat='.$select_cat.'">'.
190
+            Display::return_icon('back.png', get_lang('FolderView'), '', ICON_SIZE_MEDIUM).'</a>';
191 191
 
192 192
         $pageNum = isset($_GET['flatviewlist_page_nr']) ? intval($_GET['flatviewlist_page_nr']) : '';
193 193
         $perPage = isset($_GET['flatviewlist_per_page']) ? intval($_GET['flatviewlist_per_page']) : '';
194 194
         $offset = isset($_GET['offset']) ? $_GET['offset'] : '0';
195 195
 
196
-        $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&export_format=csv&export_report=export_report&selectcat=' . $catobj->get_id() . '">' .
197
-            Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM) . '</a>';
198
-        $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&export_format=xls&export_report=export_report&selectcat=' . $catobj->get_id() . '">' .
199
-            Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM) . '</a>';
200
-        $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&export_format=doc&export_report=export_report&selectcat=' . $catobj->get_id() . '">' .
201
-            Display::return_icon('export_doc.png', get_lang('ExportAsDOC'), '', ICON_SIZE_MEDIUM) . '</a>';
202
-        $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&print=&selectcat=' . $catobj->get_id() . '" target="_blank">' .
203
-            Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM) . '</a>';
204
-        $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&exportpdf=&selectcat=' . $catobj->get_id().'&offset='.$offset.'&flatviewlist_page_nr='.$pageNum.'&flatviewlist_per_page='.$perPage.'" >' .
205
-            Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM) . '</a>';
196
+        $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export_format=csv&export_report=export_report&selectcat='.$catobj->get_id().'">'.
197
+            Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>';
198
+        $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export_format=xls&export_report=export_report&selectcat='.$catobj->get_id().'">'.
199
+            Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a>';
200
+        $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export_format=doc&export_report=export_report&selectcat='.$catobj->get_id().'">'.
201
+            Display::return_icon('export_doc.png', get_lang('ExportAsDOC'), '', ICON_SIZE_MEDIUM).'</a>';
202
+        $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&print=&selectcat='.$catobj->get_id().'" target="_blank">'.
203
+            Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>';
204
+        $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&exportpdf=&selectcat='.$catobj->get_id().'&offset='.$offset.'&flatviewlist_page_nr='.$pageNum.'&flatviewlist_per_page='.$perPage.'" >'.
205
+            Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>';
206 206
         $header .= '</div>';
207 207
         echo $header;
208 208
     }
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
                 $item = $evals_links[$count];
244 244
                 $score = $item->calc_score($user_id);
245 245
                 $my_score_denom = ($score[1] == 0) ? 1 : $score[1];
246
-                $item_value+=$score[0] / $my_score_denom * $item->get_weight();
247
-                $item_total+=$item->get_weight();
246
+                $item_value += $score[0] / $my_score_denom * $item->get_weight();
247
+                $item_total += $item->get_weight();
248 248
             }
249 249
             $item_value = number_format($item_value, 2, '.', ' ');
250 250
             $total_score = array($item_value, $item_total);
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
             $cattotal = Category :: load(0);
254 254
             $scoretotal = $cattotal[0]->calc_score(api_get_user_id());
255 255
             $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable'));
256
-            $scoreinfo = get_lang('StatsStudent') . ' :<b> ' . api_get_person_name($user['firstname'], $user['lastname']) . '</b><br />';
256
+            $scoreinfo = get_lang('StatsStudent').' :<b> '.api_get_person_name($user['firstname'], $user['lastname']).'</b><br />';
257 257
             if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) {
258
-                $scoreinfo.= '<h2>' . get_lang('Total') . ' : ' . $scorecourse_display . '</h2>';
258
+                $scoreinfo .= '<h2>'.get_lang('Total').' : '.$scorecourse_display.'</h2>';
259 259
             }
260 260
             Display :: display_normal_message($scoreinfo, false);
261 261
         }
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
         if (($showtree == '1') || (isset($_GET['studentoverview']))) {
266 266
             $header .= '<tr>';
267 267
             if (!$selectcat == '0') {
268
-                $header .= '<td style=" "><a href="' . api_get_self() . '?selectcat=' . $catobj->get_parent_id() . '">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('RootCat'), '', ICON_SIZE_MEDIUM) . '</a></td>';
268
+                $header .= '<td style=" "><a href="'.api_get_self().'?selectcat='.$catobj->get_parent_id().'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('RootCat'), '', ICON_SIZE_MEDIUM).'</a></td>';
269 269
             }
270
-            $header .= '<td style=" ">' . get_lang('CurrentCategory') . '</td>' .
270
+            $header .= '<td style=" ">'.get_lang('CurrentCategory').'</td>'.
271 271
                     '<td style=" "><form name="selector"><select name="selectcat" onchange="document.selector.submit()">';
272 272
             $cats = Category :: load();
273 273
 
@@ -280,15 +280,15 @@  discard block
 block discarded – undo
280 280
                 }
281 281
                 $line = isset($line) ? $line : '';
282 282
                 if (isset($_GET['selectcat']) && $_GET['selectcat'] == $cat[0]) {
283
-                    $header .= '<option selected value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>';
283
+                    $header .= '<option selected value='.$cat[0].'>'.$line.' '.$cat[1].'</option>';
284 284
                 } else {
285
-                    $header .= '<option value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>';
285
+                    $header .= '<option value='.$cat[0].'>'.$line.' '.$cat[1].'</option>';
286 286
                 }
287 287
                 $line = '';
288 288
             }
289 289
             $header .= '</select></form></td>';
290 290
             if (!empty($simple_search_form) && $message_resource === false) {
291
-                $header .= '<td style="vertical-align: top;">' . $simple_search_form->toHtml() . '</td>';
291
+                $header .= '<td style="vertical-align: top;">'.$simple_search_form->toHtml().'</td>';
292 292
             } else {
293 293
                 $header .= '<td></td>';
294 294
             }
@@ -298,13 +298,13 @@  discard block
 block discarded – undo
298 298
             } elseif (!(isset($_GET['studentoverview']))) {
299 299
 
300 300
             } else {
301
-                $header .= '<td style="vertical-align: top;"><a href="' . api_get_self() . '?' . api_get_cidreq() . '&studentoverview=&exportpdf=&selectcat=' . $catobj->get_id() . '" target="_blank">
301
+                $header .= '<td style="vertical-align: top;"><a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&exportpdf=&selectcat='.$catobj->get_id().'" target="_blank">
302 302
                 '.Display::return_icon('pdf.png', get_lang('ExportPDF'), [], ICON_SIZE_MEDIUM).'
303
-                ' . get_lang('ExportPDF') . '</a>';
303
+                ' . get_lang('ExportPDF').'</a>';
304 304
             }
305 305
             $header .= '</td></tr>';
306 306
         }
307
-        $header.='</table></div>';
307
+        $header .= '</table></div>';
308 308
 
309 309
         // for course admin & platform admin add item buttons are added to the header
310 310
         $header .= '<div class="actions">';
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
                 $my_category = $catobj->shows_all_information_an_category($catobj->get_id());
325 325
                 $my_api_cidreq = api_get_cidreq();
326 326
                 if ($my_api_cidreq == '') {
327
-                    $my_api_cidreq = 'cidReq=' . $my_category['course_code'];
327
+                    $my_api_cidreq = 'cidReq='.$my_category['course_code'];
328 328
                 }
329 329
 
330 330
                 if (!$message_resource) {
@@ -333,24 +333,24 @@  discard block
 block discarded – undo
333 333
                     $my_course_id = api_get_course_id();
334 334
                     $my_file = substr($_SESSION['gradebook_dest'], 0, 5);
335 335
 
336
-                    $header .= '<td style="vertical-align: top;"><a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' .
337
-                        Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>';
338
-                    $header .= '<td style="vertical-align: top;"><a href="gradebook_display_certificate.php?' . $my_api_cidreq . '&amp;cat_id=' . (int) $_GET['selectcat'] . '">' .
339
-                        Display::return_icon('certificate_list.png', get_lang('GradebookSeeListOfStudentsCertificates'), '', ICON_SIZE_MEDIUM) . '</a>';
336
+                    $header .= '<td style="vertical-align: top;"><a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
337
+                        Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>';
338
+                    $header .= '<td style="vertical-align: top;"><a href="gradebook_display_certificate.php?'.$my_api_cidreq.'&amp;cat_id='.(int) $_GET['selectcat'].'">'.
339
+                        Display::return_icon('certificate_list.png', get_lang('GradebookSeeListOfStudentsCertificates'), '', ICON_SIZE_MEDIUM).'</a>';
340 340
 
341 341
                     $visibility_icon = ($catobj->is_visible() == 0) ? 'invisible' : 'visible';
342 342
                     $visibility_command = ($catobj->is_visible() == 0) ? 'set_visible' : 'set_invisible';
343 343
 
344 344
                     //Right icons
345
-                    $modify_icons = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&cidReq=' . $catobj->get_course_code() . '&id_session='.$catobj->get_session_id(). '">' . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM) . '</a>';
345
+                    $modify_icons = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&cidReq='.$catobj->get_course_code().'&id_session='.$catobj->get_session_id().'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).'</a>';
346 346
                     if ($catobj->get_name() != api_get_course_id()) {
347
-                        $modify_icons .= '&nbsp;<a  href="' . api_get_self() . '?deletecat=' . $catobj->get_id() . '&amp;selectcat=0&amp;cidReq=' . $catobj->get_course_code() . '" onclick="return confirmation();">' . Display::return_icon('delete.png', get_lang('DeleteAll'), '', ICON_SIZE_MEDIUM) . '</a>';
347
+                        $modify_icons .= '&nbsp;<a  href="'.api_get_self().'?deletecat='.$catobj->get_id().'&amp;selectcat=0&amp;cidReq='.$catobj->get_course_code().'" onclick="return confirmation();">'.Display::return_icon('delete.png', get_lang('DeleteAll'), '', ICON_SIZE_MEDIUM).'</a>';
348 348
                     }
349 349
                     $header .= Display::div($modify_icons, array('class' => 'right'));
350 350
                 }
351 351
             }
352 352
         } elseif (isset($_GET['search'])) {
353
-            $header .= '<b>' . get_lang('SearchResults') . ' :</b>';
353
+            $header .= '<b>'.get_lang('SearchResults').' :</b>';
354 354
         }
355 355
         $header .= '</div>';
356 356
         echo $header;
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
                     $aditionalButtons .= isset($certificateLinkInfo['badge_link']) ? $certificateLinkInfo['badge_link'] : '';
463 463
                     $aditionalButtons .= '</div>';
464 464
                 }
465
-                $scoreinfo .= '<strong>' . sprintf(get_lang('TotalX'), $scorecourse_display . $aditionalButtons). '</strong>';
465
+                $scoreinfo .= '<strong>'.sprintf(get_lang('TotalX'), $scorecourse_display.$aditionalButtons).'</strong>';
466 466
 
467 467
             }
468 468
             Display :: display_normal_message($scoreinfo, false);
@@ -473,10 +473,10 @@  discard block
 block discarded – undo
473 473
             $header = '<div class="actions"><table>';
474 474
             $header .= '<tr>';
475 475
             if (!$selectcat == '0') {
476
-                $header .= '<td><a href="' . api_get_self() . '?selectcat=' . $catobj->get_parent_id() . '">' .
477
-                    Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('RootCat'), '', ICON_SIZE_MEDIUM) . '</a></td>';
476
+                $header .= '<td><a href="'.api_get_self().'?selectcat='.$catobj->get_parent_id().'">'.
477
+                    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('RootCat'), '', ICON_SIZE_MEDIUM).'</a></td>';
478 478
             }
479
-            $header .= '<td>' . get_lang('CurrentCategory') . '</td>' .
479
+            $header .= '<td>'.get_lang('CurrentCategory').'</td>'.
480 480
                     '<td><form name="selector"><select name="selectcat" onchange="document.selector.submit()">';
481 481
             $cats = Category :: load();
482 482
 
@@ -489,15 +489,15 @@  discard block
 block discarded – undo
489 489
                 }
490 490
                 $line = isset($line) ? $line : '';
491 491
                 if (isset($_GET['selectcat']) && $_GET['selectcat'] == $cat[0]) {
492
-                    $header .= '<option selected value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>';
492
+                    $header .= '<option selected value='.$cat[0].'>'.$line.' '.$cat[1].'</option>';
493 493
                 } else {
494
-                    $header .= '<option value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>';
494
+                    $header .= '<option value='.$cat[0].'>'.$line.' '.$cat[1].'</option>';
495 495
                 }
496 496
                 $line = '';
497 497
             }
498 498
             $header .= '</select></form></td>';
499 499
             if (!empty($simple_search_form) && $message_resource === false) {
500
-                $header .= '<td style="vertical-align: top;">' . $simple_search_form->toHtml() . '</td>';
500
+                $header .= '<td style="vertical-align: top;">'.$simple_search_form->toHtml().'</td>';
501 501
             } else {
502 502
                 $header .= '<td></td>';
503 503
             }
@@ -508,9 +508,9 @@  discard block
 block discarded – undo
508 508
             } elseif (!(isset($_GET['studentoverview']))) {
509 509
 
510 510
             } else {
511
-                $header .= '<td style="vertical-align: top;"><a href="' . api_get_self() . '?' . api_get_cidreq() . '&studentoverview=&exportpdf=&selectcat=' . $catobj->get_id() . '" target="_blank">
511
+                $header .= '<td style="vertical-align: top;"><a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&exportpdf=&selectcat='.$catobj->get_id().'" target="_blank">
512 512
 							 '.Display::return_icon('pdf.png', get_lang('ExportPDF'), [], ICON_SIZE_MEDIUM).'
513
-							' . get_lang('ExportPDF') . '</a>';
513
+							' . get_lang('ExportPDF').'</a>';
514 514
             }
515 515
             $header .= '</td></tr>';
516 516
             $header .= '</table></div>';
@@ -525,33 +525,33 @@  discard block
 block discarded – undo
525 525
 
526 526
         if (api_is_allowed_to_edit(null, true)) {
527 527
             if (empty($grade_model_id) || $grade_model_id == -1) {
528
-                $actionsLeft .= '<a href="gradebook_add_cat.php?' . api_get_cidreq() . '&selectcat=' . $catobj->get_id() . '">' .
529
-                    Display::return_icon('new_folder.png', get_lang('AddGradebook'), array(), ICON_SIZE_MEDIUM) . '</a></td>';
528
+                $actionsLeft .= '<a href="gradebook_add_cat.php?'.api_get_cidreq().'&selectcat='.$catobj->get_id().'">'.
529
+                    Display::return_icon('new_folder.png', get_lang('AddGradebook'), array(), ICON_SIZE_MEDIUM).'</a></td>';
530 530
             }
531 531
             if ($selectcat == '0') {
532 532
 
533 533
             } else {
534 534
                 $my_category = $catobj->shows_all_information_an_category($catobj->get_id());
535 535
                 if ($my_api_cidreq == '') {
536
-                    $my_api_cidreq = 'cidReq=' . $my_category['course_code'];
536
+                    $my_api_cidreq = 'cidReq='.$my_category['course_code'];
537 537
                 }
538 538
                 if ($show_add_link && !$message_resource) {
539
-                   $actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' .
540
-                        Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM) . '</a>';
539
+                   $actionsLeft .= '<a href="gradebook_add_eval.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'" >'.
540
+                        Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM).'</a>';
541 541
                     $cats = Category :: load($selectcat);
542 542
 
543 543
                     if ($cats[0]->get_course_code() != null && !$message_resource) {
544
-                        $actionsLeft .= '<a href="gradebook_add_link.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' .
545
-                            Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM) . '</a>';
544
+                        $actionsLeft .= '<a href="gradebook_add_link.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
545
+                            Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM).'</a>';
546 546
                     } else {
547
-                        $actionsLeft .= '<a href="gradebook_add_link_select_course.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' .
548
-                            Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM) . '</a>';
547
+                        $actionsLeft .= '<a href="gradebook_add_link_select_course.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
548
+                            Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM).'</a>';
549 549
                     }
550 550
                 }
551 551
 
552 552
                 if (!$message_resource) {
553
-                    $actionsLeft .= '<a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' .
554
-                        Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>';
553
+                    $actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
554
+                        Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>';
555 555
 
556 556
                     if ($my_category['generate_certificates'] == 1) {
557 557
                         $actionsLeft .= Display::url(
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
                                         '',
562 562
                                         ICON_SIZE_MEDIUM
563 563
                                         ),
564
-                                "gradebook_display_certificate.php?$my_api_cidreq&cat_id=" . intval($_GET['selectcat'])
564
+                                "gradebook_display_certificate.php?$my_api_cidreq&cat_id=".intval($_GET['selectcat'])
565 565
                             );
566 566
                     }
567 567
 
@@ -572,30 +572,30 @@  discard block
 block discarded – undo
572 572
                                     '',
573 573
                                     ICON_SIZE_MEDIUM
574 574
                                     ),
575
-                            "gradebook_display_summary.php?$my_api_cidreq&selectcat=" . intval($_GET['selectcat'])
575
+                            "gradebook_display_summary.php?$my_api_cidreq&selectcat=".intval($_GET['selectcat'])
576 576
                         );
577 577
 
578 578
 
579 579
                     // Right icons
580
-                    $actionsRight = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&amp;cidReq=' . $catobj->get_course_code() . '&id_session='.$catobj->get_session_id(). '">' .
581
-                        Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM) . '</a>';
582
-                    $actionsRight .= '<a href="../document/document.php?curdirpath=/certificates&' . $my_api_cidreq . '&origin=gradebook&selectcat=' . $catobj->get_id() . '">' .
583
-                            Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM) . '</a>';
580
+                    $actionsRight = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&amp;cidReq='.$catobj->get_course_code().'&id_session='.$catobj->get_session_id().'">'.
581
+                        Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).'</a>';
582
+                    $actionsRight .= '<a href="../document/document.php?curdirpath=/certificates&'.$my_api_cidreq.'&origin=gradebook&selectcat='.$catobj->get_id().'">'.
583
+                            Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM).'</a>';
584 584
 
585 585
                     if (empty($categories)) {
586
-                        $actionsRight .= '<a href="gradebook_edit_all.php?id_session=' . api_get_session_id() . '&amp;' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' .
587
-                            Display::return_icon('percentage.png', get_lang('EditAllWeights'), '', ICON_SIZE_MEDIUM) . '</a>';
586
+                        $actionsRight .= '<a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&amp;'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
587
+                            Display::return_icon('percentage.png', get_lang('EditAllWeights'), '', ICON_SIZE_MEDIUM).'</a>';
588 588
                     }
589 589
                     $score_display_custom = api_get_setting('gradebook_score_display_custom');
590 590
                     if (api_get_setting('teachers_can_change_score_settings') == 'true' && $score_display_custom['my_display_custom'] == 'true') {
591
-                        $actionsRight .= '<a href="gradebook_scoring_system.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' .
592
-                            Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM) . '</a>';
591
+                        $actionsRight .= '<a href="gradebook_scoring_system.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
592
+                            Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM).'</a>';
593 593
                     }
594 594
 
595 595
                 }
596 596
             }
597 597
         } elseif (isset($_GET['search'])) {
598
-            echo $header = '<b>' . get_lang('SearchResults') . ' :</b>';
598
+            echo $header = '<b>'.get_lang('SearchResults').' :</b>';
599 599
         }
600 600
 
601 601
         $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
@@ -604,26 +604,26 @@  discard block
 block discarded – undo
604 604
         );
605 605
 
606 606
         if ($isDrhOfCourse) {
607
-            $$actionsLeft .= '<a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' .
608
-                Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>';
607
+            $$actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
608
+                Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>';
609 609
         }
610 610
 
611
-        if (api_is_allowed_to_edit(null, true)){
612
-            echo $toolbar = Display::toolbarAction('gradebook-actions', array(0 => $actionsLeft, 1 => $actionsRight ));
611
+        if (api_is_allowed_to_edit(null, true)) {
612
+            echo $toolbar = Display::toolbarAction('gradebook-actions', array(0 => $actionsLeft, 1 => $actionsRight));
613 613
         }
614 614
 
615 615
         if (api_is_allowed_to_edit(null, true)) {
616 616
             $weight = intval($catobj->get_weight()) > 0 ? $catobj->get_weight() : 0;
617
-            $weight = '<strong>' . get_lang('TotalWeight') . ' : </strong>' . $weight;
617
+            $weight = '<strong>'.get_lang('TotalWeight').' : </strong>'.$weight;
618 618
 
619 619
             $min_certification = (intval($catobj->get_certificate_min_score() > 0) ? $catobj->get_certificate_min_score() : 0);
620
-            $min_certification = get_lang('CertificateMinScore') . ' : ' . $min_certification;
621
-            $edit_icon = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&amp;cidReq=' . $catobj->get_course_code() . '&id_session='.$catobj->get_session_id(). '">' .
622
-                Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
620
+            $min_certification = get_lang('CertificateMinScore').' : '.$min_certification;
621
+            $edit_icon = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&amp;cidReq='.$catobj->get_course_code().'&id_session='.$catobj->get_session_id().'">'.
622
+                Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
623 623
             //$msg = Display::tag('h3', $weight.' - '.$min_certification);
624
-            $msg = $weight . ' - ' . $min_certification . $edit_icon;
624
+            $msg = $weight.' - '.$min_certification.$edit_icon;
625 625
             //@todo show description
626
-            $description = (($catobj->get_description() == "" || is_null($catobj->get_description())) ? '' : '<strong>' . get_lang('GradebookDescriptionLog') . '</strong>' . ': ' . $catobj->get_description());
626
+            $description = (($catobj->get_description() == "" || is_null($catobj->get_description())) ? '' : '<strong>'.get_lang('GradebookDescriptionLog').'</strong>'.': '.$catobj->get_description());
627 627
             Display::display_normal_message($msg, false);
628 628
             if (!empty($description)) {
629 629
                 echo Display::div($description, array());
@@ -651,24 +651,24 @@  discard block
 block discarded – undo
651 651
             $cattotal = Category :: load(0);
652 652
             $scoretotal = $cattotal[0]->calc_score(api_get_user_id());
653 653
             $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable'));
654
-            $scoreinfo = get_lang('StatsStudent') . ' :<b> ' . $user['complete_name']. '</b><br />';
654
+            $scoreinfo = get_lang('StatsStudent').' :<b> '.$user['complete_name'].'</b><br />';
655 655
             if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search'])))
656
-                $scoreinfo.= '<br />' . get_lang('TotalForThisCategory') . ' : <b>' . $scorecourse_display . '</b>';
657
-            $scoreinfo.= '<br />' . get_lang('Total') . ' : <b>' . $scoretotal_display . '</b>';
656
+                $scoreinfo .= '<br />'.get_lang('TotalForThisCategory').' : <b>'.$scorecourse_display.'</b>';
657
+            $scoreinfo .= '<br />'.get_lang('Total').' : <b>'.$scoretotal_display.'</b>';
658 658
             Display :: display_normal_message($scoreinfo, false);
659 659
         }
660 660
         // show navigation tree and buttons?
661 661
         $header = '<div class="actions">';
662 662
 
663 663
         if ($is_course_admin) {
664
-            $header .= '<a href="gradebook_flatview.php?' . api_get_cidreq() . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>';
665
-            $header .= '<a href="gradebook_scoring_system.php?' . api_get_cidreq() . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('settings.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM) . '</a>';
664
+            $header .= '<a href="gradebook_flatview.php?'.api_get_cidreq().'&selectcat='.$catobj->get_id().'">'.Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>';
665
+            $header .= '<a href="gradebook_scoring_system.php?'.api_get_cidreq().'&selectcat='.$catobj->get_id().'">'.Display::return_icon('settings.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM).'</a>';
666 666
         } elseif (!(isset($_GET['studentoverview']))) {
667
-            $header .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&studentoverview=&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('view_list.gif', get_lang('FlatView')) . ' ' . get_lang('FlatView') . '</a>';
667
+            $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&selectcat='.$catobj->get_id().'">'.Display::return_icon('view_list.gif', get_lang('FlatView')).' '.get_lang('FlatView').'</a>';
668 668
         } else {
669
-            $header .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&studentoverview=&exportpdf=&selectcat=' . $catobj->get_id() . '" target="_blank">' . Display::return_icon('pdf.png', get_lang('ExportPDF'), '', ICON_SIZE_MEDIUM) . '</a>';
669
+            $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&exportpdf=&selectcat='.$catobj->get_id().'" target="_blank">'.Display::return_icon('pdf.png', get_lang('ExportPDF'), '', ICON_SIZE_MEDIUM).'</a>';
670 670
         }
671
-        $header.='</div>';
671
+        $header .= '</div>';
672 672
         echo $header;
673 673
     }
674 674
 
@@ -695,8 +695,8 @@  discard block
 block discarded – undo
695 695
             $item = $evals_links[$count];
696 696
             $score = $item->calc_score($user_id);
697 697
             $my_score_denom = ($score[1] == 0) ? 1 : $score[1];
698
-            $item_value+=$score[0] / $my_score_denom * $item->get_weight();
699
-            $item_total+=$item->get_weight();
698
+            $item_value += $score[0] / $my_score_denom * $item->get_weight();
699
+            $item_total += $item->get_weight();
700 700
             //$row[] = $scoredisplay->display_score($score,SCORE_DIV_PERCENT);
701 701
         }
702 702
         $item_value = number_format($item_value, 2, '.', ' ');
@@ -711,17 +711,17 @@  discard block
 block discarded – undo
711 711
         $imageUrl = UserManager::getUserPicture($userid);
712 712
 
713 713
         $info = '<div class="row"><div class="col-md-3">';
714
-        $info .= '<div class="thumbnail"><img src="' . $imageUrl . '" /></div>';
714
+        $info .= '<div class="thumbnail"><img src="'.$imageUrl.'" /></div>';
715 715
         $info .= '</div>';
716 716
         $info .= '<div class="col-md-6">';
717
-        $info .= get_lang('Name') . ' :  <a target="_blank" href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $userid . '"> ' .
718
-            $user['complete_name'] . '</a><br />';
717
+        $info .= get_lang('Name').' :  <a target="_blank" href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userid.'"> '.
718
+            $user['complete_name'].'</a><br />';
719 719
 
720 720
         if (api_get_setting('show_email_addresses') == 'true') {
721
-            $info .= get_lang('Email') . ' : <a href="mailto:' . $user['email'] . '">' . $user['email'] . '</a><br />';
721
+            $info .= get_lang('Email').' : <a href="mailto:'.$user['email'].'">'.$user['email'].'</a><br />';
722 722
         }
723 723
 
724
-        $info .= get_lang('TotalUser') . ' : <b>' . $scorecourse_display . '</b>';
724
+        $info .= get_lang('TotalUser').' : <b>'.$scorecourse_display.'</b>';
725 725
         $info .= '</div>';
726 726
         $info .= '</div>';
727 727
 
Please login to merge, or discard this patch.
main/gradebook/lib/fe/catform.class.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
      */
53 53
     protected function build_move_form()
54 54
     {
55
-        $renderer =& $this->defaultRenderer();
55
+        $renderer = & $this->defaultRenderer();
56 56
         $renderer->setCustomElementTemplate('<span>{element}</span> ');
57 57
         $this->addElement(
58 58
             'static',
59 59
             null,
60 60
             null,
61
-            '"' . $this->category_object->get_name() . '" '
61
+            '"'.$this->category_object->get_name().'" '
62 62
         );
63
-        $this->addElement('static', null, null, get_lang('MoveTo') . ' : ');
63
+        $this->addElement('static', null, null, get_lang('MoveTo').' : ');
64 64
         $select = $this->addElement('select', 'move_cat', null, null);
65 65
         $line = null;
66 66
         foreach ($this->category_object->get_target_categories() as $cat) {
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
                 $line .= '--';
69 69
             }
70 70
             if ($cat[0] != $this->category_object->get_parent_id()) {
71
-                $select->addoption($line . ' ' . $cat[1], $cat[0]);
71
+                $select->addoption($line.' '.$cat[1], $cat[0]);
72 72
             } else {
73
-                $select->addoption($line . ' ' . $cat[1], $cat[0], 'disabled');
73
+                $select->addoption($line.' '.$cat[1], $cat[0], 'disabled');
74 74
             }
75 75
             $line = '';
76 76
         }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         $grade_model_id = $this->category_object->get_grade_model_id();
154 154
 
155 155
         if (empty($links)) {
156
-            $grade_model_id    = 0;
156
+            $grade_model_id = 0;
157 157
         }
158 158
 
159 159
         $category_name = $this->category_object->get_name();
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                     [
243 243
                         'id' => 'skills',
244 244
                         'multiple' => 'multiple',
245
-                        'url' => api_get_path(WEB_AJAX_PATH) . 'skill.ajax.php?a=search_skills'
245
+                        'url' => api_get_path(WEB_AJAX_PATH).'skill.ajax.php?a=search_skills'
246 246
                     ]
247 247
                 );
248 248
 
@@ -400,14 +400,14 @@  discard block
 block discarded – undo
400 400
         //only return courses that are not yet created by the teacher
401 401
 
402 402
         foreach ($coursecat as $row) {
403
-            $select->addoption($row[1],$row[0]);
403
+            $select->addoption($row[1], $row[0]);
404 404
         }
405 405
         $this->setDefaults(array(
406 406
             'hid_user_id' => $this->category_object->get_user_id(),
407 407
             'hid_parent_id' => $this->category_object->get_parent_id()
408 408
         ));
409
-        $this->addElement('hidden','hid_user_id');
410
-        $this->addElement('hidden','hid_parent_id');
409
+        $this->addElement('hidden', 'hid_user_id');
410
+        $this->addElement('hidden', 'hid_parent_id');
411 411
         $this->addElement('submit', null, get_lang('Ok'));
412 412
     }
413 413
 
Please login to merge, or discard this patch.
main/gradebook/lib/fe/linkaddeditform.class.php 2 patches
Indentation   +174 added lines, -174 removed lines patch added patch discarded remove patch
@@ -9,108 +9,108 @@  discard block
 block discarded – undo
9 9
  */
10 10
 class LinkAddEditForm extends FormValidator
11 11
 {
12
-	const TYPE_ADD  = 1;
13
-	const TYPE_EDIT = 2;
14
-
15
-	/**
16
-	 * Constructor
17
-	 * To add link, define category_object and link_type
18
-	 * To edit link, define link_object
19
-	 */
20
-	public function LinkAddEditForm(
21
-		$form_type,
22
-		$category_object,
23
-		$link_type,
24
-		$link_object,
25
-		$form_name,
26
-		$action = null
27
-	) {
28
-		parent :: __construct($form_name, 'post', $action);
29
-
30
-		// set or create link object
31
-		if (isset($link_object)) {
32
-			$link = $link_object;
33
-		} elseif (isset($link_type) && isset($category_object)) {
34
-			$link = LinkFactory :: create ($link_type);
35
-			$link->set_course_code(api_get_course_id());
36
-			$link->set_category_id($category_object[0]->get_id());
37
-		} else {
38
-			die ('LinkAddEditForm error: define link_type/category_object or link_object');
39
-		}
40
-
41
-		$defaults = array();
42
-		$this->addElement('hidden', 'zero', 0);
43
-
44
-		if (!empty($_GET['editlink'])) {
45
-			$this->addElement('header', '', get_lang('EditLink'));
46
-		}
47
-
48
-		// ELEMENT: name
49
-		if ($form_type == self :: TYPE_ADD || $link->is_allowed_to_change_name()) {
50
-			if ($link->needs_name_and_description()) {
51
-				$this->addText('name', get_lang('Name'), true, array('size'=>'40', 'maxlength'=>'40'));
52
-			} else {
53
-				$select = $this->addElement('select', 'select_link', get_lang('ChooseItem'));
54
-				foreach ($link->get_all_links() as $newlink) {
55
-					$select->addoption($newlink[1],$newlink[0]);
56
-				}
57
-			}
58
-		} else {
59
-			$this->addElement('label',get_lang('Name'),  '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>');
60
-			$this->addElement('hidden','name_link',$link->get_name(),array('id'=>'name_link'));
61
-		}
62
-
63
-		if (count($category_object) == 1) {
64
-			$this->addElement('hidden', 'select_gradebook', $category_object[0]->get_id());
65
-		} else {
66
-			$select_gradebook = $this->addElement(
67
-				'select',
68
-				'select_gradebook',
69
-				get_lang('SelectGradebook'),
70
-				array(),
71
-				array('id' => 'hide_category_id')
72
-			);
73
-			$this->addRule('select_gradebook', get_lang('ThisFieldIsRequired'), 'nonzero');
74
-
75
-			$default_weight = 0;
76
-			if (!empty($category_object)) {
77
-				foreach ($category_object as $my_cat) {
78
-
79
-					if ($my_cat->get_course_code() == api_get_course_id()) {
80
-						$grade_model_id = $my_cat->get_grade_model_id();
81
-						if (empty($grade_model_id)) {
82
-
83
-							if ($my_cat->get_parent_id() == 0 ) {
84
-								$default_weight = $my_cat->get_weight();
85
-								$select_gradebook->addoption(get_lang('Default'), $my_cat->get_id());
86
-							} else {
87
-								$select_gradebook->addoption($my_cat->get_name(), $my_cat->get_id());
88
-							}
89
-						} else {
90
-							$select_gradebook->addoption(get_lang('Select'), 0);
91
-						}
92
-						if ($link->get_category_id() == $my_cat->get_id()) {
93
-							$default_weight = $my_cat->get_weight();
94
-						}
95
-					}
96
-				}
97
-			}
98
-		}
99
-
100
-		$this->addText(
101
-			'weight_mask',
102
-			array(get_lang('Weight'), null, ' [0 .. <span id="max_weight">'.$category_object[0]->get_weight().'</span>] '),
103
-			true,
104
-			array(
105
-				'size' => '4',
106
-				'maxlength' => '5',
107
-				'class' => 'span1'
108
-			)
109
-		);
110
-
111
-		$this->addElement('hidden', 'weight');
112
-
113
-		/*
12
+    const TYPE_ADD  = 1;
13
+    const TYPE_EDIT = 2;
14
+
15
+    /**
16
+     * Constructor
17
+     * To add link, define category_object and link_type
18
+     * To edit link, define link_object
19
+     */
20
+    public function LinkAddEditForm(
21
+        $form_type,
22
+        $category_object,
23
+        $link_type,
24
+        $link_object,
25
+        $form_name,
26
+        $action = null
27
+    ) {
28
+        parent :: __construct($form_name, 'post', $action);
29
+
30
+        // set or create link object
31
+        if (isset($link_object)) {
32
+            $link = $link_object;
33
+        } elseif (isset($link_type) && isset($category_object)) {
34
+            $link = LinkFactory :: create ($link_type);
35
+            $link->set_course_code(api_get_course_id());
36
+            $link->set_category_id($category_object[0]->get_id());
37
+        } else {
38
+            die ('LinkAddEditForm error: define link_type/category_object or link_object');
39
+        }
40
+
41
+        $defaults = array();
42
+        $this->addElement('hidden', 'zero', 0);
43
+
44
+        if (!empty($_GET['editlink'])) {
45
+            $this->addElement('header', '', get_lang('EditLink'));
46
+        }
47
+
48
+        // ELEMENT: name
49
+        if ($form_type == self :: TYPE_ADD || $link->is_allowed_to_change_name()) {
50
+            if ($link->needs_name_and_description()) {
51
+                $this->addText('name', get_lang('Name'), true, array('size'=>'40', 'maxlength'=>'40'));
52
+            } else {
53
+                $select = $this->addElement('select', 'select_link', get_lang('ChooseItem'));
54
+                foreach ($link->get_all_links() as $newlink) {
55
+                    $select->addoption($newlink[1],$newlink[0]);
56
+                }
57
+            }
58
+        } else {
59
+            $this->addElement('label',get_lang('Name'),  '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>');
60
+            $this->addElement('hidden','name_link',$link->get_name(),array('id'=>'name_link'));
61
+        }
62
+
63
+        if (count($category_object) == 1) {
64
+            $this->addElement('hidden', 'select_gradebook', $category_object[0]->get_id());
65
+        } else {
66
+            $select_gradebook = $this->addElement(
67
+                'select',
68
+                'select_gradebook',
69
+                get_lang('SelectGradebook'),
70
+                array(),
71
+                array('id' => 'hide_category_id')
72
+            );
73
+            $this->addRule('select_gradebook', get_lang('ThisFieldIsRequired'), 'nonzero');
74
+
75
+            $default_weight = 0;
76
+            if (!empty($category_object)) {
77
+                foreach ($category_object as $my_cat) {
78
+
79
+                    if ($my_cat->get_course_code() == api_get_course_id()) {
80
+                        $grade_model_id = $my_cat->get_grade_model_id();
81
+                        if (empty($grade_model_id)) {
82
+
83
+                            if ($my_cat->get_parent_id() == 0 ) {
84
+                                $default_weight = $my_cat->get_weight();
85
+                                $select_gradebook->addoption(get_lang('Default'), $my_cat->get_id());
86
+                            } else {
87
+                                $select_gradebook->addoption($my_cat->get_name(), $my_cat->get_id());
88
+                            }
89
+                        } else {
90
+                            $select_gradebook->addoption(get_lang('Select'), 0);
91
+                        }
92
+                        if ($link->get_category_id() == $my_cat->get_id()) {
93
+                            $default_weight = $my_cat->get_weight();
94
+                        }
95
+                    }
96
+                }
97
+            }
98
+        }
99
+
100
+        $this->addText(
101
+            'weight_mask',
102
+            array(get_lang('Weight'), null, ' [0 .. <span id="max_weight">'.$category_object[0]->get_weight().'</span>] '),
103
+            true,
104
+            array(
105
+                'size' => '4',
106
+                'maxlength' => '5',
107
+                'class' => 'span1'
108
+            )
109
+        );
110
+
111
+        $this->addElement('hidden', 'weight');
112
+
113
+        /*
114 114
 
115 115
         // ELEMENT: weight
116 116
         $this->addText('weight', array(get_lang('Weight'), null, '/ <span id="max_weight">'.$default_weight.'</span>'), true, array (
@@ -119,76 +119,76 @@  discard block
 block discarded – undo
119 119
             'class' => 'span1'
120 120
         ));*/
121 121
 
122
-		$this->addRule('weight_mask',get_lang('OnlyNumbers'),'numeric');
123
-		$this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
124
-		if ($form_type == self :: TYPE_EDIT) {
125
-			$parent_cat = Category :: load($link->get_category_id());
126
-
127
-			if ($parent_cat[0]->get_parent_id() == 0) {
128
-				$values['weight'] = $link->get_weight();
129
-			} else {
130
-				$cat = Category :: load($parent_cat[0]->get_parent_id());
131
-				//$global_weight = $cat[0]->get_weight();
132
-				//$values['weight'] = $link->get_weight()/$parent_cat[0]->get_weight()*$global_weight;
133
-				//var_dump($global_weight, $link->get_weight(), $parent_cat[0]->get_weight());
134
-				//$weight = $parent_cat[0]->get_weight()* $link->get_weight() / $global_weight;
135
-				//$values['weight'] = $weight;
136
-				$values['weight'] = $link->get_weight() ;
137
-			}
138
-			$defaults['weight_mask'] = $values['weight'] ;
139
-			$defaults['select_gradebook'] = $link->get_category_id();
140
-
141
-		}
142
-		// ELEMENT: max
143
-		if ($link->needs_max()) {
144
-			if ($form_type == self :: TYPE_EDIT && $link->has_results()) {
145
-				$this->addText('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled'));
146
-			} else {
147
-				$this->addText('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5'));
148
-				$this->addRule('max', get_lang('OnlyNumbers'), 'numeric');
149
-				$this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
150
-			}
151
-			if ($form_type == self :: TYPE_EDIT) {
152
-				$defaults['max'] = $link->get_max();
153
-			}
154
-		}
155
-
156
-		// ELEMENT: description
157
-		if ($link->needs_name_and_description()) {
158
-			$this->addElement('textarea', 'description', get_lang('Description'), array ('rows' => '3','cols' => '34'));
159
-			if ($form_type == self :: TYPE_EDIT) {
160
-				$defaults['description'] = $link->get_description();
161
-			}
162
-		}
163
-
164
-		// ELEMENT: visible
165
-		$visible = ($form_type == self :: TYPE_EDIT && $link->is_visible()) ? '1' : '0';
166
-		$this->addElement('checkbox', 'visible', null, get_lang('Visible'), $visible);
167
-		if ($form_type == self :: TYPE_EDIT) {
168
-			$defaults['visible'] = $link->is_visible();
169
-		}
170
-
171
-		// ELEMENT: add results
172
-		if ($form_type == self :: TYPE_ADD && $link->needs_results()) {
173
-			$this->addElement('checkbox', 'addresult', get_lang('AddResult'));
174
-		}
175
-		// submit button
176
-		if ($form_type == self :: TYPE_ADD) {
177
-			$this->addButtonCreate(get_lang('CreateLink'));
178
-		} else {
179
-			$this->addButtonUpdate(get_lang('LinkMod'));
180
-		}
181
-
182
-		if ($form_type == self :: TYPE_ADD) {
183
-			$setting = api_get_setting('tool_visible_by_default_at_creation');
184
-			$visibility_default = 1;
185
-			if (isset($setting['gradebook']) && $setting['gradebook'] == 'false') {
186
-				$visibility_default = 0;
187
-			}
188
-			$defaults['visible']  = $visibility_default;
189
-		}
190
-
191
-		// set default values
192
-		$this->setDefaults($defaults);
193
-	}
122
+        $this->addRule('weight_mask',get_lang('OnlyNumbers'),'numeric');
123
+        $this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
124
+        if ($form_type == self :: TYPE_EDIT) {
125
+            $parent_cat = Category :: load($link->get_category_id());
126
+
127
+            if ($parent_cat[0]->get_parent_id() == 0) {
128
+                $values['weight'] = $link->get_weight();
129
+            } else {
130
+                $cat = Category :: load($parent_cat[0]->get_parent_id());
131
+                //$global_weight = $cat[0]->get_weight();
132
+                //$values['weight'] = $link->get_weight()/$parent_cat[0]->get_weight()*$global_weight;
133
+                //var_dump($global_weight, $link->get_weight(), $parent_cat[0]->get_weight());
134
+                //$weight = $parent_cat[0]->get_weight()* $link->get_weight() / $global_weight;
135
+                //$values['weight'] = $weight;
136
+                $values['weight'] = $link->get_weight() ;
137
+            }
138
+            $defaults['weight_mask'] = $values['weight'] ;
139
+            $defaults['select_gradebook'] = $link->get_category_id();
140
+
141
+        }
142
+        // ELEMENT: max
143
+        if ($link->needs_max()) {
144
+            if ($form_type == self :: TYPE_EDIT && $link->has_results()) {
145
+                $this->addText('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled'));
146
+            } else {
147
+                $this->addText('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5'));
148
+                $this->addRule('max', get_lang('OnlyNumbers'), 'numeric');
149
+                $this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
150
+            }
151
+            if ($form_type == self :: TYPE_EDIT) {
152
+                $defaults['max'] = $link->get_max();
153
+            }
154
+        }
155
+
156
+        // ELEMENT: description
157
+        if ($link->needs_name_and_description()) {
158
+            $this->addElement('textarea', 'description', get_lang('Description'), array ('rows' => '3','cols' => '34'));
159
+            if ($form_type == self :: TYPE_EDIT) {
160
+                $defaults['description'] = $link->get_description();
161
+            }
162
+        }
163
+
164
+        // ELEMENT: visible
165
+        $visible = ($form_type == self :: TYPE_EDIT && $link->is_visible()) ? '1' : '0';
166
+        $this->addElement('checkbox', 'visible', null, get_lang('Visible'), $visible);
167
+        if ($form_type == self :: TYPE_EDIT) {
168
+            $defaults['visible'] = $link->is_visible();
169
+        }
170
+
171
+        // ELEMENT: add results
172
+        if ($form_type == self :: TYPE_ADD && $link->needs_results()) {
173
+            $this->addElement('checkbox', 'addresult', get_lang('AddResult'));
174
+        }
175
+        // submit button
176
+        if ($form_type == self :: TYPE_ADD) {
177
+            $this->addButtonCreate(get_lang('CreateLink'));
178
+        } else {
179
+            $this->addButtonUpdate(get_lang('LinkMod'));
180
+        }
181
+
182
+        if ($form_type == self :: TYPE_ADD) {
183
+            $setting = api_get_setting('tool_visible_by_default_at_creation');
184
+            $visibility_default = 1;
185
+            if (isset($setting['gradebook']) && $setting['gradebook'] == 'false') {
186
+                $visibility_default = 0;
187
+            }
188
+            $defaults['visible']  = $visibility_default;
189
+        }
190
+
191
+        // set default values
192
+        $this->setDefaults($defaults);
193
+    }
194 194
 }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 		if (isset($link_object)) {
32 32
 			$link = $link_object;
33 33
 		} elseif (isset($link_type) && isset($category_object)) {
34
-			$link = LinkFactory :: create ($link_type);
34
+			$link = LinkFactory :: create($link_type);
35 35
 			$link->set_course_code(api_get_course_id());
36 36
 			$link->set_category_id($category_object[0]->get_id());
37 37
 		} else {
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 			} else {
53 53
 				$select = $this->addElement('select', 'select_link', get_lang('ChooseItem'));
54 54
 				foreach ($link->get_all_links() as $newlink) {
55
-					$select->addoption($newlink[1],$newlink[0]);
55
+					$select->addoption($newlink[1], $newlink[0]);
56 56
 				}
57 57
 			}
58 58
 		} else {
59
-			$this->addElement('label',get_lang('Name'),  '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>');
60
-			$this->addElement('hidden','name_link',$link->get_name(),array('id'=>'name_link'));
59
+			$this->addElement('label', get_lang('Name'), '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>');
60
+			$this->addElement('hidden', 'name_link', $link->get_name(), array('id'=>'name_link'));
61 61
 		}
62 62
 
63 63
 		if (count($category_object) == 1) {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 						$grade_model_id = $my_cat->get_grade_model_id();
81 81
 						if (empty($grade_model_id)) {
82 82
 
83
-							if ($my_cat->get_parent_id() == 0 ) {
83
+							if ($my_cat->get_parent_id() == 0) {
84 84
 								$default_weight = $my_cat->get_weight();
85 85
 								$select_gradebook->addoption(get_lang('Default'), $my_cat->get_id());
86 86
 							} else {
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
             'class' => 'span1'
120 120
         ));*/
121 121
 
122
-		$this->addRule('weight_mask',get_lang('OnlyNumbers'),'numeric');
123
-		$this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
122
+		$this->addRule('weight_mask', get_lang('OnlyNumbers'), 'numeric');
123
+		$this->addRule(array('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
124 124
 		if ($form_type == self :: TYPE_EDIT) {
125 125
 			$parent_cat = Category :: load($link->get_category_id());
126 126
 
@@ -133,20 +133,20 @@  discard block
 block discarded – undo
133 133
 				//var_dump($global_weight, $link->get_weight(), $parent_cat[0]->get_weight());
134 134
 				//$weight = $parent_cat[0]->get_weight()* $link->get_weight() / $global_weight;
135 135
 				//$values['weight'] = $weight;
136
-				$values['weight'] = $link->get_weight() ;
136
+				$values['weight'] = $link->get_weight();
137 137
 			}
138
-			$defaults['weight_mask'] = $values['weight'] ;
138
+			$defaults['weight_mask'] = $values['weight'];
139 139
 			$defaults['select_gradebook'] = $link->get_category_id();
140 140
 
141 141
 		}
142 142
 		// ELEMENT: max
143 143
 		if ($link->needs_max()) {
144 144
 			if ($form_type == self :: TYPE_EDIT && $link->has_results()) {
145
-				$this->addText('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled'));
145
+				$this->addText('max', get_lang('QualificationNumeric'), false, array('size' => '4', 'maxlength' => '5', 'disabled' => 'disabled'));
146 146
 			} else {
147
-				$this->addText('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5'));
147
+				$this->addText('max', get_lang('QualificationNumeric'), true, array('size' => '4', 'maxlength' => '5'));
148 148
 				$this->addRule('max', get_lang('OnlyNumbers'), 'numeric');
149
-				$this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
149
+				$this->addRule(array('max', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
150 150
 			}
151 151
 			if ($form_type == self :: TYPE_EDIT) {
152 152
 				$defaults['max'] = $link->get_max();
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 		// ELEMENT: description
157 157
 		if ($link->needs_name_and_description()) {
158
-			$this->addElement('textarea', 'description', get_lang('Description'), array ('rows' => '3','cols' => '34'));
158
+			$this->addElement('textarea', 'description', get_lang('Description'), array('rows' => '3', 'cols' => '34'));
159 159
 			if ($form_type == self :: TYPE_EDIT) {
160 160
 				$defaults['description'] = $link->get_description();
161 161
 			}
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 			if (isset($setting['gradebook']) && $setting['gradebook'] == 'false') {
186 186
 				$visibility_default = 0;
187 187
 			}
188
-			$defaults['visible']  = $visibility_default;
188
+			$defaults['visible'] = $visibility_default;
189 189
 		}
190 190
 
191 191
 		// set default values
Please login to merge, or discard this patch.
main/gradebook/lib/fe/flatviewtable.class.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
             $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)));
202 202
             $chartHash = $myCache->getHash($dataSet);
203 203
             if ($myCache->isInCache($chartHash)) {
204
-                $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
204
+                $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
205 205
                 $myCache->saveFromCache($chartHash, $imgPath);
206
-                $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
206
+                $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
207 207
             } else {
208 208
                 /* Create the pChart object */
209 209
                 $widthSize = 480;
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                 /* Set the default font */
231 231
                 $myPicture->setFontProperties(
232 232
                     array(
233
-                        'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
233
+                        'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
234 234
                         'FontSize' => 10
235 235
                     )
236 236
                 );
@@ -302,11 +302,11 @@  discard block
 block discarded – undo
302 302
                 /* Render the picture (choose the best way) */
303 303
 
304 304
                 $myCache->writeToCache($chartHash, $myPicture);
305
-                $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
305
+                $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
306 306
                 $myCache->saveFromCache($chartHash, $imgPath);
307
-                $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
307
+                $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
308 308
             }
309
-            echo '<img src="' . $imgPath . '" >';
309
+            echo '<img src="'.$imgPath.'" >';
310 310
             if ($i % 2 == 0 && $i != 0) {
311 311
                 echo '<br /><br />';
312 312
             } else {
@@ -349,10 +349,10 @@  discard block
 block discarded – undo
349 349
             // previous X
350 350
             $header .= '<td style="width:100%;">';
351 351
             if ($this->offset >= GRADEBOOK_ITEM_LIMIT) {
352
-                $header .= '<a href="' . api_get_self()
353
-                    . '?selectcat=' . Security::remove_XSS($_GET['selectcat'])
354
-                    . '&offset=' . (($this->offset) - GRADEBOOK_ITEM_LIMIT)
355
-                    . (isset($_GET['search']) ? '&search=' . Security::remove_XSS($_GET['search']) : '') . '">'
352
+                $header .= '<a href="'.api_get_self()
353
+                    . '?selectcat='.Security::remove_XSS($_GET['selectcat'])
354
+                    . '&offset='.(($this->offset) - GRADEBOOK_ITEM_LIMIT)
355
+                    . (isset($_GET['search']) ? '&search='.Security::remove_XSS($_GET['search']) : '').'">'
356 356
                     . Display::return_icon('action_prev.png', get_lang('PreviousPage'), array(), 32)
357 357
                     . '</a>';
358 358
             } else {
@@ -364,10 +364,10 @@  discard block
 block discarded – undo
364 364
                 ($totalitems - (GRADEBOOK_ITEM_LIMIT + $this->offset)) : GRADEBOOK_ITEM_LIMIT;
365 365
 
366 366
             if ($calcnext > 0) {
367
-                $header .= '<a href="' . api_get_self()
368
-                    . '?selectcat=' . Security::remove_XSS($_GET['selectcat'])
369
-                    . '&offset=' . ($this->offset + GRADEBOOK_ITEM_LIMIT)
370
-                    . (isset($_GET['search']) ? '&search=' . Security::remove_XSS($_GET['search']) : '') . '">'
367
+                $header .= '<a href="'.api_get_self()
368
+                    . '?selectcat='.Security::remove_XSS($_GET['selectcat'])
369
+                    . '&offset='.($this->offset + GRADEBOOK_ITEM_LIMIT)
370
+                    . (isset($_GET['search']) ? '&search='.Security::remove_XSS($_GET['search']) : '').'">'
371 371
                     . Display::return_icon('action_next.png', get_lang('NextPage'), array(), 32)
372 372
                     . '</a>';
373 373
             } else {
@@ -475,6 +475,6 @@  discard block
 block discarded – undo
475 475
      */
476 476
     private function build_name_link($user_id, $name)
477 477
     {
478
-        return '<a href="user_stats.php?userid=' . $user_id . '&selectcat=' . $this->selectcat->get_id() . '&'.api_get_cidreq().'">' . $name . '</a>';
478
+        return '<a href="user_stats.php?userid='.$user_id.'&selectcat='.$this->selectcat->get_id().'&'.api_get_cidreq().'">'.$name.'</a>';
479 479
     }
480 480
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -149,8 +149,9 @@
 block discarded – undo
149 149
                 }
150 150
 
151 151
                 foreach ($customdisplays as $display) {
152
-                    if (!in_array($display['display'], $key_list))
153
-                        $resource_list[$key][$display['display']] = 0;
152
+                    if (!in_array($display['display'], $key_list)) {
153
+                                            $resource_list[$key][$display['display']] = 0;
154
+                    }
154 155
                 }
155 156
                 $i++;
156 157
             }
Please login to merge, or discard this patch.