@@ -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 |
@@ -171,14 +171,14 @@ |
||
| 171 | 171 | |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * Get a list of users of which the given conditions match with a LIKE '%cond%' |
|
| 175 | - * @param array $conditions a list of condition (exemple : status=>STUDENT) |
|
| 176 | - * @param array $order_by a list of fields on which sort |
|
| 177 | - * @return array An array with all users of the platform. |
|
| 178 | - * @todo optional course code parameter, optional sorting parameters... |
|
| 174 | + * Get a list of users of which the given conditions match with a LIKE '%cond%' |
|
| 175 | + * @param array $conditions a list of condition (exemple : status=>STUDENT) |
|
| 176 | + * @param array $order_by a list of fields on which sort |
|
| 177 | + * @return array An array with all users of the platform. |
|
| 178 | + * @todo optional course code parameter, optional sorting parameters... |
|
| 179 | 179 | *@todo Use the UserManager class |
| 180 | 180 | * @todo security filter order by |
| 181 | - */ |
|
| 181 | + */ |
|
| 182 | 182 | private static function get_user_list_like_start($conditions = [], $order_by = []) |
| 183 | 183 | { |
| 184 | 184 | $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 |
@@ -214,10 +214,10 @@ discard block |
||
| 214 | 214 | return true; |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - /** |
|
| 218 | - * Gets the password for a specific meeting for the current user |
|
| 219 | - * @return string A moderator password if user is teacher, or the course code otherwise |
|
| 220 | - */ |
|
| 217 | + /** |
|
| 218 | + * Gets the password for a specific meeting for the current user |
|
| 219 | + * @return string A moderator password if user is teacher, or the course code otherwise |
|
| 220 | + */ |
|
| 221 | 221 | public function getMeetingUserPassword() |
| 222 | 222 | { |
| 223 | 223 | if ($this->isTeacher()) { |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | // |
| 474 | 474 | // } |
| 475 | 475 | // |
| 476 | - //$item['created_at'] = api_convert_and_format_date($meetingDb['created_at']); |
|
| 476 | + //$item['created_at'] = api_convert_and_format_date($meetingDb['created_at']); |
|
| 477 | 477 | // //created_at |
| 478 | 478 | // |
| 479 | 479 | // $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) |
@@ -40,11 +40,19 @@ |
||
| 40 | 40 | return isset($_GET[$key]) ? $_GET[$key] : $default; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param string $key |
|
| 45 | + * |
|
| 46 | + * @return string |
|
| 47 | + */ |
|
| 43 | 48 | public static function server($key, $default = '') |
| 44 | 49 | { |
| 45 | 50 | return isset($_SERVER[$key]) ? $_SERVER[$key] : $default; |
| 46 | 51 | } |
| 47 | 52 | |
| 53 | + /** |
|
| 54 | + * @param string $name |
|
| 55 | + */ |
|
| 48 | 56 | public static function get_lang($name) |
| 49 | 57 | { |
| 50 | 58 | return SearchCoursePlugin::create()->get_lang($name); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | <div class="well course_search"> |
| 185 | 185 | <div class="menusection"> |
| 186 | 186 | <h4>$search_course_label</h4> |
| 187 | -EOT; |
|
| 187 | +eot; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | function display_footer() |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | <input type="text" name="search_term" class="span2" value="$search_term" /> |
| 210 | 210 | <input class="btn btn-default" type="submit" value="$search_label" /> |
| 211 | 211 | </form> |
| 212 | -EOT; |
|
| 212 | +eot; |
|
| 213 | 213 | echo $form; |
| 214 | 214 | } |
| 215 | 215 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | <form action="$self?action=subscribe" method="post"> |
| 294 | 294 | <input type="hidden" name="sec_token" value="$stok" /> |
| 295 | 295 | <input type="hidden" name="subscribe" value="$code" /> |
| 296 | -EOT; |
|
| 296 | +eot; |
|
| 297 | 297 | |
| 298 | 298 | $search_term = $this->post('search_term'); |
| 299 | 299 | if ($search_term) |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | echo <<<EOT |
| 303 | 303 | <input type="hidden" name="search_course" value="1" /> |
| 304 | 304 | <input type="hidden" name="search_term" value="$search_term" /> |
| 305 | -EOT; |
|
| 305 | +eot; |
|
| 306 | 306 | } |
| 307 | 307 | echo '<input type="image" name="unsub" src="'.Display::returnIconPath('enroll.gif').'" alt="'.get_lang('Subscribe').'" /> |
| 308 | 308 | '.get_lang('Subscribe').' |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | SELECT * FROM $course_table |
| 347 | 347 | WHERE ($course_fiter) AND (code LIKE '%$search_term%' OR visual_code LIKE '%$search_term%' OR title LIKE '%$search_term%' OR tutor_name LIKE '%$search_term%') |
| 348 | 348 | ORDER BY title, visual_code ASC |
| 349 | -EOT; |
|
| 349 | +eot; |
|
| 350 | 350 | |
| 351 | 351 | $result = array(); |
| 352 | 352 | $resultset = Database::query($sql); |
@@ -108,8 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | function run() |
| 110 | 110 | { |
| 111 | - if (!$this->accept()) |
|
| 112 | - { |
|
| 111 | + if (!$this->accept()) { |
|
| 113 | 112 | return; |
| 114 | 113 | } |
| 115 | 114 | $this->display_header(); |
@@ -120,21 +119,15 @@ discard block |
||
| 120 | 119 | $action = self::get('action'); |
| 121 | 120 | |
| 122 | 121 | $has_content = !empty($search_term) || !empty($action); |
| 123 | - if ($has_content) |
|
| 124 | - { |
|
| 122 | + if ($has_content) { |
|
| 125 | 123 | echo '<div class="list">'; |
| 126 | - } |
|
| 127 | - else |
|
| 128 | - { |
|
| 124 | + } else { |
|
| 129 | 125 | echo '<div>'; |
| 130 | 126 | } |
| 131 | 127 | |
| 132 | - if (RegisterCourseWidget::factory()->run()) |
|
| 133 | - { |
|
| 128 | + if (RegisterCourseWidget::factory()->run()) { |
|
| 134 | 129 | $result = true; |
| 135 | - } |
|
| 136 | - else |
|
| 137 | - { |
|
| 130 | + } else { |
|
| 138 | 131 | $result = $this->action_display(); |
| 139 | 132 | } |
| 140 | 133 | |
@@ -148,8 +141,7 @@ discard block |
||
| 148 | 141 | { |
| 149 | 142 | $self = $_SERVER['PHP_SELF']; |
| 150 | 143 | $parameters = array(); |
| 151 | - if ($action) |
|
| 152 | - { |
|
| 144 | + if ($action) { |
|
| 153 | 145 | $parameters[self::PARAM_ACTION] = $action; |
| 154 | 146 | } |
| 155 | 147 | $parameters = implode('&', $parameters); |
@@ -165,8 +157,7 @@ discard block |
||
| 165 | 157 | global $charset; |
| 166 | 158 | |
| 167 | 159 | $search_term = self::post('search_term'); |
| 168 | - if ($search_term) |
|
| 169 | - { |
|
| 160 | + if ($search_term) { |
|
| 170 | 161 | $search_result_for_label = self::get_lang('SearchResultsFor'); |
| 171 | 162 | $search_term_html = htmlentities($search_term, ENT_QUOTES, $charset); |
| 172 | 163 | echo "<h5>$search_result_for_label $search_term_html</h5>"; |
@@ -275,8 +266,7 @@ discard block |
||
| 275 | 266 | |
| 276 | 267 | //Already subscribed |
| 277 | 268 | $code = $current_course['code']; |
| 278 | - if (isset($user_courses[$code])) |
|
| 279 | - { |
|
| 269 | + if (isset($user_courses[$code])) { |
|
| 280 | 270 | echo self::get_lang('AlreadySubscribed'); |
| 281 | 271 | return false; |
| 282 | 272 | } |
@@ -296,8 +286,7 @@ discard block |
||
| 296 | 286 | EOT; |
| 297 | 287 | |
| 298 | 288 | $search_term = $this->post('search_term'); |
| 299 | - if ($search_term) |
|
| 300 | - { |
|
| 289 | + if ($search_term) { |
|
| 301 | 290 | $search_term = Security::remove_XSS($search_term); |
| 302 | 291 | echo <<<EOT |
| 303 | 292 | <input type="hidden" name="search_course" value="1" /> |
@@ -324,19 +313,15 @@ discard block |
||
| 324 | 313 | */ |
| 325 | 314 | function retrieve_courses($search_term) |
| 326 | 315 | { |
| 327 | - if (empty($search_term)) |
|
| 328 | - { |
|
| 316 | + if (empty($search_term)) { |
|
| 329 | 317 | return array(); |
| 330 | 318 | } |
| 331 | 319 | $search_term = Database::escape_string($search_term); |
| 332 | 320 | $course_table = Database::get_main_table(TABLE_MAIN_COURSE); |
| 333 | 321 | |
| 334 | - if (api_is_anonymous()) |
|
| 335 | - { |
|
| 322 | + if (api_is_anonymous()) { |
|
| 336 | 323 | $course_fiter = 'visibility = '.COURSE_VISIBILITY_OPEN_WORLD; |
| 337 | - } |
|
| 338 | - else |
|
| 339 | - { |
|
| 324 | + } else { |
|
| 340 | 325 | $course_fiter = 'visibility = '.COURSE_VISIBILITY_OPEN_WORLD.' OR '; |
| 341 | 326 | $course_fiter .= 'visibility = '.COURSE_VISIBILITY_OPEN_PLATFORM.' OR '; |
| 342 | 327 | $course_fiter .= '(visibility = '.COURSE_VISIBILITY_REGISTERED.' AND subscribe = 1)'; |
@@ -374,8 +359,7 @@ discard block |
||
| 374 | 359 | */ |
| 375 | 360 | function retrieve_user_courses($user_id = null) |
| 376 | 361 | { |
| 377 | - if (is_null($user_id)) |
|
| 378 | - { |
|
| 362 | + if (is_null($user_id)) { |
|
| 379 | 363 | global $_user; |
| 380 | 364 | $user_id = $_user['user_id']; |
| 381 | 365 | } |
@@ -423,8 +407,7 @@ discard block |
||
| 423 | 407 | */ |
| 424 | 408 | function filter_out_user_courses($courses) |
| 425 | 409 | { |
| 426 | - if (empty($courses)) |
|
| 427 | - { |
|
| 410 | + if (empty($courses)) { |
|
| 428 | 411 | return $courses; |
| 429 | 412 | } |
| 430 | 413 | |
@@ -432,8 +415,7 @@ discard block |
||
| 432 | 415 | $user_id = $_user['user_id']; |
| 433 | 416 | |
| 434 | 417 | $user_courses = $this->retrieve_user_courses($user_id); |
| 435 | - foreach ($user_courses as $key => $value) |
|
| 436 | - { |
|
| 418 | + foreach ($user_courses as $key => $value) { |
|
| 437 | 419 | unset($courses[$key]); |
| 438 | 420 | } |
| 439 | 421 | return $courses; |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | /** |
| 95 | 95 | * @param array $templates |
| 96 | 96 | * |
| 97 | - * @return null |
|
| 97 | + * @return null|string |
|
| 98 | 98 | */ |
| 99 | 99 | public function formatTemplates($templates) |
| 100 | 100 | { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | /** @var \Chamilo\CoreBundle\Entity\SystemTemplate $template */ |
| 110 | 110 | $templateList = array(); |
| 111 | 111 | $cssTheme = api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/'; |
| 112 | - $search = array('{CSS_THEME}', '{IMG_DIR}', '{REL_PATH}', '{COURSE_DIR}','{CSS}'); |
|
| 112 | + $search = array('{CSS_THEME}', '{IMG_DIR}', '{REL_PATH}', '{COURSE_DIR}', '{CSS}'); |
|
| 113 | 113 | $replace = array( |
| 114 | 114 | $cssTheme, |
| 115 | 115 | api_get_path(REL_CODE_PATH).'img/', |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $entityManager = \Database::getManager(); |
| 178 | 178 | $systemTemplates = $entityManager->getRepository('ChamiloCoreBundle:SystemTemplate')->findAll(); |
| 179 | 179 | $cssTheme = api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/'; |
| 180 | - $search = array('{CSS_THEME}', '{IMG_DIR}', '{REL_PATH}', '{COURSE_DIR}','{CSS}'); |
|
| 180 | + $search = array('{CSS_THEME}', '{IMG_DIR}', '{REL_PATH}', '{COURSE_DIR}', '{CSS}'); |
|
| 181 | 181 | $replace = array( |
| 182 | 182 | $cssTheme, |
| 183 | 183 | api_get_path(REL_CODE_PATH).'img/', |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | 86 | * Available driver list. |
| 87 | - * @return array |
|
| 87 | + * @return string[] |
|
| 88 | 88 | */ |
| 89 | 89 | private function getDefaultDriverList() |
| 90 | 90 | { |