@@ -40,7 +40,9 @@ |
||
40 | 40 | $user_id = api_get_user_id(); |
41 | 41 | $coursePath = api_get_path(SYS_COURSE_PATH).$cidReq.'/document'; |
42 | 42 | $_course = CourseManager::get_course_information($cidReq); |
43 | -if ($_course == null) die ("problem when fetching course information"); |
|
43 | +if ($_course == null) { |
|
44 | + die ("problem when fetching course information"); |
|
45 | +} |
|
44 | 46 | // stupid variable initialisation for old version of DocumentManager functions. |
45 | 47 | $_course['path'] = $_course['directory']; |
46 | 48 | $is_manager = (CourseManager::get_user_in_course_status($user_id, $cidReq) == COURSEMANAGER); |
@@ -65,12 +65,17 @@ |
||
65 | 65 | $new_comment = isset($_POST['comment']) ? trim($_POST['comment']) : ''; |
66 | 66 | $new_title = isset($_POST['title']) ? trim($_POST['title']) : ''; |
67 | 67 | |
68 | - if ($new_path && ($new_comment || $new_title)) |
|
69 | - if (($docid = DocumentManager::get_document_id($_course, $new_path))) { |
|
68 | + if ($new_path && ($new_comment || $new_title)) { |
|
69 | + if (($docid = DocumentManager::get_document_id($_course, $new_path))) { |
|
70 | 70 | $table_document = Database::get_course_table(TABLE_DOCUMENT); |
71 | + } |
|
71 | 72 | $ct = ''; |
72 | - if ($new_comment) $ct .= ", comment='$new_comment'"; |
|
73 | - if ($new_title) $ct .= ", title='$new_title'"; |
|
73 | + if ($new_comment) { |
|
74 | + $ct .= ", comment='$new_comment'"; |
|
75 | + } |
|
76 | + if ($new_title) { |
|
77 | + $ct .= ", title='$new_title'"; |
|
78 | + } |
|
74 | 79 | Database::query("UPDATE $table_document SET" . substr($ct, 1) ." WHERE id = '$docid'"); |
75 | 80 | } |
76 | 81 | //check for missing images in html files |
@@ -303,7 +303,9 @@ discard block |
||
303 | 303 | } |
304 | 304 | |
305 | 305 | foreach ($recipient_ids as $rec) { |
306 | - if (empty($rec)) die(get_lang('GeneralError').' (code 210)'); |
|
306 | + if (empty($rec)) { |
|
307 | + die(get_lang('GeneralError').' (code 210)'); |
|
308 | + } |
|
307 | 309 | //if (!isCourseMember($rec)) die(); //cannot sent document to someone outside of course |
308 | 310 | //this check is done when validating submitted data |
309 | 311 | $this->recipients[] = array('id' => $rec, 'name' => getUserNameFromId($rec)); |
@@ -593,13 +595,19 @@ discard block |
||
593 | 595 | $id = intval($id); |
594 | 596 | $sql = "DELETE FROM ".$dropbox_cnf['tbl_file']." |
595 | 597 | WHERE c_id = $course_id AND cat_id = '".$id."' "; |
596 | - if (!Database::query($sql)) return false; |
|
598 | + if (!Database::query($sql)) { |
|
599 | + return false; |
|
600 | + } |
|
597 | 601 | $sql = "DELETE FROM ".$dropbox_cnf['tbl_category']." |
598 | 602 | WHERE c_id = $course_id AND cat_id = '".$id."' "; |
599 | - if (!Database::query($sql)) return false; |
|
603 | + if (!Database::query($sql)) { |
|
604 | + return false; |
|
605 | + } |
|
600 | 606 | $sql = "DELETE FROM ".$dropbox_cnf['tbl_post']." |
601 | 607 | WHERE c_id = $course_id AND cat_id = '".$id."' "; |
602 | - if (!Database::query($sql)) return false; |
|
608 | + if (!Database::query($sql)) { |
|
609 | + return false; |
|
610 | + } |
|
603 | 611 | return true; |
604 | 612 | } |
605 | 613 |
@@ -267,7 +267,9 @@ |
||
267 | 267 | break; |
268 | 268 | } |
269 | 269 | } |
270 | - if (!$found) die(get_lang('GeneralError').' (code 415)'); |
|
270 | + if (!$found) { |
|
271 | + die(get_lang('GeneralError').' (code 415)'); |
|
272 | + } |
|
271 | 273 | |
272 | 274 | echo '<form method="post" action="index.php">', "\n", |
273 | 275 | '<input type="hidden" name="feedbackid" value="', |
@@ -9,17 +9,19 @@ |
||
9 | 9 | |
10 | 10 | // actions menu |
11 | 11 | $new_thematic_plan_data = array(); |
12 | -if (!empty($thematic_plan_data)) |
|
13 | -foreach($thematic_plan_data as $thematic_item) { |
|
12 | +if (!empty($thematic_plan_data)) { |
|
13 | + foreach($thematic_plan_data as $thematic_item) { |
|
14 | 14 | $thematic_simple_list[] = $thematic_item['description_type']; |
15 | +} |
|
15 | 16 | $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item; |
16 | 17 | } |
17 | 18 | |
18 | 19 | $new_id = ADD_THEMATIC_PLAN; |
19 | -if (!empty($thematic_simple_list)) |
|
20 | -foreach($thematic_simple_list as $item) { |
|
20 | +if (!empty($thematic_simple_list)) { |
|
21 | + foreach($thematic_simple_list as $item) { |
|
21 | 22 | if ($item >= ADD_THEMATIC_PLAN) { |
22 | 23 | $new_id = $item + 1; |
24 | +} |
|
23 | 25 | $default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title']; |
24 | 26 | } |
25 | 27 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | //just showing the src in a iframe ... |
82 | 82 | $html .= '<h2>'.$toc['title'].'</h2>'; |
83 | 83 | $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="' . $src . '"></iframe>'; |
84 | - }else{ |
|
84 | + } else{ |
|
85 | 85 | $html .= "<div class='impress-title'>"; |
86 | 86 | $html .= '<h1>'.$toc['title'].'</h1>'; |
87 | 87 | $html .= "</div>"; |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | } |
46 | 46 | break; |
47 | 47 | case "stackgetall": |
48 | - if (storage_can_set($_REQUEST['svuser'])) |
|
49 | - print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
48 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
49 | + print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | + } |
|
50 | 51 | break; |
51 | 52 | case "getposition": |
52 | 53 | print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
@@ -87,8 +88,7 @@ discard block |
||
87 | 88 | } else { |
88 | 89 | return $row['sv_value']; |
89 | 90 | } |
90 | - } |
|
91 | - else { |
|
91 | + } else { |
|
92 | 92 | return null; |
93 | 93 | } |
94 | 94 | } |
@@ -144,8 +144,7 @@ discard block |
||
144 | 144 | if (Database::num_rows($res) > 0) { |
145 | 145 | $row = Database::fetch_assoc($res); |
146 | 146 | return $row['position']; |
147 | - } |
|
148 | - else { |
|
147 | + } else { |
|
149 | 148 | return null; |
150 | 149 | } |
151 | 150 | } |
@@ -198,8 +197,7 @@ discard block |
||
198 | 197 | if ($resorder && $resinsert) { |
199 | 198 | Database::query("commit"); |
200 | 199 | return 1; |
201 | - } |
|
202 | - else { |
|
200 | + } else { |
|
203 | 201 | Database::query("rollback"); |
204 | 202 | return 0; |
205 | 203 | } |
@@ -119,8 +119,9 @@ |
||
119 | 119 | |
120 | 120 | for ($i = 0; $i<count($matches[0]); $i++) { |
121 | 121 | |
122 | - if (empty($matches[1][$i])) |
|
123 | - continue; |
|
122 | + if (empty($matches[1][$i])) { |
|
123 | + continue; |
|
124 | + } |
|
124 | 125 | |
125 | 126 | $content = api_strstr($content, $matches[0][$i]); |
126 | 127 | if ($i + 1 !== count($matches[0])) { |
@@ -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(); |