@@ -936,7 +936,8 @@ |
||
| 936 | 936 | |
| 937 | 937 | // HTMLPURIFIER-COMPATIBLE SETTINGS |
| 938 | 938 | |
| 939 | -function convert_kses_to_htmlpurifier($allowed_tags) { |
|
| 939 | +function convert_kses_to_htmlpurifier($allowed_tags) |
|
| 940 | +{ |
|
| 940 | 941 | $allowed_html = array(); |
| 941 | 942 | foreach ($allowed_tags as $key1 => & $value1) { |
| 942 | 943 | $result[0][] = $key1; |
@@ -52,8 +52,9 @@ discard block |
||
| 52 | 52 | while (($file = readdir($dh)) !== false) { |
| 53 | 53 | if ($file[0] <> '.' && substr($file, -4, strlen($file)) == '.php') { |
| 54 | 54 | if ($only_main_name) { |
| 55 | - if ($file != '' && strpos($file, '.inc.php')) |
|
| 56 | - $content_dir[] = substr($file, 0, strpos($file, '.inc.php')); |
|
| 55 | + if ($file != '' && strpos($file, '.inc.php')) { |
|
| 56 | + $content_dir[] = substr($file, 0, strpos($file, '.inc.php')); |
|
| 57 | + } |
|
| 57 | 58 | } else { |
| 58 | 59 | $content_dir[] = $file; |
| 59 | 60 | } |
@@ -126,7 +127,8 @@ discard block |
||
| 126 | 127 | list($var, $val) = explode('=', $line, 2); |
| 127 | 128 | $var = trim($var); |
| 128 | 129 | $val = trim($val); |
| 129 | - if ($get_as_string_index) { //remove the prefix $ |
|
| 130 | + if ($get_as_string_index) { |
|
| 131 | +//remove the prefix $ |
|
| 130 | 132 | $var = substr($var, 1); |
| 131 | 133 | } |
| 132 | 134 | $res_list[$var] = $val; |
@@ -33,7 +33,8 @@ |
||
| 33 | 33 | // Tracking |
| 34 | 34 | Event::event_access_tool(TOOL_GLOSSARY); |
| 35 | 35 | |
| 36 | -function sorter($item1, $item2) { |
|
| 36 | +function sorter($item1, $item2) |
|
| 37 | +{ |
|
| 37 | 38 | if ($item1[2] == $item2[2]) { |
| 38 | 39 | return 0; |
| 39 | 40 | } |
@@ -50,7 +50,8 @@ |
||
| 50 | 50 | $question_values = array(); |
| 51 | 51 | |
| 52 | 52 | // Values of question options |
| 53 | - if (is_array($form_content['values'])) { // Check if data is correct |
|
| 53 | + if (is_array($form_content['values'])) { |
|
| 54 | +// Check if data is correct |
|
| 54 | 55 | foreach ($form_content['values'] as $key => & $value) { |
| 55 | 56 | $question_values [] = '<input size="3" type="text" id="values['.$key.']" name="values['.$key.']" value="'.$value.'" />'; |
| 56 | 57 | } |
@@ -1008,7 +1008,8 @@ |
||
| 1008 | 1008 | Event::event_access_tool(TOOL_DOCUMENT); |
| 1009 | 1009 | |
| 1010 | 1010 | /* DISPLAY */ |
| 1011 | -if ($groupId != 0) { // Add group name after for group documents |
|
| 1011 | +if ($groupId != 0) { |
|
| 1012 | +// Add group name after for group documents |
|
| 1012 | 1013 | $add_group_to_title = ' ('.$group_properties['name'].')'; |
| 1013 | 1014 | } |
| 1014 | 1015 | |
@@ -69,7 +69,8 @@ |
||
| 69 | 69 | echo "</table>\n"; |
| 70 | 70 | |
| 71 | 71 | |
| 72 | -function get_all_php_files($base_path) { |
|
| 72 | +function get_all_php_files($base_path) |
|
| 73 | +{ |
|
| 73 | 74 | $list = scandir($base_path); |
| 74 | 75 | $files = array(); |
| 75 | 76 | foreach ($list as $item) { |
@@ -67,7 +67,8 @@ |
||
| 67 | 67 | return false; //cannot use if sqlite not installed |
| 68 | 68 | } |
| 69 | 69 | $err = Database::query('SELECT * FROM lang_freq'); |
| 70 | - if ($err === false) { //the database probably does not exist, create it |
|
| 70 | + if ($err === false) { |
|
| 71 | +//the database probably does not exist, create it |
|
| 71 | 72 | $err = Database::query( |
| 72 | 73 | 'CREATE TABLE lang_freq (' |
| 73 | 74 | . ' id int PRIMARY KEY AUTO_INCREMENT, ' |
@@ -11,7 +11,8 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * Small function to list files in archive/ |
| 13 | 13 | */ |
| 14 | -function get_zip_files_in_garbage() { |
|
| 14 | +function get_zip_files_in_garbage() |
|
| 15 | +{ |
|
| 15 | 16 | $list = array(); |
| 16 | 17 | $dh = opendir(api_get_path(SYS_ARCHIVE_PATH)); |
| 17 | 18 | if ($dh === false) { |
@@ -81,7 +81,8 @@ |
||
| 81 | 81 | ); |
| 82 | 82 | if ($course_visible_for_user) { |
| 83 | 83 | $results[] = $result; |
| 84 | - } else { // course not visible for user |
|
| 84 | + } else { |
|
| 85 | +// course not visible for user |
|
| 85 | 86 | if ($search_show_unlinked_results) { |
| 86 | 87 | $result['url'] = ''; |
| 87 | 88 | $results[] = $result; |