@@ -80,7 +80,7 @@ |
||
80 | 80 | |
81 | 81 | /** |
82 | 82 | * Validates the received active connection data with the database |
83 | - * @return bool Return the loginFailed variable value to local.inc.php |
|
83 | + * @return null|false Return the loginFailed variable value to local.inc.php |
|
84 | 84 | */ |
85 | 85 | public function check_user() |
86 | 86 | { |
@@ -327,7 +327,7 @@ |
||
327 | 327 | * @param array $arr1 first array |
328 | 328 | * @param array $arr2 second array |
329 | 329 | * |
330 | - * @return array difference between the two arrays |
|
330 | + * @return string difference between the two arrays |
|
331 | 331 | */ |
332 | 332 | function diff($arr1, $arr2) |
333 | 333 | { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * @param string Name of common tag to place each line in |
158 | 158 | * @param string Name of the root element. A root element should always be given. |
159 | 159 | * @param string Encoding in which the data is provided |
160 | - * @return void Prompts the user for a file download |
|
160 | + * @return boolean Prompts the user for a file download |
|
161 | 161 | */ |
162 | 162 | public static function export_complex_table_xml( |
163 | 163 | $data, |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @param string $name |
284 | 284 | * @param string $format |
285 | 285 | * |
286 | - * @return bool |
|
286 | + * @return false|null |
|
287 | 287 | */ |
288 | 288 | public static function htmlToOdt($html, $name, $format = 'odt') |
289 | 289 | { |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
118 | - * Export tabular data to XML-file |
|
119 | - * @param array Simple array of data to put in XML |
|
120 | - * @param string Name of file to be given to the user |
|
121 | - * @param string Name of common tag to place each line in |
|
122 | - * @param string Name of the root element. A root element should always be given. |
|
123 | - * @param string Encoding in which the data is provided |
|
124 | - */ |
|
118 | + * Export tabular data to XML-file |
|
119 | + * @param array Simple array of data to put in XML |
|
120 | + * @param string Name of file to be given to the user |
|
121 | + * @param string Name of common tag to place each line in |
|
122 | + * @param string Name of the root element. A root element should always be given. |
|
123 | + * @param string Encoding in which the data is provided |
|
124 | + */ |
|
125 | 125 | public static function arrayToXml( |
126 | 126 | $data, |
127 | 127 | $filename = 'export', |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | foreach ($data as $row) { |
201 | 201 | $string .= "\n".str_repeat("\t", $level).'<'.$row['name'].'>'; |
202 | 202 | if (is_array($row['value'])) { |
203 | - $string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n"; |
|
203 | + $string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n"; |
|
204 | 204 | $string .= str_repeat("\t", $level).'</'.$row['name'].'>'; |
205 | 205 | } else { |
206 | 206 | $string .= $row['value']; |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * |
17 | 17 | * @param string Mobile phone number to be validated |
18 | 18 | * @param string Not using it. Just to respect the declaration |
19 | - * @return boolean Returns true if valid, false otherwise. |
|
19 | + * @return integer Returns true if valid, false otherwise. |
|
20 | 20 | */ |
21 | 21 | function validate($mobilePhoneNumber, $options = null) |
22 | 22 | { |
@@ -626,7 +626,7 @@ |
||
626 | 626 | |
627 | 627 | /** |
628 | 628 | * Get first SMS plugin name |
629 | - * @return string|boolean |
|
629 | + * @return string|false |
|
630 | 630 | */ |
631 | 631 | public function getSMSPluginName() |
632 | 632 | { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
132 | - * @return array |
|
132 | + * @return string[] |
|
133 | 133 | */ |
134 | 134 | public function get_status_list() |
135 | 135 | { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | /** |
273 | 273 | * @param int $id |
274 | 274 | * |
275 | - * @return bool |
|
275 | + * @return null|false |
|
276 | 276 | */ |
277 | 277 | public function delete($id) |
278 | 278 | { |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * Create a video chat |
44 | 44 | * @param int $fromUser The sender user |
45 | 45 | * @param int $toUser The receiver user |
46 | - * @return int The created video chat id. Otherwise return false |
|
46 | + * @return false|string The created video chat id. Otherwise return false |
|
47 | 47 | */ |
48 | 48 | public static function createRoom($fromUser, $toUser) |
49 | 49 | { |
@@ -121,6 +121,9 @@ |
||
121 | 121 | return $form->isSubmitted() == false || $form->validate(); |
122 | 122 | } |
123 | 123 | |
124 | + /** |
|
125 | + * @param string $format |
|
126 | + */ |
|
124 | 127 | function get_ceiling($format = null) |
125 | 128 | { |
126 | 129 | $result = Request::get('ceiling'); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | /** |
120 | 120 | * This function retrieves the existing permissions of a user, group or role. |
121 | -* @param $content are we retrieving the rights of a user, a group or a role (the database depends on it) |
|
121 | +* @param string $content are we retrieving the rights of a user, a group or a role (the database depends on it) |
|
122 | 122 | * @param $id the id of the user, group or role |
123 | 123 | * @author Patrick Cool <[email protected]>, Ghent University |
124 | 124 | * @version 1.0 |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | |
527 | 527 | /** |
528 | 528 | * This function gets all the roles that are defined |
529 | -* @param $content are we finding the roles for a user or a group (the database depends on it) |
|
529 | +* @param string $content are we finding the roles for a user or a group (the database depends on it) |
|
530 | 530 | * @param $id the id of the user or group |
531 | 531 | * @param string Deprecated parameter allowing use of 'platform' scope - the corresponding tables don't exist anymore so the scope is always set to 'course' |
532 | 532 | * @return array that contains the name of the roles the user has |
@@ -206,8 +206,7 @@ discard block |
||
206 | 206 | function display_checkbox_matrix($permission_array, $tool, $permission, $inherited_permissions = array()) |
207 | 207 | { |
208 | 208 | $checked = ""; |
209 | - if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool])) |
|
210 | - { |
|
209 | + if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool])) { |
|
211 | 210 | $checked = "checked"; |
212 | 211 | } |
213 | 212 | echo "\t\t\t<input type=\"checkbox\" name=\"permission*$tool*$permission\" $checked>\n"; |
@@ -254,8 +253,7 @@ discard block |
||
254 | 253 | echo "</a>"; |
255 | 254 | } |
256 | 255 | } else { |
257 | - if ($editable) |
|
258 | - { |
|
256 | + if ($editable) { |
|
259 | 257 | $url = api_get_self(); |
260 | 258 | $urlparameters = ''; |
261 | 259 | foreach ($_GET as $key => $value) { |
@@ -273,8 +271,7 @@ discard block |
||
273 | 271 | echo "\t\t\t <a href=\"".$url."\">"; |
274 | 272 | } |
275 | 273 | echo "<img src=\"../img/wrong.gif\" border=\"0\"/>"; |
276 | - if ($editable) |
|
277 | - { |
|
274 | + if ($editable) { |
|
278 | 275 | echo "</a>"; |
279 | 276 | } |
280 | 277 | } |
@@ -306,8 +303,7 @@ discard block |
||
306 | 303 | if ($editable) { |
307 | 304 | $url = api_get_self(); |
308 | 305 | $urlparameters = ''; |
309 | - foreach ($_GET as $key => $value) |
|
310 | - { |
|
306 | + foreach ($_GET as $key => $value) { |
|
311 | 307 | $parameter[$key] = $value; |
312 | 308 | } |
313 | 309 | $parameter['action'] = 'manage_rights'; |
@@ -315,8 +311,7 @@ discard block |
||
315 | 311 | $parameter['permission'] = $permission; |
316 | 312 | $parameter['tool'] = $tool; |
317 | 313 | $parameter['user_id'] = $user_id; |
318 | - foreach ($parameter as $key=>$value) |
|
319 | - { |
|
314 | + foreach ($parameter as $key=>$value) { |
|
320 | 315 | $urlparameters .= $key.'='.$value.'&'; |
321 | 316 | } |
322 | 317 | $url = $url.'?'.$urlparameters; |
@@ -433,16 +428,15 @@ discard block |
||
433 | 428 | * @author Patrick Cool <[email protected]>, Ghent University |
434 | 429 | * @version 1.0 |
435 | 430 | */ |
436 | -function get_all_roles($content = 'course') { |
|
431 | +function get_all_roles($content = 'course') |
|
432 | +{ |
|
437 | 433 | $course_id = api_get_course_int_id(); |
438 | 434 | $course_id_condition = " WHERE c_id = $course_id "; |
439 | 435 | |
440 | - if ($content == 'course') |
|
441 | - { |
|
436 | + if ($content == 'course') { |
|
442 | 437 | $table_role = Database::get_course_table(TABLE_ROLE); |
443 | 438 | } |
444 | - if ($content == 'platform') |
|
445 | - { |
|
439 | + if ($content == 'platform') { |
|
446 | 440 | $table_role = Database::get_main_table(TABLE_ROLE); |
447 | 441 | $course_id_condition = ''; |
448 | 442 | } |
@@ -450,8 +444,7 @@ discard block |
||
450 | 444 | $current_roles = array(); |
451 | 445 | $sql = "SELECT * FROM $table_role $course_id_condition "; |
452 | 446 | $result = Database::query($sql); |
453 | - while ($row = Database::fetch_array($result)) |
|
454 | - { |
|
447 | + while ($row = Database::fetch_array($result)) { |
|
455 | 448 | $roles[] = $row; |
456 | 449 | } |
457 | 450 |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | if ($value == 'View') { |
176 | 176 | unset($current_permissions[$tool][$key]); |
177 | 177 | } |
178 | - if ($value == 'Visibility' OR $value == 'Move') { |
|
178 | + if ($value == 'Visibility' or $value == 'Move') { |
|
179 | 179 | if (!in_array('Edit', $current_permissions[$tool])) { |
180 | 180 | $current_permissions[$tool][] = 'Edit'; |
181 | 181 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | function display_checkbox_matrix($permission_array, $tool, $permission, $inherited_permissions = array()) |
207 | 207 | { |
208 | 208 | $checked = ""; |
209 | - if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool])) |
|
209 | + if (is_array($permission_array[$tool]) and in_array($permission, $permission_array[$tool])) |
|
210 | 210 | { |
211 | 211 | $checked = "checked"; |
212 | 212 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | if (in_array($permission, $inherited_permissions[$tool])) { |
233 | 233 | echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">"; |
234 | 234 | } else { |
235 | - if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool])) { |
|
235 | + if (is_array($permission_array[$tool]) and in_array($permission, $permission_array[$tool])) { |
|
236 | 236 | if ($editable) { |
237 | 237 | $url = api_get_self(); |
238 | 238 | $urlparameters = ''; |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | if (!empty($inherited_permissions) and in_array($permission, $inherited_permissions[$tool])) { |
303 | 303 | echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">"; |
304 | 304 | } else { |
305 | - if (is_array($permission_array[$tool]) AND in_array($permission, $permission_array[$tool])) { |
|
305 | + if (is_array($permission_array[$tool]) and in_array($permission, $permission_array[$tool])) { |
|
306 | 306 | if ($editable) { |
307 | 307 | $url = api_get_self(); |
308 | 308 | $urlparameters = ''; |