@@ -48,7 +48,9 @@ discard block |
||
48 | 48 | foreach ($dashboard_blocks as $block) { |
49 | 49 | |
50 | 50 | // display only user blocks |
51 | - if (!in_array($block['id'], $user_blocks_id)) continue; |
|
51 | + if (!in_array($block['id'], $user_blocks_id)) { |
|
52 | + continue; |
|
53 | + } |
|
52 | 54 | |
53 | 55 | $path = $block['path']; |
54 | 56 | $controller_class = $block['controller']; |
@@ -61,7 +63,9 @@ discard block |
||
61 | 63 | // check if user is allowed to see the block |
62 | 64 | if (method_exists($obj, 'is_block_visible_for_user')) { |
63 | 65 | $is_block_visible_for_user = $obj->is_block_visible_for_user($user_id); |
64 | - if (!$is_block_visible_for_user) continue; |
|
66 | + if (!$is_block_visible_for_user) { |
|
67 | + continue; |
|
68 | + } |
|
65 | 69 | } |
66 | 70 | |
67 | 71 | $data_block[$path] = $obj->get_block(); |
@@ -40,7 +40,9 @@ |
||
40 | 40 | //if the rewrite rule asks for a directory, we redirect to the course view |
41 | 41 | if (is_dir($full_file_name)) { |
42 | 42 | //remove last slash if present |
43 | - while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul); |
|
43 | + while ($doc_url{$dul = strlen($doc_url)-1}=='/') { |
|
44 | + $doc_url = substr($doc_url,0,$dul); |
|
45 | + } |
|
44 | 46 | //create the path |
45 | 47 | $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path |
46 | 48 | //redirect |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | GradebookUtils::block_students(); |
228 | 228 | if (isset ($_GET['set_visible'])) { |
229 | 229 | $visibility_command= 1; |
230 | - }else { |
|
230 | + } else { |
|
231 | 231 | $visibility_command= 0; |
232 | 232 | } |
233 | 233 | $link= LinkFactory :: load($_GET['visiblelink']); |
@@ -281,8 +281,7 @@ discard block |
||
281 | 281 | if ($number_of_selected_items == '0') { |
282 | 282 | $warning_message = get_lang('NoItemsSelected'); |
283 | 283 | $filter_warning_msg = false; |
284 | - } |
|
285 | - else { |
|
284 | + } else { |
|
286 | 285 | switch ($_POST['action']) { |
287 | 286 | case 'deleted' : |
288 | 287 | $number_of_deleted_categories= 0; |
@@ -39,7 +39,9 @@ |
||
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 | } |
@@ -674,8 +674,9 @@ |
||
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 | } |
@@ -256,10 +256,11 @@ |
||
256 | 256 | } |
257 | 257 | |
258 | 258 | // Categories. |
259 | - if (!empty($data_array)) |
|
260 | - foreach ($data_array as $data) { |
|
259 | + if (!empty($data_array)) { |
|
260 | + foreach ($data_array as $data) { |
|
261 | 261 | // list of items inside the gradebook (exercises, lps, forums, etc) |
262 | 262 | $row = array(); |
263 | + } |
|
263 | 264 | /** @var AbstractLink $item */ |
264 | 265 | $item = $mainCategory = $data[0]; |
265 | 266 |
@@ -149,8 +149,9 @@ |
||
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 | } |
@@ -235,21 +235,27 @@ discard block |
||
235 | 235 | $paramcount ++; |
236 | 236 | } |
237 | 237 | if (isset ($type)) { |
238 | - if ($paramcount != 0) $sql .= ' AND'; |
|
239 | - else $sql .= ' WHERE'; |
|
238 | + if ($paramcount != 0) { |
|
239 | + $sql .= ' AND'; |
|
240 | + } else { |
|
241 | + $sql .= ' WHERE'; |
|
242 | + } |
|
240 | 243 | $sql .= ' type = '.intval($type); |
241 | 244 | $paramcount ++; |
242 | 245 | } |
243 | 246 | if (isset ($ref_id)) { |
244 | - if ($paramcount != 0) $sql .= ' AND'; |
|
245 | - else $sql .= ' WHERE'; |
|
247 | + if ($paramcount != 0) { |
|
248 | + $sql .= ' AND'; |
|
249 | + } else { |
|
250 | + $sql .= ' WHERE'; |
|
251 | + } |
|
246 | 252 | $sql .= ' ref_id = '.intval($ref_id); |
247 | 253 | $paramcount ++; |
248 | 254 | } |
249 | 255 | if (isset ($user_id)) { |
250 | 256 | if ($paramcount != 0) { |
251 | 257 | $sql .= ' AND'; |
252 | - }else { |
|
258 | + } else { |
|
253 | 259 | $sql .= ' WHERE'; |
254 | 260 | } |
255 | 261 | $sql .= ' user_id = '.intval($user_id); |
@@ -267,7 +273,7 @@ discard block |
||
267 | 273 | if (isset ($category_id)) { |
268 | 274 | if ($paramcount != 0) { |
269 | 275 | $sql .= ' AND'; |
270 | - }else { |
|
276 | + } else { |
|
271 | 277 | $sql .= ' WHERE'; |
272 | 278 | } |
273 | 279 | $sql .= ' category_id = '.intval($category_id); |
@@ -1179,7 +1179,7 @@ |
||
1179 | 1179 | cu.status = '.COURSEMANAGER.' |
1180 | 1180 | )'; |
1181 | 1181 | } |
1182 | - }elseif (api_is_platform_admin()) { |
|
1182 | + } elseif (api_is_platform_admin()) { |
|
1183 | 1183 | if (isset($session_id) && $session_id!=0) { |
1184 | 1184 | $sql.=' AND session_id='.intval($session_id); |
1185 | 1185 | } else { |