@@ -121,8 +121,9 @@ discard block |
||
121 | 121 | $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id()); |
122 | 122 | $my_session_list = array(); |
123 | 123 | foreach($new_session_list as $item) { |
124 | - if (!empty($item['id_session'])) |
|
125 | - $my_session_list[] = $item['id_session']; |
|
124 | + if (!empty($item['id_session'])) { |
|
125 | + $my_session_list[] = $item['id_session']; |
|
126 | + } |
|
126 | 127 | } |
127 | 128 | if (!in_array($session_id, $my_session_list)) { |
128 | 129 | break; |
@@ -254,8 +255,9 @@ discard block |
||
254 | 255 | $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id()); |
255 | 256 | $my_session_list = array(); |
256 | 257 | foreach($new_session_list as $item) { |
257 | - if (!empty($item['id_session'])) |
|
258 | - $my_session_list[] = $item['id_session']; |
|
258 | + if (!empty($item['id_session'])) { |
|
259 | + $my_session_list[] = $item['id_session']; |
|
260 | + } |
|
259 | 261 | } |
260 | 262 | if (!in_array($session_id, $my_session_list)) { |
261 | 263 | break; |
@@ -384,8 +386,9 @@ discard block |
||
384 | 386 | $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id()); |
385 | 387 | $my_session_list = array(); |
386 | 388 | foreach($new_session_list as $item) { |
387 | - if (!empty($item['id_session'])) |
|
388 | - $my_session_list[] = $item['id_session']; |
|
389 | + if (!empty($item['id_session'])) { |
|
390 | + $my_session_list[] = $item['id_session']; |
|
391 | + } |
|
389 | 392 | } |
390 | 393 | if (!in_array($session_id, $my_session_list)) { |
391 | 394 | break; |
@@ -29,8 +29,9 @@ |
||
29 | 29 | while (($file = readdir($dh)) !== false) { |
30 | 30 | if ($file[0] <> '.' && substr($file, -4, strlen($file)) == '.php') { |
31 | 31 | if ($only_main_name) { |
32 | - if ($file != '' && strpos($file, '.inc.php')) |
|
33 | - $content_dir[] = substr($file, 0, strpos($file, '.inc.php')); |
|
32 | + if ($file != '' && strpos($file, '.inc.php')) { |
|
33 | + $content_dir[] = substr($file, 0, strpos($file, '.inc.php')); |
|
34 | + } |
|
34 | 35 | } else { |
35 | 36 | $content_dir[] = $file; |
36 | 37 | } |
@@ -158,8 +158,9 @@ discard block |
||
158 | 158 | $array[] = $this->build_setting($status, '[INI]', 'display_errors', 'http://www.php.net/manual/en/ini.core.php#ini.display_errors', $setting, $req_setting, 'on_off', get_lang('DisplayErrorsInfo')); |
159 | 159 | |
160 | 160 | $setting = ini_get('default_charset'); |
161 | - if ($setting == '') |
|
162 | - $setting = null; |
|
161 | + if ($setting == '') { |
|
162 | + $setting = null; |
|
163 | + } |
|
163 | 164 | $req_setting = null; |
164 | 165 | $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_ERROR; |
165 | 166 | $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo')); |
@@ -177,22 +178,25 @@ discard block |
||
177 | 178 | $setting = ini_get('memory_limit'); |
178 | 179 | $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M'; |
179 | 180 | $status = self :: STATUS_ERROR; |
180 | - if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT) |
|
181 | - $status = self :: STATUS_OK; |
|
181 | + if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT) { |
|
182 | + $status = self :: STATUS_OK; |
|
183 | + } |
|
182 | 184 | $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo')); |
183 | 185 | |
184 | 186 | $setting = ini_get('post_max_size'); |
185 | 187 | $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M'; |
186 | 188 | $status = self :: STATUS_ERROR; |
187 | - if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE) |
|
188 | - $status = self :: STATUS_OK; |
|
189 | + if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE) { |
|
190 | + $status = self :: STATUS_OK; |
|
191 | + } |
|
189 | 192 | $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo')); |
190 | 193 | |
191 | 194 | $setting = ini_get('upload_max_filesize'); |
192 | 195 | $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M'; |
193 | 196 | $status = self :: STATUS_ERROR; |
194 | - if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE) |
|
195 | - $status = self :: STATUS_OK; |
|
197 | + if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE) { |
|
198 | + $status = self :: STATUS_OK; |
|
199 | + } |
|
196 | 200 | $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo')); |
197 | 201 | |
198 | 202 | $setting = ini_get('variables_order'); |
@@ -205,7 +209,7 @@ discard block |
||
205 | 209 | $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING; |
206 | 210 | $array[] = $this->build_setting($status, '[SESSION]', 'session.gc_maxlifetime', 'http://www.php.net/manual/en/ini.core.php#session.gc-maxlifetime', $setting, $req_setting, null, get_lang('SessionGCMaxLifetimeInfo')); |
207 | 211 | |
208 | - if (api_check_browscap()){$setting = true;}else{$setting=false;} |
|
212 | + if (api_check_browscap()){$setting = true;} else{$setting=false;} |
|
209 | 213 | $req_setting = true; |
210 | 214 | $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING; |
211 | 215 | $array[] = $this->build_setting($status, '[INI]', 'browscap', 'http://www.php.net/manual/en/misc.configuration.php#ini.browscap', $setting, $req_setting, 'on_off', get_lang('BrowscapInfo')); |
@@ -219,10 +219,10 @@ |
||
219 | 219 | // action links |
220 | 220 | echo '<div class="actions">'; |
221 | 221 | if (!api_is_anonymous()) { |
222 | - if (api_get_session_id() == 0) |
|
223 | - echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . |
|
222 | + if (api_get_session_id() == 0) { |
|
223 | + echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . |
|
224 | 224 | Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>'; |
225 | - elseif (api_is_allowed_to_session_edit(false, true)) { |
|
225 | + } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
226 | 226 | echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . |
227 | 227 | Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>'; |
228 | 228 | } |
@@ -666,9 +666,10 @@ |
||
666 | 666 | $result = ''; |
667 | 667 | for ($i = $min; $i <= $max; $i ++) { |
668 | 668 | $result .= '<option value="'.$i.'"'; |
669 | - if (is_int($selected_num)) |
|
670 | - if ($selected_num == $i) { |
|
669 | + if (is_int($selected_num)) { |
|
670 | + if ($selected_num == $i) { |
|
671 | 671 | $result .= ' selected="selected"'; |
672 | + } |
|
672 | 673 | } |
673 | 674 | $result .= '>'.$i.'</option>'; |
674 | 675 | } |
@@ -333,8 +333,12 @@ discard block |
||
333 | 333 | ) { |
334 | 334 | global $debug; |
335 | 335 | |
336 | - if ($debug) error_log('Called to update_event_exercice'); |
|
337 | - if ($debug) error_log('duration:' . $duration); |
|
336 | + if ($debug) { |
|
337 | + error_log('Called to update_event_exercice'); |
|
338 | + } |
|
339 | + if ($debug) { |
|
340 | + error_log('duration:' . $duration); |
|
341 | + } |
|
338 | 342 | |
339 | 343 | if ($exeid != '') { |
340 | 344 | /* |
@@ -386,8 +390,12 @@ discard block |
||
386 | 390 | WHERE exe_id = '".Database::escape_string($exeid)."'"; |
387 | 391 | $res = Database::query($sql); |
388 | 392 | |
389 | - if ($debug) error_log('update_event_exercice called'); |
|
390 | - if ($debug) error_log("$sql"); |
|
393 | + if ($debug) { |
|
394 | + error_log('update_event_exercice called'); |
|
395 | + } |
|
396 | + if ($debug) { |
|
397 | + error_log("$sql"); |
|
398 | + } |
|
391 | 399 | |
392 | 400 | //Deleting control time session track |
393 | 401 | //ExerciseLib::exercise_time_control_delete($exo_id); |
@@ -70,13 +70,16 @@ |
||
70 | 70 | */ |
71 | 71 | function connectDb($path = null, $dbMode = null, $lang = 'english') |
72 | 72 | { |
73 | - if ($this->db != null) |
|
74 | - return $this->db; |
|
75 | - if ($dbMode == null) |
|
76 | - $dbMode = Xapian::DB_CREATE_OR_OPEN; |
|
73 | + if ($this->db != null) { |
|
74 | + return $this->db; |
|
75 | + } |
|
76 | + if ($dbMode == null) { |
|
77 | + $dbMode = Xapian::DB_CREATE_OR_OPEN; |
|
78 | + } |
|
77 | 79 | |
78 | - if ($path == null) |
|
79 | - $path = api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/'; |
|
80 | + if ($path == null) { |
|
81 | + $path = api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/'; |
|
82 | + } |
|
80 | 83 | |
81 | 84 | try { |
82 | 85 | $this->db = new XapianWritableDatabase($path, $dbMode); |
@@ -48,7 +48,9 @@ discard block |
||
48 | 48 | |
49 | 49 | foreach ($sf_term_array as $raw_term) { |
50 | 50 | $term = substr($raw_term, 1); |
51 | - if (empty($term)) continue; |
|
51 | + if (empty($term)) { |
|
52 | + continue; |
|
53 | + } |
|
52 | 54 | $html_term = htmlspecialchars($term, ENT_QUOTES, $charset); |
53 | 55 | $selected = ''; |
54 | 56 | if (!empty($_REQUEST['sf_'.$prefix]) && is_array($_REQUEST['sf_'.$prefix]) && in_array($term,$_REQUEST['sf_'.$prefix])) { |
@@ -69,7 +71,9 @@ discard block |
||
69 | 71 | $max = count($sf_terms); |
70 | 72 | $multiple_selects .=''; |
71 | 73 | foreach ($sf_terms as $prefix => $sf_term_array) { |
72 | - if ($prefix == $prefilter_prefix) continue; |
|
74 | + if ($prefix == $prefilter_prefix) { |
|
75 | + continue; |
|
76 | + } |
|
73 | 77 | $multiple_select = ''; |
74 | 78 | if ($i>0) { |
75 | 79 | //print "+" image |
@@ -342,9 +346,10 @@ discard block |
||
342 | 346 | |
343 | 347 | // Tool introduction |
344 | 348 | // TODO: Settings for the online editor to be checked (insert an image for example). Probably this is a special case here. |
345 | - if (api_get_course_id() !== -1) |
|
346 | - if (!empty($groupId)) { |
|
349 | + if (api_get_course_id() !== -1) { |
|
350 | + if (!empty($groupId)) { |
|
347 | 351 | Display::display_introduction_section(TOOL_SEARCH.$groupId); |
352 | + } |
|
348 | 353 | } else { |
349 | 354 | Display::display_introduction_section(TOOL_SEARCH); |
350 | 355 | } |
@@ -366,7 +371,9 @@ discard block |
||
366 | 371 | break; |
367 | 372 | } |
368 | 373 | } |
369 | - if ($thesaurus_decided) break; |
|
374 | + if ($thesaurus_decided) { |
|
375 | + break; |
|
376 | + } |
|
370 | 377 | } |
371 | 378 | } |
372 | 379 |
@@ -36,8 +36,9 @@ discard block |
||
36 | 36 | $stored_terms = $this->get_terms_on_db($prefix, $course_code, $tool_id, $ref_id_high_level); |
37 | 37 | |
38 | 38 | // don't do anything if no change, verify only at DB, not the search engine |
39 | - if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) |
|
40 | - return FALSE; |
|
39 | + if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) { |
|
40 | + return FALSE; |
|
41 | + } |
|
41 | 42 | |
42 | 43 | require_once api_get_path(LIBRARY_PATH) . 'search/xapian/XapianQuery.php'; |
43 | 44 | |
@@ -45,8 +46,9 @@ discard block |
||
45 | 46 | $doc = $this->get_document($search_did); |
46 | 47 | $xapian_terms = xapian_get_doc_terms($doc, $prefix); |
47 | 48 | $xterms = array(); |
48 | - foreach ($xapian_terms as $xapian_term) |
|
49 | - $xterms[] = substr($xapian_term['name'], 1); |
|
49 | + foreach ($xapian_terms as $xapian_term) { |
|
50 | + $xterms[] = substr($xapian_term['name'], 1); |
|
51 | + } |
|
50 | 52 | |
51 | 53 | $dterms = $terms; |
52 | 54 |