@@ -198,12 +198,14 @@ |
||
198 | 198 | //echo strlen($legal[1]); echo '<br>'; |
199 | 199 | $versions[]=$legal[0]; |
200 | 200 | $languages[]=$legal[1]; |
201 | - if (strlen($legal[2])>2000) |
|
202 | - $legal[2]= substr($legal[2],0,2000).' ... '; |
|
203 | - if ($legal[4]==0) |
|
204 | - $legal[4]= get_lang('HTMLText'); |
|
205 | - elseif($legal[4]==1) |
|
206 | - $legal[4]=get_lang('PageLink'); |
|
201 | + if (strlen($legal[2])>2000) { |
|
202 | + $legal[2]= substr($legal[2],0,2000).' ... '; |
|
203 | + } |
|
204 | + if ($legal[4]==0) { |
|
205 | + $legal[4]= get_lang('HTMLText'); |
|
206 | + } elseif($legal[4]==1) { |
|
207 | + $legal[4]=get_lang('PageLink'); |
|
208 | + } |
|
207 | 209 | $legals[] = $legal; |
208 | 210 | } |
209 | 211 | return $legals; |
@@ -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); |
@@ -1880,7 +1880,7 @@ discard block |
||
1880 | 1880 | $html .= Display::tag('li', Display::return_icon('teacher.png', $teacher, null, ICON_SIZE_TINY) . ' ' . $teacher); |
1881 | 1881 | } |
1882 | 1882 | $html .= '</ul>'; |
1883 | - }else{ |
|
1883 | + } else{ |
|
1884 | 1884 | $html .= array_to_string($list, $separator); |
1885 | 1885 | } |
1886 | 1886 | } |
@@ -3236,7 +3236,7 @@ discard block |
||
3236 | 3236 | $html .= '<a class="thumbnail" href="'.$params['link'].'">'; |
3237 | 3237 | $html .= $params['icon']; |
3238 | 3238 | $html .= '</a>'; |
3239 | - }else{ |
|
3239 | + } else{ |
|
3240 | 3240 | $html .= $params['icon']; |
3241 | 3241 | } |
3242 | 3242 | $html .= '</div>'; |
@@ -1631,11 +1631,11 @@ discard block |
||
1631 | 1631 | |
1632 | 1632 | if ($size == IMAGE_WALL_SMALL) { |
1633 | 1633 | $name = IMAGE_WALL_SMALL. '_' . $array[2]; |
1634 | - }else if($size == IMAGE_WALL_MEDIUM){ |
|
1634 | + } else if($size == IMAGE_WALL_MEDIUM){ |
|
1635 | 1635 | $name = IMAGE_WALL_MEDIUM. '_' . $array[2]; |
1636 | - }else if($size == IMAGE_WALL_BIG){ |
|
1636 | + } else if($size == IMAGE_WALL_BIG){ |
|
1637 | 1637 | $name = IMAGE_WALL_BIG. '_' . $array[2]; |
1638 | - }else { |
|
1638 | + } else { |
|
1639 | 1639 | $name = IMAGE_WALL_SMALL. '_' . $array[2]; |
1640 | 1640 | } |
1641 | 1641 | $lessImage = str_replace($array[2], '', $path); |
@@ -1759,7 +1759,9 @@ discard block |
||
1759 | 1759 | $friendHtml.= '<ul class="nav nav-list">'; |
1760 | 1760 | $j = 1; |
1761 | 1761 | for ($k=0; $k < $number_friends; $k++) { |
1762 | - if ($j > $number_of_images) break; |
|
1762 | + if ($j > $number_of_images) { |
|
1763 | + break; |
|
1764 | + } |
|
1763 | 1765 | |
1764 | 1766 | if (isset($friends[$k])) { |
1765 | 1767 | $friend = $friends[$k]; |
@@ -1815,7 +1817,9 @@ discard block |
||
1815 | 1817 | $friendHtml.= '<div class="list-group">'; |
1816 | 1818 | $j = 1; |
1817 | 1819 | for ($k=0; $k < $number_friends; $k++) { |
1818 | - if ($j > $number_of_images) break; |
|
1820 | + if ($j > $number_of_images) { |
|
1821 | + break; |
|
1822 | + } |
|
1819 | 1823 | |
1820 | 1824 | if (isset($friends[$k])) { |
1821 | 1825 | $friend = $friends[$k]; |
@@ -131,8 +131,9 @@ discard block |
||
131 | 131 | $direction = 'DESC'; |
132 | 132 | } else { |
133 | 133 | $column = intval($column); |
134 | - if (!in_array($direction, array('ASC', 'DESC'))) |
|
135 | - $direction = 'ASC'; |
|
134 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
135 | + $direction = 'ASC'; |
|
136 | + } |
|
136 | 137 | } |
137 | 138 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
138 | 139 | |
@@ -488,8 +489,9 @@ discard block |
||
488 | 489 | public static function delete_message_by_user_receiver($user_receiver_id, $id) |
489 | 490 | { |
490 | 491 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
491 | - if ($id != strval(intval($id))) |
|
492 | - return false; |
|
492 | + if ($id != strval(intval($id))) { |
|
493 | + return false; |
|
494 | + } |
|
493 | 495 | $user_receiver_id = intval($user_receiver_id); |
494 | 496 | $id = intval($id); |
495 | 497 | $sql = "SELECT * FROM $table_message |
@@ -664,8 +666,9 @@ discard block |
||
664 | 666 | */ |
665 | 667 | public static function update_message($user_id, $message_id) |
666 | 668 | { |
667 | - if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) |
|
668 | - return false; |
|
669 | + if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) { |
|
670 | + return false; |
|
671 | + } |
|
669 | 672 | |
670 | 673 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
671 | 674 | $sql = "UPDATE $table_message SET msg_status = '0' |
@@ -705,8 +708,9 @@ discard block |
||
705 | 708 | */ |
706 | 709 | public static function get_message_by_user($user_id, $message_id) |
707 | 710 | { |
708 | - if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) |
|
709 | - return false; |
|
711 | + if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) { |
|
712 | + return false; |
|
713 | + } |
|
710 | 714 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
711 | 715 | $query = "SELECT * FROM $table_message |
712 | 716 | WHERE user_receiver_id=".intval($user_id)." AND id='".intval($message_id)."'"; |
@@ -721,8 +725,9 @@ discard block |
||
721 | 725 | */ |
722 | 726 | public static function get_messages_by_group($group_id) |
723 | 727 | { |
724 | - if ($group_id != strval(intval($group_id))) |
|
725 | - return false; |
|
728 | + if ($group_id != strval(intval($group_id))) { |
|
729 | + return false; |
|
730 | + } |
|
726 | 731 | |
727 | 732 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
728 | 733 | $group_id = intval($group_id); |
@@ -749,8 +754,9 @@ discard block |
||
749 | 754 | */ |
750 | 755 | public static function get_messages_by_group_by_message($group_id, $message_id) |
751 | 756 | { |
752 | - if ($group_id != strval(intval($group_id))) |
|
753 | - return false; |
|
757 | + if ($group_id != strval(intval($group_id))) { |
|
758 | + return false; |
|
759 | + } |
|
754 | 760 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
755 | 761 | $group_id = intval($group_id); |
756 | 762 | $sql = "SELECT * FROM $table_message |
@@ -828,8 +834,9 @@ discard block |
||
828 | 834 | */ |
829 | 835 | public static function exist_message($user_id, $id) |
830 | 836 | { |
831 | - if ($id != strval(intval($id)) || $user_id != strval(intval($user_id))) |
|
832 | - return false; |
|
837 | + if ($id != strval(intval($id)) || $user_id != strval(intval($user_id))) { |
|
838 | + return false; |
|
839 | + } |
|
833 | 840 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
834 | 841 | $query = "SELECT id FROM $table_message |
835 | 842 | WHERE |
@@ -860,8 +867,9 @@ discard block |
||
860 | 867 | $direction = 'DESC'; |
861 | 868 | } else { |
862 | 869 | $column = intval($column); |
863 | - if (!in_array($direction, array('ASC', 'DESC'))) |
|
864 | - $direction = 'ASC'; |
|
870 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
871 | + $direction = 'ASC'; |
|
872 | + } |
|
865 | 873 | } |
866 | 874 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
867 | 875 | $request = api_is_xml_http_request(); |
@@ -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 |