@@ -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 = ''; |
@@ -84,7 +84,7 @@ |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
87 | - * @param $directoryPath |
|
87 | + * @param string $directoryPath |
|
88 | 88 | * @return bool |
89 | 89 | */ |
90 | 90 | function deleteDirectory($directoryPath) |
@@ -132,7 +132,8 @@ |
||
132 | 132 | */ |
133 | 133 | function pptConverterGetCommandBaseParams() |
134 | 134 | { |
135 | - if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php |
|
135 | + if (IS_WINDOWS_OS) { |
|
136 | +// IS_WINDOWS_OS has been defined in main_api.lib.php |
|
136 | 137 | $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png'); |
137 | 138 | $classPath = $converterPath.';'.$converterPath.'/jodconverter-2.2.2.jar;'.$converterPath.'/jodconverter-cli-2.2.2.jar'; |
138 | 139 | $cmd = 'java -Dfile.encoding=UTF-8 -cp "'.$classPath.'" DokeosConverter'; |
@@ -154,6 +154,6 @@ |
||
154 | 154 | 'location' => $webCodePath.'webservices/additional_webservices.php' |
155 | 155 | ); |
156 | 156 | |
157 | -$soapServer = new SoapServer(NULL, $options); |
|
157 | +$soapServer = new SoapServer(null, $options); |
|
158 | 158 | $soapServer->addFunction('wsConvertPpt'); |
159 | 159 | $soapServer->handle(); |
@@ -137,7 +137,7 @@ |
||
137 | 137 | /** |
138 | 138 | * Get a list of users of which the given conditions match with a LIKE '%cond%' |
139 | 139 | * @param array $conditions a list of condition (exemple : status=>STUDENT) |
140 | - * @param array $order_by a list of fields on which sort |
|
140 | + * @param string[] $order_by a list of fields on which sort |
|
141 | 141 | * @return array An array with all users of the platform. |
142 | 142 | * @todo optional course code parameter, optional sorting parameters... |
143 | 143 | *@todo Use the UserManager class |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | { |
103 | 103 | global $charset; |
104 | 104 | if ($this->verifyUserPass($username, $password) == "valid") { |
105 | - $user_id = UserManager::get_user_id_from_username($username); |
|
105 | + $user_id = UserManager::get_user_id_from_username($username); |
|
106 | 106 | $message_title = get_lang('Invitation'); |
107 | 107 | $count_is_true = SocialManager::send_invitation_friend($user_id, $userfriend_id, $message_title, $content_message); |
108 | 108 | |
@@ -158,14 +158,14 @@ discard block |
||
158 | 158 | |
159 | 159 | |
160 | 160 | /** |
161 | - * Get a list of users of which the given conditions match with a LIKE '%cond%' |
|
162 | - * @param array $conditions a list of condition (exemple : status=>STUDENT) |
|
163 | - * @param array $order_by a list of fields on which sort |
|
164 | - * @return array An array with all users of the platform. |
|
165 | - * @todo optional course code parameter, optional sorting parameters... |
|
161 | + * Get a list of users of which the given conditions match with a LIKE '%cond%' |
|
162 | + * @param array $conditions a list of condition (exemple : status=>STUDENT) |
|
163 | + * @param array $order_by a list of fields on which sort |
|
164 | + * @return array An array with all users of the platform. |
|
165 | + * @todo optional course code parameter, optional sorting parameters... |
|
166 | 166 | *@todo Use the UserManager class |
167 | 167 | * @todo security filter order by |
168 | - */ |
|
168 | + */ |
|
169 | 169 | private static function get_user_list_like_start($conditions = [], $order_by = []) |
170 | 170 | { |
171 | 171 | $user_table = Database::get_main_table(TABLE_MAIN_USER); |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | * Register a user into a queue for a session |
371 | 371 | * @param $userId |
372 | 372 | * @param $sessionId |
373 | - * @return bool|int |
|
373 | + * @return false|string |
|
374 | 374 | */ |
375 | 375 | public function addToQueue($userId, $sessionId) |
376 | 376 | { |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | * Register message with type and status |
397 | 397 | * @param $mailId |
398 | 398 | * @param $userId |
399 | - * @param $sessionId |
|
399 | + * @param integer $sessionId |
|
400 | 400 | * @return bool|int |
401 | 401 | */ |
402 | 402 | public function saveLastMessage($mailId, $userId, $sessionId) |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | |
510 | 510 | /** |
511 | 511 | * Check if session is open for subscription |
512 | - * @param $sessionId |
|
512 | + * @param integer $sessionId |
|
513 | 513 | * @param string $fieldVariable |
514 | 514 | * @return bool |
515 | 515 | */ |
@@ -531,8 +531,8 @@ discard block |
||
531 | 531 | |
532 | 532 | /** |
533 | 533 | * Check if user is in the session's target group based on its area |
534 | - * @param $userId |
|
535 | - * @param $sessionId |
|
534 | + * @param integer $userId |
|
535 | + * @param integer $sessionId |
|
536 | 536 | * @param string $userFieldVariable |
537 | 537 | * @param string $sessionFieldVariable |
538 | 538 | * @return bool |
@@ -1002,7 +1002,7 @@ discard block |
||
1002 | 1002 | /** |
1003 | 1003 | * Return the session details data from a session ID (including the extra |
1004 | 1004 | * fields used for the advanced subscription mechanism) |
1005 | - * @param $sessionId |
|
1005 | + * @param integer $sessionId |
|
1006 | 1006 | * @return bool|mixed |
1007 | 1007 | */ |
1008 | 1008 | public function getSessionDetails($sessionId) |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | |
1103 | 1103 | /** |
1104 | 1104 | * Return the url to go to session |
1105 | - * @param $sessionId |
|
1105 | + * @param integer $sessionId |
|
1106 | 1106 | * |
1107 | 1107 | * @return string |
1108 | 1108 | */ |
@@ -213,7 +213,8 @@ |
||
213 | 213 | /** |
214 | 214 | * Returns a meeting "join" URL |
215 | 215 | * @param string The name of the meeting (usually the course code) |
216 | - * @return mixed The URL to join the meeting, or false on error |
|
216 | + * @param false|string $meetingId |
|
217 | + * @return false|null The URL to join the meeting, or false on error |
|
217 | 218 | * @todo implement moderator pass |
218 | 219 | * @assert ('') === false |
219 | 220 | * @assert ('abcdefghijklmnopqrstuvwxyzabcdefghijklmno') === false |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | return false; |
127 | 127 | } |
128 | 128 | } |
129 | - */ |
|
129 | + */ |
|
130 | 130 | |
131 | 131 | /* |
132 | 132 | * Creating a Room for the meeting |
@@ -256,10 +256,10 @@ discard block |
||
256 | 256 | return true; |
257 | 257 | } |
258 | 258 | |
259 | - /** |
|
260 | - * Gets the password for a specific meeting for the current user |
|
261 | - * @return string A moderator password if user is teacher, or the course code otherwise |
|
262 | - */ |
|
259 | + /** |
|
260 | + * Gets the password for a specific meeting for the current user |
|
261 | + * @return string A moderator password if user is teacher, or the course code otherwise |
|
262 | + */ |
|
263 | 263 | public function getMeetingUserPassword() |
264 | 264 | { |
265 | 265 | if ($this->isTeacher()) { |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | // |
539 | 539 | // } |
540 | 540 | // |
541 | - //$item['created_at'] = api_convert_and_format_date($meetingDb['created_at']); |
|
541 | + //$item['created_at'] = api_convert_and_format_date($meetingDb['created_at']); |
|
542 | 542 | // //created_at |
543 | 543 | // |
544 | 544 | // $item['publish_url'] = api_get_self().'?action=publish&id='.$meetingDb['id']; |
@@ -36,6 +36,11 @@ |
||
36 | 36 | private $_pass; |
37 | 37 | private $_url; |
38 | 38 | |
39 | + /** |
|
40 | + * @param string $host |
|
41 | + * @param string $user |
|
42 | + * @param string $pass |
|
43 | + */ |
|
39 | 44 | public function __construct($host, $user, $pass) |
40 | 45 | { |
41 | 46 | $this->_user = urlencode($user); |
@@ -351,9 +351,9 @@ |
||
351 | 351 | . '&externalRoomType='.$room->externalRoomType; |
352 | 352 | if ($room->allowRecording) { |
353 | 353 | $url .= '&allowUserQuestions='.$this->var_to_str($room->allowUserQuestions) |
354 | - . '&isAudioOnly='.$this->var_to_str($room->isAudioOnly) |
|
355 | - . '&waitForRecording='.$this->var_to_str($room->waitForRecording) |
|
356 | - . '&allowRecording='.$this->var_to_str($room->allowRecording); |
|
354 | + . '&isAudioOnly='.$this->var_to_str($room->isAudioOnly) |
|
355 | + . '&waitForRecording='.$this->var_to_str($room->waitForRecording) |
|
356 | + . '&allowRecording='.$this->var_to_str($room->allowRecording); |
|
357 | 357 | } elseif ($room->isAudioOnly) { |
358 | 358 | $url .= '&isAudioOnly='.$this->var_to_str($room->isAudioOnly); |
359 | 359 | } |
@@ -27,6 +27,9 @@ discard block |
||
27 | 27 | */ |
28 | 28 | class OpenMeetingsRestService |
29 | 29 | { |
30 | + /** |
|
31 | + * @param string $request |
|
32 | + */ |
|
30 | 33 | function call($request, $returnAttribute = "return") |
31 | 34 | { |
32 | 35 | // This will allow you to view errors in the browser |
@@ -121,6 +124,9 @@ discard block |
||
121 | 124 | |
122 | 125 | } |
123 | 126 | |
127 | + /** |
|
128 | + * @param DOMDocument $node |
|
129 | + */ |
|
124 | 130 | function getArray($node) |
125 | 131 | { |
126 | 132 | if (is_null($node) || !is_object($node)) { |
@@ -99,7 +99,7 @@ |
||
99 | 99 | /** |
100 | 100 | * Gets a string from a boolean attribute |
101 | 101 | * @param string $attribute Name of the attribute |
102 | - * @param mixed $voidReturn What to return if the value is not defined |
|
102 | + * @param string $voidReturn What to return if the value is not defined |
|
103 | 103 | * @return string The boolean value expressed as string ('true' or 'false') |
104 | 104 | */ |
105 | 105 | public function getString($attribute, $voidReturn = false) |