@@ -42,7 +42,8 @@ |
||
42 | 42 | ); |
43 | 43 | if ($course_visible_for_user) { |
44 | 44 | $results[] = $result; |
45 | - } else { // course not visible for user |
|
45 | + } else { |
|
46 | +// course not visible for user |
|
46 | 47 | if ($search_show_unlinked_results) { |
47 | 48 | $result['url'] = ''; |
48 | 49 | $results[] = $result; |
@@ -59,7 +59,8 @@ discard block |
||
59 | 59 | * @param string Value |
60 | 60 | * @return void |
61 | 61 | */ |
62 | - function addValue($key, $value) { |
|
62 | + function addValue($key, $value) |
|
63 | + { |
|
63 | 64 | $this->data[$key] = $value; |
64 | 65 | } |
65 | 66 | |
@@ -68,7 +69,8 @@ discard block |
||
68 | 69 | * @param string Term |
69 | 70 | * @param string Flag (one character) |
70 | 71 | */ |
71 | - public function addTerm($term, $flag) { |
|
72 | + public function addTerm($term, $flag) |
|
73 | + { |
|
72 | 74 | global $charset; |
73 | 75 | if (strlen($flag) == 1) { |
74 | 76 | $this->terms[] = array('name' => api_convert_encoding(stripslashes($term), 'UTF-8', $charset), 'flag' => $flag); |
@@ -78,14 +80,16 @@ discard block |
||
78 | 80 | /** |
79 | 81 | * Class constructor. Just generates an empty 'data' array attribute |
80 | 82 | */ |
81 | - function __construct() { |
|
83 | + function __construct() |
|
84 | + { |
|
82 | 85 | $this->data = array(); |
83 | 86 | } |
84 | 87 | |
85 | 88 | /** |
86 | 89 | * Class desctructor. Unsets attributes. |
87 | 90 | */ |
88 | - function __destruct() { |
|
91 | + function __destruct() |
|
92 | + { |
|
89 | 93 | unset($this->data); |
90 | 94 | unset($this->terms); |
91 | 95 | } |
@@ -1947,8 +1947,9 @@ |
||
1947 | 1947 | $new_relation_type[] = "'$rel'"; |
1948 | 1948 | } |
1949 | 1949 | $relation_type = implode(',', $new_relation_type); |
1950 | - if (!empty($relation_type)) |
|
1951 | - $where_relation_condition = "AND gu.relation_type IN ($relation_type) "; |
|
1950 | + if (!empty($relation_type)) { |
|
1951 | + $where_relation_condition = "AND gu.relation_type IN ($relation_type) "; |
|
1952 | + } |
|
1952 | 1953 | } |
1953 | 1954 | |
1954 | 1955 | $sql = "SELECT picture_uri as image, u.id, CONCAT (u.firstname,' ', u.lastname) as fullname, relation_type |
@@ -3413,7 +3413,8 @@ discard block |
||
3413 | 3413 | $sql = "SELECT * FROM ".$tbl_global_agenda." WHERE MONTH(start_date) = ".$month." AND YEAR(start_date) = ".$year." AND access_url_id = $current_access_url_id ORDER BY start_date ASC"; |
3414 | 3414 | } |
3415 | 3415 | // 2. creating the SQL statement for getting the personal agenda items in WEEK view |
3416 | - if ($type == "week_view") { // we are in week view |
|
3416 | + if ($type == "week_view") { |
|
3417 | +// we are in week view |
|
3417 | 3418 | $start_end_day_of_week = self::calculate_start_end_of_week( |
3418 | 3419 | $week, |
3419 | 3420 | $year |
@@ -3433,7 +3434,8 @@ discard block |
||
3433 | 3434 | $sql = " SELECT * FROM ".$tbl_global_agenda." WHERE start_date>='".$start_filter."' AND start_date<='".$end_filter."' AND access_url_id = $current_access_url_id "; |
3434 | 3435 | } |
3435 | 3436 | // 3. creating the SQL statement for getting the personal agenda items in DAY view |
3436 | - if ($type == "day_view") { // we are in day view |
|
3437 | + if ($type == "day_view") { |
|
3438 | +// we are in day view |
|
3437 | 3439 | // we could use mysql date() function but this is only available from 4.1 and higher |
3438 | 3440 | $start_filter = $year."-".$month."-".$day." 00:00:00"; |
3439 | 3441 | $start_filter = api_get_utc_datetime($start_filter); |
@@ -607,7 +607,7 @@ |
||
607 | 607 | |
608 | 608 | if (is_file(api_get_path(SYS_CSS_PATH).'themes/'.$this->theme.'/editor.css')) { |
609 | 609 | $css[] = api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/editor.css'; |
610 | - }else{ |
|
610 | + } else { |
|
611 | 611 | $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'editor.css'); |
612 | 612 | } |
613 | 613 |
@@ -46,10 +46,12 @@ discard block |
||
46 | 46 | function my_delete($file) |
47 | 47 | { |
48 | 48 | if (check_name_exist($file)) { |
49 | - if (is_file($file)) { // FILE CASE |
|
49 | + if (is_file($file)) { |
|
50 | +// FILE CASE |
|
50 | 51 | unlink($file); |
51 | 52 | return true; |
52 | - } elseif (is_dir($file)) { // DIRECTORY CASE |
|
53 | + } elseif (is_dir($file)) { |
|
54 | +// DIRECTORY CASE |
|
53 | 55 | removeDir($file); |
54 | 56 | return true; |
55 | 57 | } |
@@ -130,7 +132,8 @@ discard block |
||
130 | 132 | * @return boolean true if succeed, false otherwise |
131 | 133 | * @see rename() uses the check_name_exist() and php2phps() functions |
132 | 134 | */ |
133 | -function my_rename($file_path, $new_file_name) { |
|
135 | +function my_rename($file_path, $new_file_name) |
|
136 | +{ |
|
134 | 137 | |
135 | 138 | $save_dir = getcwd(); |
136 | 139 | $path = dirname($file_path); |
@@ -276,7 +279,8 @@ discard block |
||
276 | 279 | * @param string $root path of dir to measure |
277 | 280 | * @param boolean $recursive if true , include subdirectory in total |
278 | 281 | */ |
279 | -function dirsize($root, $recursive = true) { |
|
282 | +function dirsize($root, $recursive = true) |
|
283 | +{ |
|
280 | 284 | $dir = @opendir($root); |
281 | 285 | $size = 0; |
282 | 286 | while ($file = @readdir($dir)) { |
@@ -70,7 +70,7 @@ |
||
70 | 70 | * Get the necessary javascript |
71 | 71 | */ |
72 | 72 | public function getElementJS() |
73 | - { |
|
73 | + { |
|
74 | 74 | $js = "<script type=\"text/javascript\"> |
75 | 75 | /* <![CDATA[ */ |
76 | 76 | receivers_hide('receivers_to'); |
@@ -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; |