@@ -132,9 +132,9 @@ discard block |
||
| 132 | 132 | /** |
| 133 | 133 | * Validates the password |
| 134 | 134 | * |
| 135 | - * @param $encoded |
|
| 136 | - * @param $raw |
|
| 137 | - * @param $salt |
|
| 135 | + * @param string $encoded |
|
| 136 | + * @param string $raw |
|
| 137 | + * @param string $salt |
|
| 138 | 138 | * @return bool |
| 139 | 139 | */ |
| 140 | 140 | public static function isPasswordValid($encoded, $raw, $salt) |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * @param string $raw |
| 150 | 150 | * @param User $user |
| 151 | 151 | * |
| 152 | - * @return bool |
|
| 152 | + * @return string |
|
| 153 | 153 | */ |
| 154 | 154 | public static function encryptPassword($raw, User $user) |
| 155 | 155 | { |
@@ -1096,6 +1096,7 @@ discard block |
||
| 1096 | 1096 | /** |
| 1097 | 1097 | * Disables a user |
| 1098 | 1098 | * @param int User id |
| 1099 | + * @param integer $user_id |
|
| 1099 | 1100 | * @return bool |
| 1100 | 1101 | * @uses UserManager::change_active_state() to actually disable the user |
| 1101 | 1102 | * @assert (0) === false |
@@ -1112,6 +1113,7 @@ discard block |
||
| 1112 | 1113 | /** |
| 1113 | 1114 | * Enable a user |
| 1114 | 1115 | * @param int User id |
| 1116 | + * @param integer $user_id |
|
| 1115 | 1117 | * @return bool |
| 1116 | 1118 | * @uses UserManager::change_active_state() to actually disable the user |
| 1117 | 1119 | * @assert (0) === false |
@@ -1278,6 +1280,7 @@ discard block |
||
| 1278 | 1280 | * Checks whether the user id exists in the database |
| 1279 | 1281 | * |
| 1280 | 1282 | * @param int User id |
| 1283 | + * @param integer $userId |
|
| 1281 | 1284 | * @return bool True if user id was found, false otherwise |
| 1282 | 1285 | */ |
| 1283 | 1286 | public static function is_user_id_valid($userId) |
@@ -1419,7 +1422,7 @@ discard block |
||
| 1419 | 1422 | /** |
| 1420 | 1423 | * Get a list of users of which the given conditions match with a LIKE '%cond%' |
| 1421 | 1424 | * @param array $conditions a list of condition (exemple : status=>STUDENT) |
| 1422 | - * @param array $order_by a list of fields on which sort |
|
| 1425 | + * @param string[] $order_by a list of fields on which sort |
|
| 1423 | 1426 | * @return array An array with all users of the platform. |
| 1424 | 1427 | * @todo optional course code parameter, optional sorting parameters... |
| 1425 | 1428 | * @todo security filter order_by |
@@ -1490,7 +1493,7 @@ discard block |
||
| 1490 | 1493 | * @param array $userInfo user information to avoid query the DB |
| 1491 | 1494 | * returns the /main/img/unknown.jpg image set it at true |
| 1492 | 1495 | * |
| 1493 | - * @return array Array of 2 elements: 'dir' and 'file' which contain |
|
| 1496 | + * @return integer Array of 2 elements: 'dir' and 'file' which contain |
|
| 1494 | 1497 | * the dir and file as the name implies if image does not exist it will |
| 1495 | 1498 | * return the unknow image if anonymous parameter is true if not it returns an empty array |
| 1496 | 1499 | */ |
@@ -1982,7 +1985,7 @@ discard block |
||
| 1982 | 1985 | /** |
| 1983 | 1986 | * Returns an array with the user's productions. |
| 1984 | 1987 | * |
| 1985 | - * @param $user_id User id |
|
| 1988 | + * @param integer $user_id User id |
|
| 1986 | 1989 | * @return array An array containing the user's productions |
| 1987 | 1990 | */ |
| 1988 | 1991 | public static function get_user_productions($user_id) |
@@ -2137,7 +2140,7 @@ discard block |
||
| 2137 | 2140 | |
| 2138 | 2141 | /** |
| 2139 | 2142 | * Build a list of extra file already uploaded in $user_folder/{$extra_field}/ |
| 2140 | - * @param $user_id |
|
| 2143 | + * @param integer $user_id |
|
| 2141 | 2144 | * @param $extra_field |
| 2142 | 2145 | * @param bool $force |
| 2143 | 2146 | * @param bool $showDelete |
@@ -2242,7 +2245,7 @@ discard block |
||
| 2242 | 2245 | * @param int $fieldType Field's type |
| 2243 | 2246 | * @param string $displayText Field's language var name |
| 2244 | 2247 | * @param string $default Field's default value |
| 2245 | - * @return int |
|
| 2248 | + * @return boolean |
|
| 2246 | 2249 | */ |
| 2247 | 2250 | public static function create_extra_field($variable, $fieldType, $displayText, $default) |
| 2248 | 2251 | { |
@@ -2276,6 +2279,7 @@ discard block |
||
| 2276 | 2279 | * @param boolean Whether to prefix the fields indexes with "extra_" (might be used by formvalidator) |
| 2277 | 2280 | * @param boolean Whether to return invisible fields as well |
| 2278 | 2281 | * @param boolean Whether to split multiple-selection fields or not |
| 2282 | + * @param boolean $field_filter |
|
| 2279 | 2283 | * @return array Array of fields => value for the given user |
| 2280 | 2284 | */ |
| 2281 | 2285 | public static function get_extra_user_data( |
@@ -2550,6 +2554,7 @@ discard block |
||
| 2550 | 2554 | /** |
| 2551 | 2555 | * Get extra user data by field variable |
| 2552 | 2556 | * @param string field variable |
| 2557 | + * @param string $field_variable |
|
| 2553 | 2558 | * @return array data |
| 2554 | 2559 | */ |
| 2555 | 2560 | public static function get_extra_user_data_by_field_variable($field_variable) |
@@ -3119,7 +3124,7 @@ discard block |
||
| 3119 | 3124 | * @param string $user_id User ID |
| 3120 | 3125 | * @param string $course course directory |
| 3121 | 3126 | * @param string $resourcetype resourcetype: images, all |
| 3122 | - * @return int User ID (or false if not found) |
|
| 3127 | + * @return string User ID (or false if not found) |
|
| 3123 | 3128 | */ |
| 3124 | 3129 | public static function get_user_upload_files_by_course($user_id, $course, $resourcetype = 'all') |
| 3125 | 3130 | { |
@@ -3203,7 +3208,7 @@ discard block |
||
| 3203 | 3208 | /** |
| 3204 | 3209 | * Adds a new API key to the users' account |
| 3205 | 3210 | * @param int Optional user ID (defaults to the results of api_get_user_id()) |
| 3206 | - * @return boolean True on success, false on failure |
|
| 3211 | + * @return false|string True on success, false on failure |
|
| 3207 | 3212 | */ |
| 3208 | 3213 | public static function add_api_key($user_id = null, $api_service = 'dokeos') |
| 3209 | 3214 | { |
@@ -3258,6 +3263,7 @@ discard block |
||
| 3258 | 3263 | * Regenerate an API key from the user's account |
| 3259 | 3264 | * @param int user ID (defaults to the results of api_get_user_id()) |
| 3260 | 3265 | * @param string API key's internal ID |
| 3266 | + * @param string $api_service |
|
| 3261 | 3267 | * @return int num |
| 3262 | 3268 | */ |
| 3263 | 3269 | public static function update_api_key($user_id, $api_service) |
@@ -3287,6 +3293,7 @@ discard block |
||
| 3287 | 3293 | /** |
| 3288 | 3294 | * @param int user ID (defaults to the results of api_get_user_id()) |
| 3289 | 3295 | * @param string API key's internal ID |
| 3296 | + * @param string $api_service |
|
| 3290 | 3297 | * @return int row ID, or return false if not found |
| 3291 | 3298 | */ |
| 3292 | 3299 | public static function get_api_key_id($user_id, $api_service) |
@@ -3502,7 +3509,7 @@ discard block |
||
| 3502 | 3509 | * @param int $field_id |
| 3503 | 3510 | * @param bool $show_links show links or not |
| 3504 | 3511 | * |
| 3505 | - * @return array |
|
| 3512 | + * @return string |
|
| 3506 | 3513 | */ |
| 3507 | 3514 | public static function get_user_tags_to_string($user_id, $field_id, $show_links = true) |
| 3508 | 3515 | { |
@@ -3599,7 +3606,7 @@ discard block |
||
| 3599 | 3606 | * @param mixed $tag |
| 3600 | 3607 | * @param int $user_id |
| 3601 | 3608 | * @param int $field_id field id of the tag |
| 3602 | - * @return bool |
|
| 3609 | + * @return boolean|null |
|
| 3603 | 3610 | */ |
| 3604 | 3611 | public static function add_tag($tag, $user_id, $field_id) |
| 3605 | 3612 | { |
@@ -5045,7 +5052,7 @@ discard block |
||
| 5045 | 5052 | } |
| 5046 | 5053 | |
| 5047 | 5054 | /** |
| 5048 | - * @return array |
|
| 5055 | + * @return string[] |
|
| 5049 | 5056 | */ |
| 5050 | 5057 | public static function get_user_field_types() |
| 5051 | 5058 | { |
@@ -5337,7 +5344,7 @@ discard block |
||
| 5337 | 5344 | |
| 5338 | 5345 | /** |
| 5339 | 5346 | * Get the boss user ID from a followed user id |
| 5340 | - * @param $userId |
|
| 5347 | + * @param integer $userId |
|
| 5341 | 5348 | * @return bool |
| 5342 | 5349 | */ |
| 5343 | 5350 | public static function getStudentBossList($userId) |
@@ -5389,7 +5396,7 @@ discard block |
||
| 5389 | 5396 | * Get either a Gravatar URL or complete image tag for a specified email address. |
| 5390 | 5397 | * |
| 5391 | 5398 | * @param string $email The email address |
| 5392 | - * @param string $s Size in pixels, defaults to 80px [ 1 - 2048 ] |
|
| 5399 | + * @param integer $s Size in pixels, defaults to 80px [ 1 - 2048 ] |
|
| 5393 | 5400 | * @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ] |
| 5394 | 5401 | * @param string $r Maximum rating (inclusive) [ g | pg | r | x ] |
| 5395 | 5402 | * @param boole $img True to return a complete IMG tag False for just the URL |
@@ -5755,9 +5762,9 @@ discard block |
||
| 5755 | 5762 | * @param bool $get_count |
| 5756 | 5763 | * @param bool $reverse_order |
| 5757 | 5764 | * @param int $start |
| 5758 | - * @param null $maxPerPage |
|
| 5765 | + * @param integer $maxPerPage |
|
| 5759 | 5766 | * @param null $categoryFilter |
| 5760 | - * @return array |
|
| 5767 | + * @return integer |
|
| 5761 | 5768 | */ |
| 5762 | 5769 | public static function getCategories( |
| 5763 | 5770 | $user_id, |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | const USER_FIELD_TYPE_TIMEZONE = 11; |
| 37 | 37 | const USER_FIELD_TYPE_SOCIAL_PROFILE = 12; |
| 38 | 38 | const USER_FIELD_TYPE_FILE = 13; |
| 39 | - const USER_FIELD_TYPE_MOBILE_PHONE_NUMBER = 14; |
|
| 39 | + const USER_FIELD_TYPE_MOBILE_PHONE_NUMBER = 14; |
|
| 40 | 40 | |
| 41 | 41 | private static $encryptionMethod; |
| 42 | 42 | |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | $res = Database::query($sql); |
| 555 | 555 | while ($course = Database::fetch_object($res)) { |
| 556 | 556 | $sql = "SELECT id FROM $table_course_user |
| 557 | - WHERE status=1 AND c_id = " . intval($course->c_id); |
|
| 557 | + WHERE status=1 AND c_id = ".intval($course->c_id); |
|
| 558 | 558 | $res2 = Database::query($sql); |
| 559 | 559 | if (Database::num_rows($res2) == 1) { |
| 560 | 560 | |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | // into ASCII letters in order they not to be totally removed. |
| 1264 | 1264 | // 2. Applying the strict purifier. |
| 1265 | 1265 | // 3. Length limitation. |
| 1266 | - $return = api_get_setting('login_is_email') === 'true' ? substr(preg_replace(USERNAME_PURIFIER_MAIL, '', $username), 0, USERNAME_MAX_LENGTH) : substr(preg_replace(USERNAME_PURIFIER, '', $username), 0, USERNAME_MAX_LENGTH); |
|
| 1266 | + $return = api_get_setting('login_is_email') === 'true' ? substr(preg_replace(USERNAME_PURIFIER_MAIL, '', $username), 0, USERNAME_MAX_LENGTH) : substr(preg_replace(USERNAME_PURIFIER, '', $username), 0, USERNAME_MAX_LENGTH); |
|
| 1267 | 1267 | $return = URLify::transliterate($return); |
| 1268 | 1268 | |
| 1269 | 1269 | return $return; |
@@ -1357,12 +1357,12 @@ discard block |
||
| 1357 | 1357 | |
| 1358 | 1358 | if (!is_null($order)) { |
| 1359 | 1359 | $order = Database::escape_string($order); |
| 1360 | - $sql .= ' ORDER BY ' . $order; |
|
| 1360 | + $sql .= ' ORDER BY '.$order; |
|
| 1361 | 1361 | } |
| 1362 | 1362 | |
| 1363 | 1363 | if (!is_null($limit)) { |
| 1364 | 1364 | $limit = Database::escape_string($limit); |
| 1365 | - $sql .= ' LIMIT ' . $limit; |
|
| 1365 | + $sql .= ' LIMIT '.$limit; |
|
| 1366 | 1366 | } |
| 1367 | 1367 | |
| 1368 | 1368 | $rs = Database::query($sql); |
@@ -1456,11 +1456,11 @@ discard block |
||
| 1456 | 1456 | } |
| 1457 | 1457 | |
| 1458 | 1458 | if (api_is_multiple_url_enabled()) { |
| 1459 | - $sql_query .= ' AND auru.access_url_id = ' . api_get_current_access_url_id(); |
|
| 1459 | + $sql_query .= ' AND auru.access_url_id = '.api_get_current_access_url_id(); |
|
| 1460 | 1460 | } |
| 1461 | 1461 | } else { |
| 1462 | 1462 | if (api_is_multiple_url_enabled()) { |
| 1463 | - $sql_query .= ' WHERE auru.access_url_id = ' . api_get_current_access_url_id(); |
|
| 1463 | + $sql_query .= ' WHERE auru.access_url_id = '.api_get_current_access_url_id(); |
|
| 1464 | 1464 | } |
| 1465 | 1465 | } |
| 1466 | 1466 | if (count($order_by) > 0) { |
@@ -1636,7 +1636,7 @@ discard block |
||
| 1636 | 1636 | // directory might not have been created. Make sure it is before |
| 1637 | 1637 | // going further. |
| 1638 | 1638 | |
| 1639 | - $rootPath = api_get_path(SYS_UPLOAD_PATH) . 'users/' . substr((string) $id, 0, 1); |
|
| 1639 | + $rootPath = api_get_path(SYS_UPLOAD_PATH).'users/'.substr((string) $id, 0, 1); |
|
| 1640 | 1640 | if (!is_dir($rootPath)) { |
| 1641 | 1641 | $perm = api_get_permissions_for_new_directories(); |
| 1642 | 1642 | try { |
@@ -1899,7 +1899,7 @@ discard block |
||
| 1899 | 1899 | $path_info = self::get_user_picture_path_by_id($user_id, 'system'); |
| 1900 | 1900 | $path = $path_info['dir']; |
| 1901 | 1901 | if (!empty($extra_field)) { |
| 1902 | - $path .= $extra_field . '/'; |
|
| 1902 | + $path .= $extra_field.'/'; |
|
| 1903 | 1903 | } |
| 1904 | 1904 | // If this directory does not exist - we create it. |
| 1905 | 1905 | if (!file_exists($path)) { |
@@ -2163,10 +2163,10 @@ discard block |
||
| 2163 | 2163 | if (count($extra_files) > 0) { |
| 2164 | 2164 | $extra_file_list = '<div class="files-production"><ul id="productions">'; |
| 2165 | 2165 | foreach ($extra_files as $file) { |
| 2166 | - $filename = substr($file,strlen($extra_field)+1); |
|
| 2166 | + $filename = substr($file, strlen($extra_field) + 1); |
|
| 2167 | 2167 | $extra_file_list .= '<li>'.Display::return_icon('archive.png').'<a href="'.$path.$extra_field.'/'.urlencode($filename).'" target="_blank">'.htmlentities($filename).'</a> '; |
| 2168 | 2168 | if ($showDelete) { |
| 2169 | - $extra_file_list .= '<input style="width:16px;" type="image" name="remove_extra_' . $extra_field . '['.urlencode($file).']" src="'.$del_image.'" alt="'.$del_text.'" title="'.$del_text.' '.htmlentities($filename).'" onclick="javascript: return confirmation(\''.htmlentities($filename).'\');" /></li>'; |
|
| 2169 | + $extra_file_list .= '<input style="width:16px;" type="image" name="remove_extra_'.$extra_field.'['.urlencode($file).']" src="'.$del_image.'" alt="'.$del_text.'" title="'.$del_text.' '.htmlentities($filename).'" onclick="javascript: return confirmation(\''.htmlentities($filename).'\');" /></li>'; |
|
| 2170 | 2170 | } |
| 2171 | 2171 | } |
| 2172 | 2172 | $extra_file_list .= '</ul></div>'; |
@@ -2808,7 +2808,7 @@ discard block |
||
| 2808 | 2808 | |
| 2809 | 2809 | if (api_is_allowed_to_create_course()) { |
| 2810 | 2810 | $sessionListFromCourseCoach = array(); |
| 2811 | - $sql =" SELECT DISTINCT session_id |
|
| 2811 | + $sql = " SELECT DISTINCT session_id |
|
| 2812 | 2812 | FROM $tbl_session_course_user |
| 2813 | 2813 | WHERE user_id = $user_id AND status = 2 "; |
| 2814 | 2814 | |
@@ -2816,7 +2816,7 @@ discard block |
||
| 2816 | 2816 | if (Database::num_rows($result)) { |
| 2817 | 2817 | $result = Database::store_result($result); |
| 2818 | 2818 | foreach ($result as $session) { |
| 2819 | - $sessionListFromCourseCoach[]= $session['session_id']; |
|
| 2819 | + $sessionListFromCourseCoach[] = $session['session_id']; |
|
| 2820 | 2820 | } |
| 2821 | 2821 | } |
| 2822 | 2822 | if (!empty($sessionListFromCourseCoach)) { |
@@ -2848,7 +2848,7 @@ discard block |
||
| 2848 | 2848 | "; |
| 2849 | 2849 | |
| 2850 | 2850 | $result = Database::query($sql); |
| 2851 | - if (Database::num_rows($result)>0) { |
|
| 2851 | + if (Database::num_rows($result) > 0) { |
|
| 2852 | 2852 | while ($row = Database::fetch_assoc($result)) { |
| 2853 | 2853 | $sessions[$row['id']] = $row; |
| 2854 | 2854 | } |
@@ -2864,7 +2864,7 @@ discard block |
||
| 2864 | 2864 | ORDER BY access_start_date, access_end_date, name"; |
| 2865 | 2865 | |
| 2866 | 2866 | $result = Database::query($sql); |
| 2867 | - if (Database::num_rows($result)>0) { |
|
| 2867 | + if (Database::num_rows($result) > 0) { |
|
| 2868 | 2868 | while ($row = Database::fetch_assoc($result)) { |
| 2869 | 2869 | if (empty($sessions[$row['id']])) { |
| 2870 | 2870 | $sessions[$row['id']] = $row; |
@@ -3869,13 +3869,13 @@ discard block |
||
| 3869 | 3869 | $useExtraFields = false; |
| 3870 | 3870 | $extraFields = UserManager::get_extra_filtrable_fields(); |
| 3871 | 3871 | $extraFieldResult = array(); |
| 3872 | - if (is_array($extraFields) && count($extraFields)>0 ) { |
|
| 3872 | + if (is_array($extraFields) && count($extraFields) > 0) { |
|
| 3873 | 3873 | foreach ($extraFields as $extraField) { |
| 3874 | 3874 | $varName = 'field_'.$extraField['variable']; |
| 3875 | 3875 | if (UserManager::is_extra_field_available($extraField['variable'])) { |
| 3876 | - if (isset($_GET[$varName]) && $_GET[$varName]!='0') { |
|
| 3876 | + if (isset($_GET[$varName]) && $_GET[$varName] != '0') { |
|
| 3877 | 3877 | $useExtraFields = true; |
| 3878 | - $extraFieldResult[]= UserManager::get_extra_user_data_by_value( |
|
| 3878 | + $extraFieldResult[] = UserManager::get_extra_user_data_by_value( |
|
| 3879 | 3879 | $extraField['variable'], |
| 3880 | 3880 | $_GET[$varName] |
| 3881 | 3881 | ); |
@@ -3886,17 +3886,17 @@ discard block |
||
| 3886 | 3886 | |
| 3887 | 3887 | if ($useExtraFields) { |
| 3888 | 3888 | $finalResult = array(); |
| 3889 | - if (count($extraFieldResult)>1) { |
|
| 3890 | - for ($i=0; $i < count($extraFieldResult) -1; $i++) { |
|
| 3891 | - if (is_array($extraFieldResult[$i]) && is_array($extraFieldResult[$i+1])) { |
|
| 3892 | - $finalResult = array_intersect($extraFieldResult[$i], $extraFieldResult[$i+1]); |
|
| 3889 | + if (count($extraFieldResult) > 1) { |
|
| 3890 | + for ($i = 0; $i < count($extraFieldResult) - 1; $i++) { |
|
| 3891 | + if (is_array($extraFieldResult[$i]) && is_array($extraFieldResult[$i + 1])) { |
|
| 3892 | + $finalResult = array_intersect($extraFieldResult[$i], $extraFieldResult[$i + 1]); |
|
| 3893 | 3893 | } |
| 3894 | 3894 | } |
| 3895 | 3895 | } else { |
| 3896 | 3896 | $finalResult = $extraFieldResult[0]; |
| 3897 | 3897 | } |
| 3898 | 3898 | |
| 3899 | - if (is_array($finalResult) && count($finalResult)>0) { |
|
| 3899 | + if (is_array($finalResult) && count($finalResult) > 0) { |
|
| 3900 | 3900 | $whereFilter = " AND u.id IN ('".implode("','", $finalResult)."') "; |
| 3901 | 3901 | } else { |
| 3902 | 3902 | //no results |
@@ -4073,7 +4073,7 @@ discard block |
||
| 4073 | 4073 | $sql = 'DELETE FROM '.$tbl_my_friend.' |
| 4074 | 4074 | WHERE relation_type <> '.USER_RELATION_TYPE_RRHH.' AND friend_user_id='.$friend_id.' '.$extra_condition; |
| 4075 | 4075 | Database::query($sql); |
| 4076 | - $sql= 'DELETE FROM '.$tbl_my_friend.' |
|
| 4076 | + $sql = 'DELETE FROM '.$tbl_my_friend.' |
|
| 4077 | 4077 | WHERE relation_type <> '.USER_RELATION_TYPE_RRHH.' AND user_id='.$friend_id.' '.$extra_condition; |
| 4078 | 4078 | Database::query($sql); |
| 4079 | 4079 | } else { |
@@ -4274,7 +4274,7 @@ discard block |
||
| 4274 | 4274 | |
| 4275 | 4275 | if (!empty($lastConnectionDate)) { |
| 4276 | 4276 | $lastConnectionDate = Database::escape_string($lastConnectionDate); |
| 4277 | - $userConditions .= " AND u.last_login <= '$lastConnectionDate' "; |
|
| 4277 | + $userConditions .= " AND u.last_login <= '$lastConnectionDate' "; |
|
| 4278 | 4278 | } |
| 4279 | 4279 | |
| 4280 | 4280 | $courseConditions = null; |
@@ -4342,7 +4342,7 @@ discard block |
||
| 4342 | 4342 | ; |
| 4343 | 4343 | break; |
| 4344 | 4344 | case STUDENT_BOSS: |
| 4345 | - $drhConditions = " AND friend_user_id = $userId AND relation_type = " . USER_RELATION_TYPE_BOSS; |
|
| 4345 | + $drhConditions = " AND friend_user_id = $userId AND relation_type = ".USER_RELATION_TYPE_BOSS; |
|
| 4346 | 4346 | break; |
| 4347 | 4347 | } |
| 4348 | 4348 | |
@@ -4437,7 +4437,7 @@ discard block |
||
| 4437 | 4437 | WHERE |
| 4438 | 4438 | friend_user_id = $userId AND |
| 4439 | 4439 | relation_type = $relationType AND |
| 4440 | - access_url_id = " . api_get_current_access_url_id(); |
|
| 4440 | + access_url_id = ".api_get_current_access_url_id(); |
|
| 4441 | 4441 | } else { |
| 4442 | 4442 | $sql = "SELECT user_id FROM $userRelUserTable |
| 4443 | 4443 | WHERE friend_user_id = $userId |
@@ -4722,7 +4722,7 @@ discard block |
||
| 4722 | 4722 | if (empty($years)) { |
| 4723 | 4723 | $years = 1; |
| 4724 | 4724 | } |
| 4725 | - $inactive_time = $years * 31536000; //1 year |
|
| 4725 | + $inactive_time = $years * 31536000; //1 year |
|
| 4726 | 4726 | $rs = Database::query($sql); |
| 4727 | 4727 | if (Database::num_rows($rs) > 0) { |
| 4728 | 4728 | if ($last_login_date = Database::result($rs, 0, 0)) { |
@@ -4856,7 +4856,7 @@ discard block |
||
| 4856 | 4856 | 'extra_'.$field_details[1], |
| 4857 | 4857 | $field_details[3], |
| 4858 | 4858 | $options, |
| 4859 | - array('id' => 'extra_' . $field_details[1]) |
|
| 4859 | + array('id' => 'extra_'.$field_details[1]) |
|
| 4860 | 4860 | ); |
| 4861 | 4861 | |
| 4862 | 4862 | if (!$admin_permissions) { |
@@ -5010,7 +5010,7 @@ discard block |
||
| 5010 | 5010 | $extra_field = 'extra_'.$field_details[1]; |
| 5011 | 5011 | $form->addElement('file', $extra_field, $field_details[3], null, ''); |
| 5012 | 5012 | if ($extra_file_list = UserManager::build_user_extra_file_list($user_id, $field_details[1], '', true)) { |
| 5013 | - $form->addElement('static', $extra_field . '_list', null, $extra_file_list); |
|
| 5013 | + $form->addElement('static', $extra_field.'_list', null, $extra_file_list); |
|
| 5014 | 5014 | } |
| 5015 | 5015 | if ($field_details[7] == 0) { |
| 5016 | 5016 | $form->freeze($extra_field); |
@@ -5182,7 +5182,7 @@ discard block |
||
| 5182 | 5182 | $direction = null, |
| 5183 | 5183 | $active = null, |
| 5184 | 5184 | $lastConnectionDate = null |
| 5185 | - ){ |
|
| 5185 | + ) { |
|
| 5186 | 5186 | return self::getUsersFollowedByUser( |
| 5187 | 5187 | $userId, |
| 5188 | 5188 | $userStatus, |
@@ -5409,12 +5409,12 @@ discard block |
||
| 5409 | 5409 | if (!empty($_SERVER['HTTPS'])) { |
| 5410 | 5410 | $url = 'https://secure.gravatar.com/avatar/'; |
| 5411 | 5411 | } |
| 5412 | - $url .= md5( strtolower( trim( $email ) ) ); |
|
| 5412 | + $url .= md5(strtolower(trim($email))); |
|
| 5413 | 5413 | $url .= "?s=$s&d=$d&r=$r"; |
| 5414 | - if ( $img ) { |
|
| 5415 | - $url = '<img src="' . $url . '"'; |
|
| 5416 | - foreach ( $atts as $key => $val ) |
|
| 5417 | - $url .= ' ' . $key . '="' . $val . '"'; |
|
| 5414 | + if ($img) { |
|
| 5415 | + $url = '<img src="'.$url.'"'; |
|
| 5416 | + foreach ($atts as $key => $val) |
|
| 5417 | + $url .= ' '.$key.'="'.$val.'"'; |
|
| 5418 | 5418 | $url .= ' />'; |
| 5419 | 5419 | } |
| 5420 | 5420 | return $url; |
@@ -5537,7 +5537,7 @@ discard block |
||
| 5537 | 5537 | $access_url_id = api_get_current_access_url_id(); |
| 5538 | 5538 | $time_limit = api_get_setting('display.time_limit_whosonline'); |
| 5539 | 5539 | |
| 5540 | - $online_time = time() - $time_limit*60; |
|
| 5540 | + $online_time = time() - $time_limit * 60; |
|
| 5541 | 5541 | $limit_date = api_get_utc_datetime($online_time); |
| 5542 | 5542 | $user_id = intval($user_id); |
| 5543 | 5543 | |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $content = '<div class="help">'; |
| 281 | 281 | $content .= Display::url( |
| 282 | 282 | Display::return_icon('help.large.png', get_lang('Help')), |
| 283 | - api_get_path(WEB_CODE_PATH) . 'help/help.php?open=' . $help, |
|
| 283 | + api_get_path(WEB_CODE_PATH).'help/help.php?open='.$help, |
|
| 284 | 284 | [ |
| 285 | 285 | 'class' => 'ajax', |
| 286 | 286 | 'data-title' => get_lang('Help') |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | 'web_course' => api_get_path(WEB_COURSE_PATH), |
| 495 | 495 | 'web_main' => api_get_path(WEB_CODE_PATH), |
| 496 | 496 | 'web_css' => api_get_path(WEB_CSS_PATH), |
| 497 | - 'web_css_theme' => api_get_path(WEB_CSS_PATH) . 'themes/' . $this->theme . '/', |
|
| 497 | + 'web_css_theme' => api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/', |
|
| 498 | 498 | 'web_ajax' => api_get_path(WEB_AJAX_PATH), |
| 499 | 499 | 'web_img' => api_get_path(WEB_IMG_PATH), |
| 500 | 500 | 'web_plugin' => api_get_path(WEB_PLUGIN_PATH), |
@@ -551,12 +551,12 @@ discard block |
||
| 551 | 551 | foreach ($bowerCSSFiles as $file) { |
| 552 | 552 | $css[] = api_get_path(WEB_PATH).'web/assets/'.$file; |
| 553 | 553 | } |
| 554 | - $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/bootstrap-select/css/bootstrap-select.min.css'; |
|
| 555 | - $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chosen/chosen.css'; |
|
| 556 | - $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/tag/style.css'; |
|
| 554 | + $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/bootstrap-select/css/bootstrap-select.min.css'; |
|
| 555 | + $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/chosen/chosen.css'; |
|
| 556 | + $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/tag/style.css'; |
|
| 557 | 557 | |
| 558 | 558 | if (api_is_global_chat_enabled()) { |
| 559 | - $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chat/css/chat.css'; |
|
| 559 | + $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/chat/css/chat.css'; |
|
| 560 | 560 | } |
| 561 | 561 | |
| 562 | 562 | //THEME CSS STYLE |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | |
| 607 | 607 | if (is_file(api_get_path(SYS_CSS_PATH).'themes/'.$this->theme.'/editor.css')) { |
| 608 | 608 | $css[] = api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/editor.css'; |
| 609 | - }else{ |
|
| 609 | + } else { |
|
| 610 | 610 | $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'editor.css'); |
| 611 | 611 | } |
| 612 | 612 | |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | $style_print = ''; |
| 643 | 643 | if (is_readable(api_get_path(SYS_CSS_PATH).$this->theme.'/print.css')) { |
| 644 | - $style_print = api_get_css(api_get_cdn_path(api_get_path(WEB_CSS_PATH) . $this->theme . '/print.css'), |
|
| 644 | + $style_print = api_get_css(api_get_cdn_path(api_get_path(WEB_CSS_PATH).$this->theme.'/print.css'), |
|
| 645 | 645 | 'print'); |
| 646 | 646 | } |
| 647 | 647 | $this->assign('css_style_print', $style_print); |
@@ -664,10 +664,10 @@ discard block |
||
| 664 | 664 | |
| 665 | 665 | $isoCode = api_get_language_isocode(); |
| 666 | 666 | |
| 667 | - $selectLink = 'bootstrap-select/js/i18n/defaults-' . $isoCode . '_' . strtoupper($isoCode) . '.min.js'; |
|
| 667 | + $selectLink = 'bootstrap-select/js/i18n/defaults-'.$isoCode.'_'.strtoupper($isoCode).'.min.js'; |
|
| 668 | 668 | |
| 669 | 669 | if ($isoCode == 'en') { |
| 670 | - $selectLink = 'bootstrap-select/js/i18n/defaults-' . $isoCode . '_US.min.js'; |
|
| 670 | + $selectLink = 'bootstrap-select/js/i18n/defaults-'.$isoCode.'_US.min.js'; |
|
| 671 | 671 | } |
| 672 | 672 | // JS files |
| 673 | 673 | $js_files = array( |
@@ -720,8 +720,8 @@ discard block |
||
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | if ($isoCode != 'en') { |
| 723 | - $bowerJsFiles[] = 'jqueryui-timepicker-addon/dist/i18n/jquery-ui-timepicker-' . $isoCode . '.js'; |
|
| 724 | - $bowerJsFiles[] = 'jquery-ui/ui/minified/i18n/datepicker-' . $isoCode . '.min.js'; |
|
| 723 | + $bowerJsFiles[] = 'jqueryui-timepicker-addon/dist/i18n/jquery-ui-timepicker-'.$isoCode.'.js'; |
|
| 724 | + $bowerJsFiles[] = 'jquery-ui/ui/minified/i18n/datepicker-'.$isoCode.'.min.js'; |
|
| 725 | 725 | } |
| 726 | 726 | |
| 727 | 727 | foreach ($bowerJsFiles as $file) { |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | $this->assign('online_button', Display::return_icon('statusonline.png', null, null, ICON_SIZE_ATOM)); |
| 807 | - $this->assign('offline_button',Display::return_icon('statusoffline.png', null, null, ICON_SIZE_ATOM)); |
|
| 807 | + $this->assign('offline_button', Display::return_icon('statusoffline.png', null, null, ICON_SIZE_ATOM)); |
|
| 808 | 808 | |
| 809 | 809 | // Get language iso-code for this page - ignore errors |
| 810 | 810 | $this->assign('document_language', api_get_language_isocode()); |
@@ -863,14 +863,14 @@ discard block |
||
| 863 | 863 | $this->assign('section_name', 'section-'.$this_section); |
| 864 | 864 | |
| 865 | 865 | //Defaul root chamilo favicon |
| 866 | - $favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_PATH) . 'favicon.ico" type="image/x-icon" />'; |
|
| 866 | + $favico = '<link rel="shortcut icon" href="'.api_get_path(WEB_PATH).'favicon.ico" type="image/x-icon" />'; |
|
| 867 | 867 | |
| 868 | 868 | //Added to verify if in the current Chamilo Theme exist a favicon |
| 869 | - $favicoThemeUrl = api_get_path(SYS_CSS_PATH) . 'themes/' . $this->theme . '/images/'; |
|
| 869 | + $favicoThemeUrl = api_get_path(SYS_CSS_PATH).'themes/'.$this->theme.'/images/'; |
|
| 870 | 870 | |
| 871 | 871 | //If exist pick the current chamilo theme favicon |
| 872 | - if (is_file($favicoThemeUrl . 'favicon.ico')) { |
|
| 873 | - $favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_CSS_PATH). 'themes/' . $this->theme . '/images/favicon.ico" type="image/x-icon" />'; |
|
| 872 | + if (is_file($favicoThemeUrl.'favicon.ico')) { |
|
| 873 | + $favico = '<link rel="shortcut icon" href="'.api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/images/favicon.ico" type="image/x-icon" />'; |
|
| 874 | 874 | } |
| 875 | 875 | |
| 876 | 876 | if (api_is_multiple_url_enabled()) { |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | if (api_get_setting('show_link_bug_notification') == 'true' && $this->user_is_logged_in) { |
| 901 | 901 | $rightFloatMenu = '<div class="report"> |
| 902 | 902 | <a href="https://github.com/chamilo/chamilo-lms/wiki/How-to-report-issues" target="_blank"> |
| 903 | - '. $iconBug . ' |
|
| 903 | + '. $iconBug.' |
|
| 904 | 904 | </a> |
| 905 | 905 | </div>'; |
| 906 | 906 | } |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | $url = api_get_path(WEB_CODE_PATH).'ticket/tickets.php?project_id=1&'.$courseParams; |
| 917 | 917 | $rightFloatMenu .= '<div class="report"> |
| 918 | 918 | <a href="'.$url.'" target="_blank"> |
| 919 | - '. $iconTicket . ' |
|
| 919 | + '. $iconTicket.' |
|
| 920 | 920 | </a> |
| 921 | 921 | </div>'; |
| 922 | 922 | } |
@@ -1023,7 +1023,7 @@ discard block |
||
| 1023 | 1023 | |
| 1024 | 1024 | // Block Breadcrumb |
| 1025 | 1025 | //$breadcrumb = return_breadcrumb($interbreadcrumb, $language_file, $nameTools); |
| 1026 | - $breadcrumb = ''; |
|
| 1026 | + $breadcrumb = ''; |
|
| 1027 | 1027 | $this->assign('breadcrumb', $breadcrumb); |
| 1028 | 1028 | |
| 1029 | 1029 | //Extra content |
@@ -1043,13 +1043,13 @@ discard block |
||
| 1043 | 1043 | $socialMeta = ''; |
| 1044 | 1044 | $metaTitle = api_get_setting('meta_title'); |
| 1045 | 1045 | if (!empty($metaTitle)) { |
| 1046 | - $socialMeta .= '<meta name="twitter:card" content="summary" />' . "\n"; |
|
| 1046 | + $socialMeta .= '<meta name="twitter:card" content="summary" />'."\n"; |
|
| 1047 | 1047 | $metaSite = api_get_setting('meta_twitter_site'); |
| 1048 | 1048 | if (!empty($metaSite)) { |
| 1049 | - $socialMeta .= '<meta name="twitter:site" content="' . $metaSite . '" />' . "\n"; |
|
| 1049 | + $socialMeta .= '<meta name="twitter:site" content="'.$metaSite.'" />'."\n"; |
|
| 1050 | 1050 | $metaCreator = api_get_setting('meta_twitter_creator'); |
| 1051 | 1051 | if (!empty($metaCreator)) { |
| 1052 | - $socialMeta .= '<meta name="twitter:creator" content="' . $metaCreator . '" />' . "\n"; |
|
| 1052 | + $socialMeta .= '<meta name="twitter:creator" content="'.$metaCreator.'" />'."\n"; |
|
| 1053 | 1053 | } |
| 1054 | 1054 | } |
| 1055 | 1055 | |
@@ -1061,19 +1061,19 @@ discard block |
||
| 1061 | 1061 | if (!$userId && !$skillId) { |
| 1062 | 1062 | // no combination of user and skill ID has been defined, |
| 1063 | 1063 | // so print the normal OpenGraph meta tags |
| 1064 | - $socialMeta .= '<meta property="og:title" content="' . $metaTitle . '" />' . "\n"; |
|
| 1065 | - $socialMeta .= '<meta property="og:url" content="' . api_get_path(WEB_PATH) . '" />' . "\n"; |
|
| 1064 | + $socialMeta .= '<meta property="og:title" content="'.$metaTitle.'" />'."\n"; |
|
| 1065 | + $socialMeta .= '<meta property="og:url" content="'.api_get_path(WEB_PATH).'" />'."\n"; |
|
| 1066 | 1066 | |
| 1067 | 1067 | $metaDescription = api_get_setting('meta_description'); |
| 1068 | 1068 | if (!empty($metaDescription)) { |
| 1069 | - $socialMeta .= '<meta property="og:description" content="' . $metaDescription . '" />' . "\n"; |
|
| 1069 | + $socialMeta .= '<meta property="og:description" content="'.$metaDescription.'" />'."\n"; |
|
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | 1072 | $metaImage = api_get_setting('meta_image_path'); |
| 1073 | 1073 | if (!empty($metaImage)) { |
| 1074 | - if (is_file(api_get_path(SYS_PATH) . $metaImage)) { |
|
| 1075 | - $path = api_get_path(WEB_PATH) . $metaImage; |
|
| 1076 | - $socialMeta .= '<meta property="og:image" content="' . $path . '" />' . "\n"; |
|
| 1074 | + if (is_file(api_get_path(SYS_PATH).$metaImage)) { |
|
| 1075 | + $path = api_get_path(WEB_PATH).$metaImage; |
|
| 1076 | + $socialMeta .= '<meta property="og:image" content="'.$path.'" />'."\n"; |
|
| 1077 | 1077 | } |
| 1078 | 1078 | } |
| 1079 | 1079 | } |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | // Tutor name |
| 1108 | 1108 | if (api_get_setting('show_tutor_data') == 'true') { |
| 1109 | 1109 | // Course manager |
| 1110 | - $courseId = api_get_course_int_id(); |
|
| 1110 | + $courseId = api_get_course_int_id(); |
|
| 1111 | 1111 | $id_session = api_get_session_id(); |
| 1112 | 1112 | if (!empty($courseId)) { |
| 1113 | 1113 | $tutor_data = ''; |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | $courseId = api_get_course_int_id(); |
| 1140 | 1140 | if (!empty($courseId)) { |
| 1141 | 1141 | $teacher_data = ''; |
| 1142 | - $mail= CourseManager::get_emails_of_tutors_to_course($courseId); |
|
| 1142 | + $mail = CourseManager::get_emails_of_tutors_to_course($courseId); |
|
| 1143 | 1143 | if (!empty($mail)) { |
| 1144 | 1144 | $teachers_parsed = array(); |
| 1145 | 1145 | foreach ($mail as $value) { |
@@ -1407,7 +1407,7 @@ discard block |
||
| 1407 | 1407 | 'sessionVar' => basename(__FILE__, '.php'), |
| 1408 | 1408 | 'imageOptions' => array( |
| 1409 | 1409 | 'font_size' => 20, |
| 1410 | - 'font_path' => api_get_path(SYS_FONTS_PATH) . 'opensans/', |
|
| 1410 | + 'font_path' => api_get_path(SYS_FONTS_PATH).'opensans/', |
|
| 1411 | 1411 | 'font_file' => 'OpenSans-Regular.ttf', |
| 1412 | 1412 | //'output' => 'gif' |
| 1413 | 1413 | ) |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | // My Profile |
| 54 | - $navigation['myprofile']['url'] = api_get_path(WEB_CODE_PATH).'auth/profile.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&courseCode='.$_course['official_code'] : '' ); |
|
| 54 | + $navigation['myprofile']['url'] = api_get_path(WEB_CODE_PATH).'auth/profile.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&courseCode='.$_course['official_code'] : ''); |
|
| 55 | 55 | $navigation['myprofile']['title'] = get_lang('ModifyProfile'); |
| 56 | 56 | $navigation['myprofile']['key'] = 'profile'; |
| 57 | 57 | $navigation['myprofile']['icon'] = 'profile.png'; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // Gradebook |
| 65 | 65 | if (api_get_setting('gradebook_enable') == 'true') { |
| 66 | - $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&courseCode='.$_course['official_code'] : '' ); |
|
| 66 | + $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&courseCode='.$_course['official_code'] : ''); |
|
| 67 | 67 | $navigation['mygradebook']['title'] = get_lang('MyGradebook'); |
| 68 | 68 | $navigation['mygradebook']['key'] = 'gradebook'; |
| 69 | 69 | $navigation['mygradebook']['icon'] = 'gradebook.png'; |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | // Reporting |
| 73 | 73 | if (api_is_allowed_to_create_course() || api_is_drh() || api_is_session_admin()) { |
| 74 | 74 | // Link to my space |
| 75 | - $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/'.(api_is_drh()?'session.php':''); |
|
| 75 | + $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/'.(api_is_drh() ? 'session.php' : ''); |
|
| 76 | 76 | $navigation['session_my_space']['title'] = get_lang('MySpace'); |
| 77 | 77 | $navigation['session_my_space']['key'] = 'my-space'; |
| 78 | 78 | $navigation['session_my_space']['icon'] = 'my-space.png'; |
| 79 | 79 | } else if (api_is_student_boss()) { |
| 80 | - $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH) . 'mySpace/student.php'; |
|
| 80 | + $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/student.php'; |
|
| 81 | 81 | $navigation['session_my_space']['title'] = get_lang('MySpace'); |
| 82 | 82 | $navigation['session_my_space']['key'] = 'my-space'; |
| 83 | 83 | $navigation['session_my_space']['icon'] = 'my-space.png'; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Social |
| 101 | - if (api_get_setting('allow_social_tool')=='true') { |
|
| 101 | + if (api_get_setting('allow_social_tool') == 'true') { |
|
| 102 | 102 | $navigation['social']['url'] = api_get_path(WEB_CODE_PATH).'social/home.php'; |
| 103 | 103 | $navigation['social']['title'] = get_lang('SocialNetwork'); |
| 104 | 104 | $navigation['social']['key'] = 'social-network'; |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $_course = api_get_course_info(); |
| 195 | 195 | $course_id = 0; |
| 196 | 196 | if (!empty($_course)) { |
| 197 | - $course_id = $_course['code']; |
|
| 197 | + $course_id = $_course['code']; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | $user_id = api_get_user_id(); |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | function return_navigation_array() |
| 246 | 246 | { |
| 247 | - return ; |
|
| 247 | + return; |
|
| 248 | 248 | $navigation = array(); |
| 249 | 249 | $menu_navigation = array(); |
| 250 | 250 | $possible_tabs = get_tabs(); |
@@ -418,9 +418,9 @@ discard block |
||
| 418 | 418 | $pageContent = ''; |
| 419 | 419 | // Get the extra page content, containing the links to add to the tabs |
| 420 | 420 | if (is_file($homepath.$menuTabs.'_'.$lang.$ext) && is_readable($homepath.$menuTabs.'_'.$lang.$ext)) { |
| 421 | - $pageContent = @(string) file_get_contents($homepath . $menuTabs . '_' . $lang . $ext); |
|
| 421 | + $pageContent = @(string) file_get_contents($homepath.$menuTabs.'_'.$lang.$ext); |
|
| 422 | 422 | } elseif (is_file($homepath.$menuTabs.$lang.$ext) && is_readable($homepath.$menuTabs.$lang.$ext)) { |
| 423 | - $pageContent = @(string) file_get_contents($homepath . $menuTabs . $lang . $ext); |
|
| 423 | + $pageContent = @(string) file_get_contents($homepath.$menuTabs.$lang.$ext); |
|
| 424 | 424 | } |
| 425 | 425 | // Sanitize page content |
| 426 | 426 | $pageContent = api_to_system_encoding($pageContent, api_detect_encoding(strip_tags($pageContent))); |
@@ -430,22 +430,22 @@ discard block |
||
| 430 | 430 | // that are only for users already logged in |
| 431 | 431 | $openMenuTabsLoggedIn = ''; |
| 432 | 432 | if (api_get_user_id() && !api_is_anonymous()) { |
| 433 | - if (is_file($homepath . $menuTabsLoggedIn . '_' . $lang . $ext) && is_readable($homepath . $menuTabsLoggedIn . '_' . $lang . $ext)) { |
|
| 434 | - $pageContent = @(string) file_get_contents($homepath . $menuTabsLoggedIn . '_' . $lang . $ext); |
|
| 433 | + if (is_file($homepath.$menuTabsLoggedIn.'_'.$lang.$ext) && is_readable($homepath.$menuTabsLoggedIn.'_'.$lang.$ext)) { |
|
| 434 | + $pageContent = @(string) file_get_contents($homepath.$menuTabsLoggedIn.'_'.$lang.$ext); |
|
| 435 | 435 | $pageContent = str_replace('::private', '', $pageContent); |
| 436 | - } elseif (is_file($homepath . $menuTabsLoggedIn . $lang . $ext) && is_readable($homepath . $menuTabsLoggedIn . $lang . $ext)) { |
|
| 437 | - $pageContent = @(string) file_get_contents($homepath . $menuTabsLoggedIn . $lang . $ext); |
|
| 436 | + } elseif (is_file($homepath.$menuTabsLoggedIn.$lang.$ext) && is_readable($homepath.$menuTabsLoggedIn.$lang.$ext)) { |
|
| 437 | + $pageContent = @(string) file_get_contents($homepath.$menuTabsLoggedIn.$lang.$ext); |
|
| 438 | 438 | $pageContent = str_replace('::private', '', $pageContent); |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | $pageContent = api_to_system_encoding($pageContent, api_detect_encoding(strip_tags($pageContent))); |
| 442 | - $openMenuTabsLoggedIn = str_replace('{rel_path}',api_get_path(REL_PATH), $pageContent); |
|
| 442 | + $openMenuTabsLoggedIn = str_replace('{rel_path}', api_get_path(REL_PATH), $pageContent); |
|
| 443 | 443 | $openMenuTabsLoggedIn = api_to_system_encoding($openMenuTabsLoggedIn, api_detect_encoding(strip_tags($openMenuTabsLoggedIn))); |
| 444 | 444 | } |
| 445 | 445 | if (!empty($open) || !empty($openMenuTabsLoggedIn)) { |
| 446 | 446 | if (strpos($open.$openMenuTabsLoggedIn, 'show_menu') === false) { |
| 447 | 447 | if (api_is_anonymous()) { |
| 448 | - $mainNavigation['navigation'][SECTION_CAMPUS] = null; |
|
| 448 | + $mainNavigation['navigation'][SECTION_CAMPUS] = null; |
|
| 449 | 449 | } |
| 450 | 450 | } else { |
| 451 | 451 | if (api_get_user_id() && !api_is_anonymous()) { |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | 'url' => $matches[1], |
| 459 | 459 | 'target' => $matches[2], |
| 460 | 460 | 'title' => $matches[3], |
| 461 | - 'key' => 'page-' . str_replace(' ', '-', strtolower($matches[3])) |
|
| 461 | + 'key' => 'page-'.str_replace(' ', '-', strtolower($matches[3])) |
|
| 462 | 462 | ); |
| 463 | 463 | } |
| 464 | 464 | } |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | 'url' => $matches[1], |
| 473 | 473 | 'target' => $matches[2], |
| 474 | 474 | 'title' => $matches[3], |
| 475 | - 'key' => 'page-' . str_replace(' ', '-', strtolower($matches[3])) |
|
| 475 | + 'key' => 'page-'.str_replace(' ', '-', strtolower($matches[3])) |
|
| 476 | 476 | ); |
| 477 | 477 | } |
| 478 | 478 | } |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | //$pre_lis = ''; |
| 485 | 485 | $activeSection = ''; |
| 486 | 486 | foreach ($mainNavigation['navigation'] as $section => $navigation_info) { |
| 487 | - $key = (!empty($navigation_info['key'])?'tab-'.$navigation_info['key']:''); |
|
| 487 | + $key = (!empty($navigation_info['key']) ? 'tab-'.$navigation_info['key'] : ''); |
|
| 488 | 488 | |
| 489 | 489 | if (isset($GLOBALS['this_section'])) { |
| 490 | 490 | $tempSection = $section; |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | // loaded |
| 499 | 499 | if ($GLOBALS['this_section'] == SECTION_CAMPUS) { |
| 500 | 500 | if (!empty($_GET['include'])) { |
| 501 | - $name = str_replace(' ', '-', strtolower($navigation_info['title'])) . '_' . $lang . $ext; |
|
| 501 | + $name = str_replace(' ', '-', strtolower($navigation_info['title'])).'_'.$lang.$ext; |
|
| 502 | 502 | if (strtolower($_GET['include']) == $name) { |
| 503 | 503 | $activeSection = $section; |
| 504 | 504 | } |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | if (!empty($_course) && !isset($_GET['hide_course_breadcrumb'])) { |
| 552 | 552 | |
| 553 | - $navigation_item['url'] = $web_course_path . $_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : ''); |
|
| 553 | + $navigation_item['url'] = $web_course_path.$_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : ''); |
|
| 554 | 554 | $_course['name'] = api_htmlentities($_course['name']); |
| 555 | 555 | $course_title = cut($_course['name'], MAX_LENGTH_BREADCRUMB); |
| 556 | 556 | |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name'].$my_session_name).' '.$course_title.$my_session_name; |
| 566 | 566 | break; |
| 567 | 567 | default: |
| 568 | - if (api_get_session_id() != -1 ) { |
|
| 568 | + if (api_get_session_id() != -1) { |
|
| 569 | 569 | $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name'].$my_session_name).' '.$course_title.$my_session_name; |
| 570 | 570 | } else { |
| 571 | 571 | $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name']).' '.$course_title; |
@@ -685,35 +685,35 @@ discard block |
||
| 685 | 685 | if (!empty($final_navigation)) { |
| 686 | 686 | // $home_link.= '<span class="divider">/</span>'; |
| 687 | 687 | if (!empty($home_link)) { |
| 688 | - $lis.= Display::tag('li', $home_link); |
|
| 688 | + $lis .= Display::tag('li', $home_link); |
|
| 689 | 689 | } |
| 690 | 690 | |
| 691 | 691 | foreach ($final_navigation as $bread) { |
| 692 | 692 | $bread_check = trim(strip_tags($bread)); |
| 693 | 693 | if (!empty($bread_check)) { |
| 694 | - if ($final_navigation_count-1 > $i) { |
|
| 694 | + if ($final_navigation_count - 1 > $i) { |
|
| 695 | 695 | $bread .= ''; |
| 696 | 696 | } |
| 697 | - $lis.= Display::tag('li', $bread, array('class'=>'active')); |
|
| 697 | + $lis .= Display::tag('li', $bread, array('class'=>'active')); |
|
| 698 | 698 | $i++; |
| 699 | 699 | } |
| 700 | 700 | } |
| 701 | 701 | } else { |
| 702 | 702 | if (!empty($home_link)) { |
| 703 | - $lis.= Display::tag('li', $home_link); |
|
| 703 | + $lis .= Display::tag('li', $home_link); |
|
| 704 | 704 | } |
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | // View as student/teacher link |
| 708 | 708 | $view = null; |
| 709 | 709 | if (!empty($view_as_student_link)) { |
| 710 | - $view .= Display::tag('div', $view_as_student_link, array('id' => 'view_as_link','class' => 'pull-right')); |
|
| 710 | + $view .= Display::tag('div', $view_as_student_link, array('id' => 'view_as_link', 'class' => 'pull-right')); |
|
| 711 | 711 | } |
| 712 | 712 | |
| 713 | 713 | if (!empty($navigation_right)) { |
| 714 | - foreach($navigation_right as $item) { |
|
| 714 | + foreach ($navigation_right as $item) { |
|
| 715 | 715 | $extra_class = isset($item['class']) ? $item['class'] : null; |
| 716 | - $lis.= Display::tag('li', $item['title'], array('class' => $extra_class.' pull-right')); |
|
| 716 | + $lis .= Display::tag('li', $item['title'], array('class' => $extra_class.' pull-right')); |
|
| 717 | 717 | } |
| 718 | 718 | } |
| 719 | 719 | |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | if (!empty($_course['id'])) { |
| 766 | 766 | if ($cacheEnabled) { |
| 767 | 767 | $apc = apcu_cache_info(true); |
| 768 | - $apc_end = $apc['start_time']+$apc['ttl']; |
|
| 768 | + $apc_end = $apc['start_time'] + $apc['ttl']; |
|
| 769 | 769 | if (apcu_exists('my_campus_whoisonline_count_simple_'.$_course['id']) && |
| 770 | 770 | (time() < $apc_end) && |
| 771 | 771 | apcu_fetch('my_campus_whoisonline_count_simple_'.$_course['id']) > 0 |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | LIMIT 0,1"; |
| 63 | 63 | $row = Database::query($sql); |
| 64 | 64 | $loginId = null; |
| 65 | - if (Database::num_rows($row)>0) { |
|
| 65 | + if (Database::num_rows($row) > 0) { |
|
| 66 | 66 | $loginId = Database::result($row, 0, "login_id"); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
| 79 | 79 | |
| 80 | - $query = "DELETE FROM " . $online_table . " WHERE login_user_id = $userId"; |
|
| 80 | + $query = "DELETE FROM ".$online_table." WHERE login_user_id = $userId"; |
|
| 81 | 81 | Database::query($query); |
| 82 | 82 | |
| 83 | 83 | /*require_once api_get_path(SYS_PATH) . 'main/chat/chat_functions.lib.php'; |