@@ -36,7 +36,7 @@ |
||
36 | 36 | 'actions', |
37 | 37 | Display::toolbarButton( |
38 | 38 | get_lang('SearchCertificates'), |
39 | - api_get_path(WEB_CODE_PATH) . "gradebook/search.php", |
|
39 | + api_get_path(WEB_CODE_PATH)."gradebook/search.php", |
|
40 | 40 | 'search', |
41 | 41 | 'info' |
42 | 42 | ) |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | if (!$isDrhOfCourse) { |
17 | 17 | GradebookUtils::block_students(); |
18 | 18 | } |
19 | -$interbreadcrumb[]= array ( |
|
19 | +$interbreadcrumb[] = array( |
|
20 | 20 | 'url' => $_SESSION['gradebook_dest'], |
21 | 21 | 'name' => get_lang('Gradebook' |
22 | 22 | )); |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | $alllinks = $category[0]->get_links($my_user_id, true); |
28 | 28 | |
29 | 29 | if ($_GET['selectcat'] != null) { |
30 | - $addparams= array ( |
|
30 | + $addparams = array( |
|
31 | 31 | 'userid' => $my_user_id, |
32 | 32 | 'selectcat' => Security::remove_XSS($_GET['selectcat']) |
33 | 33 | ); |
34 | 34 | } else { |
35 | - $addparams= array ( |
|
35 | + $addparams = array( |
|
36 | 36 | 'userid' => $my_user_id, |
37 | 37 | 'selecteval' => Security::remove_XSS($_GET['selecteval']) |
38 | 38 | ); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $newarray[] = array_slice($data, 1); |
50 | 50 | } |
51 | 51 | $userinfo = api_get_user_info($my_user_id); |
52 | - $html .= get_lang('Results').' : '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).' ('. api_convert_and_format_date(null, DATE_FORMAT_SHORT). ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT) .')'; |
|
52 | + $html .= get_lang('Results').' : '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).' ('.api_convert_and_format_date(null, DATE_FORMAT_SHORT).' '.api_convert_and_format_date(null, TIME_NO_SEC_FORMAT).')'; |
|
53 | 53 | |
54 | 54 | if ($displayscore->is_custom()) { |
55 | 55 | $header_names = array( |
@@ -95,23 +95,23 @@ discard block |
||
95 | 95 | $actions = '<div class="actions">'; |
96 | 96 | |
97 | 97 | if (isset($_GET['selectcat'])) { |
98 | - $interbreadcrumb[]= array ('url' => 'gradebook_flatview.php?selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView')); |
|
99 | - $actions.= '<a href=gradebook_flatview.php?selectcat=' .Security::remove_XSS($_GET['selectcat']) . '>' . Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('FlatView'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
98 | + $interbreadcrumb[] = array('url' => 'gradebook_flatview.php?selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView')); |
|
99 | + $actions .= '<a href=gradebook_flatview.php?selectcat='.Security::remove_XSS($_GET['selectcat']).'>'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | if (isset ($_GET['selecteval'])) { |
103 | - $interbreadcrumb[]= array ( |
|
104 | - 'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), |
|
103 | + $interbreadcrumb[] = array( |
|
104 | + 'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']), |
|
105 | 105 | 'name' => get_lang('ViewResult' |
106 | 106 | )); |
107 | - $actions.= '<a href=gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '> |
|
108 | - '.Display::return_icon('back.png', get_lang('BackToEvaluation'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
107 | + $actions .= '<a href=gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'> |
|
108 | + '.Display::return_icon('back.png', get_lang('BackToEvaluation'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
109 | 109 | } |
110 | 110 | |
111 | -$actions.= '<a href="' . api_get_self() . '?exportpdf=&userid='.Security::remove_XSS($_GET['userid']).'&selectcat=' . $category[0]->get_id() . '" target="_blank"> |
|
112 | -' . Display::return_icon('pdf.png', get_lang('ExportPDF'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
111 | +$actions .= '<a href="'.api_get_self().'?exportpdf=&userid='.Security::remove_XSS($_GET['userid']).'&selectcat='.$category[0]->get_id().'" target="_blank"> |
|
112 | +' . Display::return_icon('pdf.png', get_lang('ExportPDF'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
113 | 113 | |
114 | -$actions.='</div>'; |
|
114 | +$actions .= '</div>'; |
|
115 | 115 | |
116 | 116 | Display :: display_header(get_lang('ResultsPerUser')); |
117 | 117 | echo $actions; |
@@ -30,7 +30,7 @@ discard block |
||
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 |
||
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 |
||
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 ) { |
@@ -7,7 +7,7 @@ discard block |
||
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 |
||
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 |
||
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 | ); |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | |
51 | 51 | } |
52 | 52 | if (count($result) == 0) { |
53 | - $evals_filtered=$evals; |
|
53 | + $evals_filtered = $evals; |
|
54 | 54 | } else { |
55 | - $evals_filtered=$evals_filtered_copy; |
|
55 | + $evals_filtered = $evals_filtered_copy; |
|
56 | 56 | } |
57 | 57 | $this->items = array_merge($evals_filtered, $links); |
58 | 58 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | // do some checks on count, redefine if invalid value |
87 | 87 | if (!isset($count)) { |
88 | - $count = count ($this->items) - $start; |
|
88 | + $count = count($this->items) - $start; |
|
89 | 89 | } |
90 | 90 | if ($count < 0) { |
91 | 91 | $count = 0; |
@@ -104,20 +104,20 @@ discard block |
||
104 | 104 | } elseif ($sorting & self :: UDG_SORT_AVERAGE) { |
105 | 105 | // if user sorts on average scores, first calculate them and cache them |
106 | 106 | foreach ($allitems as $item) { |
107 | - $this->avgcache[$item->get_item_type() . $item->get_id()]= $item->calc_score(); |
|
107 | + $this->avgcache[$item->get_item_type().$item->get_id()] = $item->calc_score(); |
|
108 | 108 | } |
109 | 109 | usort($allitems, array('UserDataGenerator', 'sort_by_average')); |
110 | 110 | } elseif ($sorting & self :: UDG_SORT_SCORE) { |
111 | 111 | // if user sorts on student's scores, first calculate them and cache them |
112 | 112 | foreach ($allitems as $item) { |
113 | - $this->scorecache[$item->get_item_type() . $item->get_id()] |
|
113 | + $this->scorecache[$item->get_item_type().$item->get_id()] |
|
114 | 114 | = $item->calc_score($this->userid); |
115 | 115 | } |
116 | 116 | usort($allitems, array('UserDataGenerator', 'sort_by_score')); |
117 | 117 | } elseif ($sorting & self :: UDG_SORT_MASK) { |
118 | 118 | // if user sorts on student's masks, first calculate scores and cache them |
119 | 119 | foreach ($allitems as $item) { |
120 | - $this->scorecache[$item->get_item_type() . $item->get_id()] |
|
120 | + $this->scorecache[$item->get_item_type().$item->get_id()] |
|
121 | 121 | = $item->calc_score($this->userid); |
122 | 122 | } |
123 | 123 | usort($allitems, array('UserDataGenerator', 'sort_by_mask')); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | // fill score cache if not done yet |
133 | 133 | if (!isset ($this->scorecache)) { |
134 | 134 | foreach ($visibleitems as $item) { |
135 | - $this->scorecache[$item->get_item_type() . $item->get_id()] |
|
135 | + $this->scorecache[$item->get_item_type().$item->get_id()] |
|
136 | 136 | = $item->calc_score($this->userid); |
137 | 137 | } |
138 | 138 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $scoredisplay = ScoreDisplay :: instance(); |
142 | 142 | $data = array(); |
143 | 143 | foreach ($visibleitems as $item) { |
144 | - $row = array (); |
|
144 | + $row = array(); |
|
145 | 145 | $row[] = $item; |
146 | 146 | $row[] = $item->get_name(); |
147 | 147 | $row[] = $this->build_course_name($item); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | function sort_by_type($item1, $item2) |
164 | 164 | { |
165 | 165 | if ($item1->get_item_type() == $item2->get_item_type()) { |
166 | - return $this->sort_by_name($item1,$item2); |
|
166 | + return $this->sort_by_name($item1, $item2); |
|
167 | 167 | } else { |
168 | 168 | return ($item1->get_item_type() < $item2->get_item_type() ? -1 : 1); |
169 | 169 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | function sort_by_name($item1, $item2) |
205 | 205 | { |
206 | - return api_strnatcmp($item1->get_name(),$item2->get_name()); |
|
206 | + return api_strnatcmp($item1->get_name(), $item2->get_name()); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | */ |
214 | 214 | function sort_by_average($item1, $item2) |
215 | 215 | { |
216 | - $score1 = $this->avgcache[$item1->get_item_type() . $item1->get_id()]; |
|
217 | - $score2 = $this->avgcache[$item2->get_item_type() . $item2->get_id()]; |
|
216 | + $score1 = $this->avgcache[$item1->get_item_type().$item1->get_id()]; |
|
217 | + $score2 = $this->avgcache[$item2->get_item_type().$item2->get_id()]; |
|
218 | 218 | |
219 | 219 | return $this->compare_scores($score1, $score2); |
220 | 220 | } |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | */ |
227 | 227 | function sort_by_score($item1, $item2) |
228 | 228 | { |
229 | - $score1 = $this->scorecache[$item1->get_item_type() . $item1->get_id()]; |
|
230 | - $score2 = $this->scorecache[$item2->get_item_type() . $item2->get_id()]; |
|
229 | + $score1 = $this->scorecache[$item1->get_item_type().$item1->get_id()]; |
|
230 | + $score2 = $this->scorecache[$item2->get_item_type().$item2->get_id()]; |
|
231 | 231 | |
232 | 232 | return $this->compare_scores($score1, $score2); |
233 | 233 | } |
@@ -239,8 +239,8 @@ discard block |
||
239 | 239 | */ |
240 | 240 | function sort_by_mask($item1, $item2) |
241 | 241 | { |
242 | - $score1 = $this->scorecache[$item1->get_item_type() . $item1->get_id()]; |
|
243 | - $score2 = $this->scorecache[$item2->get_item_type() . $item2->get_id()]; |
|
242 | + $score1 = $this->scorecache[$item1->get_item_type().$item1->get_id()]; |
|
243 | + $score2 = $this->scorecache[$item2->get_item_type().$item2->get_id()]; |
|
244 | 244 | |
245 | 245 | return ScoreDisplay :: compare_scores_by_custom_display($score1, $score2); |
246 | 246 | } |
@@ -256,10 +256,10 @@ discard block |
||
256 | 256 | return (isset($score2) ? 1 : 0); |
257 | 257 | } elseif (!isset($score2)) { |
258 | 258 | return -1; |
259 | - } elseif (($score1[0]/$score1[1]) == ($score2[0]/$score2[1])) { |
|
259 | + } elseif (($score1[0] / $score1[1]) == ($score2[0] / $score2[1])) { |
|
260 | 260 | return 0; |
261 | 261 | } else { |
262 | - return (($score1[0]/$score1[1]) < ($score2[0]/$score2[1]) ? -1 : 1); |
|
262 | + return (($score1[0] / $score1[1]) < ($score2[0] / $score2[1]) ? -1 : 1); |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | private function build_average_column($item, $ignore_score_color) |
292 | 292 | { |
293 | 293 | if (isset($this->avgcache)) { |
294 | - $avgscore = $this->avgcache[$item->get_item_type() . $item->get_id()]; |
|
294 | + $avgscore = $this->avgcache[$item->get_item_type().$item->get_id()]; |
|
295 | 295 | } else { |
296 | 296 | $avgscore = $item->calc_score(); |
297 | 297 | } |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | private function build_result_column($item, $ignore_score_color) |
313 | 313 | { |
314 | - $studscore = $this->scorecache[$item->get_item_type() . $item->get_id()]; |
|
314 | + $studscore = $this->scorecache[$item->get_item_type().$item->get_id()]; |
|
315 | 315 | $scoredisplay = ScoreDisplay :: instance(); |
316 | 316 | $displaytype = SCORE_DIV_PERCENT; |
317 | 317 | if ($ignore_score_color) { |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | */ |
329 | 329 | private function build_mask_column($item, $ignore_score_color) |
330 | 330 | { |
331 | - $studscore = $this->scorecache[$item->get_item_type() . $item->get_id()]; |
|
331 | + $studscore = $this->scorecache[$item->get_item_type().$item->get_id()]; |
|
332 | 332 | $scoredisplay = ScoreDisplay :: instance(); |
333 | 333 | $displaytype = SCORE_DIV_PERCENT; |
334 | 334 | if ($ignore_score_color) { |
@@ -362,12 +362,12 @@ discard block |
||
362 | 362 | if (isset ($this->categorycache) |
363 | 363 | && isset ($this->categorycache[$category_id])) { |
364 | 364 | return $this->categorycache[$category_id]; |
365 | - }else { |
|
365 | + } else { |
|
366 | 366 | $cat = Category::load($category_id); |
367 | - if (isset($cat)){ |
|
367 | + if (isset($cat)) { |
|
368 | 368 | $this->categorycache[$category_id] = $cat[0]; |
369 | 369 | return $cat[0]; |
370 | - }else |
|
370 | + } else |
|
371 | 371 | return null; |
372 | 372 | } |
373 | 373 | } |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | private function get_category_name_to_display($cat) |
380 | 380 | { |
381 | 381 | if (isset($cat)) { |
382 | - if ($cat->get_parent_id() == '0' || $cat->get_parent_id() == null){ |
|
382 | + if ($cat->get_parent_id() == '0' || $cat->get_parent_id() == null) { |
|
383 | 383 | return ''; |
384 | 384 | } else { |
385 | 385 | return $cat->get_name(); |
@@ -56,17 +56,17 @@ discard block |
||
56 | 56 | |
57 | 57 | protected function build_move() |
58 | 58 | { |
59 | - $renderer =& $this->defaultRenderer(); |
|
59 | + $renderer = & $this->defaultRenderer(); |
|
60 | 60 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
61 | - $this->addElement('static',null,null,'"'.$this->link_object->get_name().'" '); |
|
62 | - $this->addElement('static',null,null,get_lang('MoveTo').' : '); |
|
63 | - $select = $this->addElement('select','move_cat',null,null); |
|
61 | + $this->addElement('static', null, null, '"'.$this->link_object->get_name().'" '); |
|
62 | + $this->addElement('static', null, null, get_lang('MoveTo').' : '); |
|
63 | + $select = $this->addElement('select', 'move_cat', null, null); |
|
64 | 64 | $line = ''; |
65 | 65 | foreach ($this->link_object->get_target_categories() as $cat) { |
66 | - for ($i=0;$i<$cat[2];$i++) { |
|
66 | + for ($i = 0; $i < $cat[2]; $i++) { |
|
67 | 67 | $line .= '—'; |
68 | 68 | } |
69 | - $select->addoption($line.' '.$cat[1],$cat[0]); |
|
69 | + $select->addoption($line.' '.$cat[1], $cat[0]); |
|
70 | 70 | $line = ''; |
71 | 71 | } |
72 | 72 | $this->addElement('submit', null, get_lang('Ok')); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $link = LinkFactory::create($link); |
134 | 134 | if (!empty($courseCode)) { |
135 | 135 | $link->set_course_code($courseCode); |
136 | - } elseif(!empty($_GET['course_code'])) { |
|
136 | + } elseif (!empty($_GET['course_code'])) { |
|
137 | 137 | $link->set_course_code(Database::escape_string($_GET['course_code'], null, false)); |
138 | 138 | } |
139 | 139 |
@@ -52,15 +52,15 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -31,7 +31,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -201,9 +201,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |