@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | /** |
9 | 9 | * Code |
10 | 10 | */ |
11 | -include_once dirname(__FILE__) . '/../../../global.inc.php'; |
|
12 | -require_once dirname(__FILE__) . '/search_processor.class.php'; |
|
11 | +include_once dirname(__FILE__).'/../../../global.inc.php'; |
|
12 | +require_once dirname(__FILE__).'/search_processor.class.php'; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Process documents before pass it to search listing scripts |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $dk_result = Database::query($sql); |
83 | 83 | |
84 | 84 | $sql = "SELECT insert_user_id FROM $item_property_table |
85 | - WHERE ref = $doc_id AND tool = '" . TOOL_DOCUMENT . "' AND c_id = $course_id |
|
85 | + WHERE ref = $doc_id AND tool = '".TOOL_DOCUMENT."' AND c_id = $course_id |
|
86 | 86 | LIMIT 1"; |
87 | 87 | $name = ''; |
88 | 88 | if ($row = Database::fetch_array($dk_result)) { |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $tool_name = get_lang('AddSpecificSearchField'); |
28 | 28 | |
29 | 29 | if (isset($_GET['action']) && $_GET['action'] === 'edit') { |
30 | - $tool_name = get_lang('EditSpecificSearchField'); |
|
30 | + $tool_name = get_lang('EditSpecificSearchField'); |
|
31 | 31 | } |
32 | 32 | // Create the form |
33 | 33 | $form = new FormValidator('specific_fields_add'); |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | // Create the form |
33 | 33 | $form = new FormValidator('specific_fields_add'); |
34 | 34 | // Field variable name |
35 | -$form->addElement('hidden','field_id', $fieldId); |
|
36 | -$form->addElement('text','field_name',get_lang('FieldName')); |
|
37 | -$form->applyFilter('field_name','html_filter'); |
|
38 | -$form->applyFilter('field_name','trim'); |
|
35 | +$form->addElement('hidden', 'field_id', $fieldId); |
|
36 | +$form->addElement('text', 'field_name', get_lang('FieldName')); |
|
37 | +$form->applyFilter('field_name', 'html_filter'); |
|
38 | +$form->applyFilter('field_name', 'trim'); |
|
39 | 39 | $form->addRule('field_name', get_lang('ThisFieldIsRequired'), 'required'); |
40 | 40 | $form->addRule('field_name', get_lang('OnlyLettersAndNumbersAllowed'), 'username'); |
41 | -$form->addRule('field_name', '', 'maxlength',20); |
|
41 | +$form->addRule('field_name', '', 'maxlength', 20); |
|
42 | 42 | |
43 | 43 | // Set default values (only not empty when editing) |
44 | 44 | $defaults = array(); |
45 | 45 | if ($fieldId) { |
46 | - $form_information = get_specific_field_list(array( 'id' => $fieldId )); |
|
46 | + $form_information = get_specific_field_list(array('id' => $fieldId)); |
|
47 | 47 | $defaults['field_name'] = $form_information[0]['name']; |
48 | 48 | } |
49 | 49 | $form->setDefaults($defaults); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | if ($form->validate()) { |
55 | 55 | $field = $form->exportValues(); |
56 | 56 | $field_name = $field['field_name']; |
57 | - if (is_numeric($field['field_id']) && $field['field_id']<>0 && !empty($field['field_id'])) { |
|
57 | + if (is_numeric($field['field_id']) && $field['field_id'] <> 0 && !empty($field['field_id'])) { |
|
58 | 58 | edit_specific_field($field['field_id'], $field['field_name']); |
59 | 59 | $message = get_lang('FieldEdited'); |
60 | 60 | } else { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @param string $canHaveCourses |
104 | 104 | * @param int $parent_id |
105 | 105 | * |
106 | - * @return bool |
|
106 | + * @return false|string |
|
107 | 107 | */ |
108 | 108 | public static function addNode($code, $name, $canHaveCourses, $parent_id) |
109 | 109 | { |
@@ -297,8 +297,7 @@ discard block |
||
297 | 297 | /** |
298 | 298 | * Counts the number of children categories a category has |
299 | 299 | * @param int $categoryId The ID of the category of which we want to count the children |
300 | - * @param int $count The number of subcategories we counted this far |
|
301 | - * @return mixed The number of subcategories this category has |
|
300 | + * @return integer The number of subcategories this category has |
|
302 | 301 | */ |
303 | 302 | public static function courseCategoryChildrenCount($categoryId) |
304 | 303 | { |
@@ -476,7 +475,7 @@ discard block |
||
476 | 475 | /** |
477 | 476 | * @param int $id |
478 | 477 | * |
479 | - * @return bool |
|
478 | + * @return boolean|null |
|
480 | 479 | */ |
481 | 480 | public static function addToUrl($id) |
482 | 481 | { |
@@ -958,7 +957,7 @@ discard block |
||
958 | 957 | * Get Pagination HTML div |
959 | 958 | * @param $pageCurrent |
960 | 959 | * @param $pageLength |
961 | - * @param $pageTotal |
|
960 | + * @param integer $pageTotal |
|
962 | 961 | * @return string |
963 | 962 | */ |
964 | 963 | public static function getCatalogPagination($pageCurrent, $pageLength, $pageTotal) |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | if ($action == 'delete') { |
27 | 27 | CourseCategory::deleteNode($categoryId); |
28 | 28 | Display::addFlash(Display::return_message(get_lang('Deleted'))); |
29 | - header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category)); |
|
29 | + header('Location: '.api_get_self().'?category='.Security::remove_XSS($category)); |
|
30 | 30 | exit(); |
31 | 31 | } elseif (($action == 'add' || $action == 'edit') && isset($_POST['formSent']) && $_POST['formSent']) { |
32 | 32 | if ($action == 'add') { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | } elseif ($action == 'moveUp') { |
56 | 56 | CourseCategory::moveNodeUp($categoryId, $_GET['tree_pos'], $category); |
57 | - header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category)); |
|
57 | + header('Location: '.api_get_self().'?category='.Security::remove_XSS($category)); |
|
58 | 58 | Display::addFlash(Display::return_message(get_lang('Updated'))); |
59 | 59 | exit(); |
60 | 60 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $form_title = ($action == 'add') ? get_lang('AddACategory') : get_lang('EditNode'); |
80 | 80 | if (!empty($category)) { |
81 | - $form_title .= ' ' . get_lang('Into') . ' ' . Security::remove_XSS($category); |
|
81 | + $form_title .= ' '.get_lang('Into').' '.Security::remove_XSS($category); |
|
82 | 82 | } |
83 | 83 | $url = api_get_self().'?action='.Security::remove_XSS($action).'&category='.Security::remove_XSS($category).'&id='.Security::remove_XSS($categoryId); |
84 | 84 | $form = new FormValidator('course_category', 'post', $url); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $vimeoMatch = preg_match('#://player.vimeo.com/#i', $matches[1]); |
62 | 62 | $googleMapsMatch = preg_match('#src="https://maps.google.com/#i', $matches[1]); |
63 | 63 | $slideShare = preg_match('#src="(https?:)?//www.slideshare.net/#', $matches[1]); |
64 | - $platformDomain = preg_match('#src="https?://(.+\.)?' . $hostName[1] . '#i', $matches[1]); |
|
64 | + $platformDomain = preg_match('#src="https?://(.+\.)?'.$hostName[1].'#i', $matches[1]); |
|
65 | 65 | |
66 | 66 | if ($youTubeMatch || $vimeoMatch || $googleMapsMatch || $slideShare || $platformDomain) { |
67 | 67 | $extra = ' frameborder="0"'; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } elseif ($vimeoMatch) { |
71 | 71 | $extra .= ' webkitAllowFullScreen mozallowfullscreen allowFullScreen'; |
72 | 72 | } |
73 | - return '<iframe ' . $matches[1] . $extra . '></iframe>'; |
|
73 | + return '<iframe '.$matches[1].$extra.'></iframe>'; |
|
74 | 74 | } else { |
75 | 75 | return ''; |
76 | 76 | } |
@@ -1875,11 +1875,11 @@ discard block |
||
1875 | 1875 | return $this->locale; |
1876 | 1876 | } |
1877 | 1877 | |
1878 | - /** |
|
1879 | - * @param string $timezone |
|
1880 | - * |
|
1881 | - * @return User |
|
1882 | - */ |
|
1878 | + /** |
|
1879 | + * @param string $timezone |
|
1880 | + * |
|
1881 | + * @return User |
|
1882 | + */ |
|
1883 | 1883 | public function setTimezone($timezone) |
1884 | 1884 | { |
1885 | 1885 | $this->timezone = $timezone; |
@@ -2048,11 +2048,11 @@ discard block |
||
2048 | 2048 | return $this->plainPassword; |
2049 | 2049 | } |
2050 | 2050 | |
2051 | - /** |
|
2052 | - * Returns the user roles |
|
2053 | - * |
|
2054 | - * @return array The roles |
|
2055 | - */ |
|
2051 | + /** |
|
2052 | + * Returns the user roles |
|
2053 | + * |
|
2054 | + * @return array The roles |
|
2055 | + */ |
|
2056 | 2056 | public function getRoles() |
2057 | 2057 | { |
2058 | 2058 | $roles = $this->roles; |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | /** |
996 | 996 | * Get pictureUri |
997 | 997 | * |
998 | - * @return Media |
|
998 | + * @return string |
|
999 | 999 | */ |
1000 | 1000 | public function getPictureUri() |
1001 | 1001 | { |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | } |
1304 | 1304 | |
1305 | 1305 | /** |
1306 | - * @return Media |
|
1306 | + * @return string |
|
1307 | 1307 | */ |
1308 | 1308 | public function getAvatar() |
1309 | 1309 | { |
@@ -2078,7 +2078,7 @@ discard block |
||
2078 | 2078 | /** |
2079 | 2079 | * Returns the user roles |
2080 | 2080 | * |
2081 | - * @return array The roles |
|
2081 | + * @return string[] The roles |
|
2082 | 2082 | */ |
2083 | 2083 | public function getRoles() |
2084 | 2084 | { |
@@ -2403,7 +2403,7 @@ discard block |
||
2403 | 2403 | /** |
2404 | 2404 | * Check if the user has the skill |
2405 | 2405 | * @param Skill $skill The skill |
2406 | - * @return boolean |
|
2406 | + * @return boolean|null |
|
2407 | 2407 | */ |
2408 | 2408 | public function hasSkill(Skill $skill) |
2409 | 2409 | { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 0, //howMany |
75 | 75 | 1, //$orderby = 1 |
76 | 76 | 'ASC', |
77 | - -1, //visibility |
|
77 | + -1, //visibility |
|
78 | 78 | $_GET['q'], |
79 | 79 | null, //$urlId |
80 | 80 | true //AlsoSearchCode |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | if (!empty($course['category_code'])) { |
98 | 98 | $parents = CourseCategory::getParentsToString($course['category_code']); |
99 | - $title = $parents . $course['title']; |
|
99 | + $title = $parents.$course['title']; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | $results['items'][] = array( |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | INNER JOIN $session_course_user r ON u.user_id = r.user_id |
177 | 177 | WHERE session_id = %d AND c_id = '%s' |
178 | 178 | AND (u.firstname LIKE '%s' OR u.username LIKE '%s' OR u.lastname LIKE '%s')"; |
179 | - $needle = '%' . $_GET['q'] . '%'; |
|
179 | + $needle = '%'.$_GET['q'].'%'; |
|
180 | 180 | $sql_query = sprintf($sql, $_GET['session_id'], $course['real_id'], $needle, $needle, $needle); |
181 | 181 | |
182 | 182 | $result = Database::query($sql_query); |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | case 'search_exercise_by_course': |
196 | 196 | if (api_is_platform_admin()) { |
197 | 197 | $course = api_get_course_info_by_id($_GET['course_id']); |
198 | - $session_id = (!empty($_GET['session_id'])) ? intval($_GET['session_id']) : 0 ; |
|
198 | + $session_id = (!empty($_GET['session_id'])) ? intval($_GET['session_id']) : 0; |
|
199 | 199 | $exercises = ExerciseLib::get_all_exercises($course, $session_id, false, $_GET['q'], true, 3); |
200 | 200 | |
201 | 201 | foreach ($exercises as $exercise) { |
202 | - $data[] = array('id' => $exercise['id'], 'text' => html_entity_decode($exercise['title']) ); |
|
202 | + $data[] = array('id' => $exercise['id'], 'text' => html_entity_decode($exercise['title'])); |
|
203 | 203 | } |
204 | 204 | if (!empty($data)) { |
205 | 205 | $data[] = array('id' => 'T', 'text' => 'TODOS'); |
@@ -224,11 +224,11 @@ discard block |
||
224 | 224 | $sql, |
225 | 225 | intval($_GET['course_id']), |
226 | 226 | intval($_GET['session_id']), |
227 | - '%' . Database::escape_string($_GET['q']).'%' |
|
227 | + '%'.Database::escape_string($_GET['q']).'%' |
|
228 | 228 | ); |
229 | 229 | $result = Database::query($sql_query); |
230 | 230 | while ($survey = Database::fetch_assoc($result)) { |
231 | - $survey['title'] .= ($survey['anonymous'] == 1) ? ' (' . get_lang('Anonymous') . ')' : ''; |
|
231 | + $survey['title'] .= ($survey['anonymous'] == 1) ? ' ('.get_lang('Anonymous').')' : ''; |
|
232 | 232 | $data[] = array( |
233 | 233 | 'id' => $survey['id'], |
234 | 234 | 'text' => strip_tags(html_entity_decode($survey['title'])) |
@@ -267,11 +267,11 @@ |
||
267 | 267 | $coachName = api_get_person_name($userResult['firstname'], $userResult['lastname']); |
268 | 268 | } |
269 | 269 | |
270 | - $courses[] = array( |
|
271 | - 'id' => $courseId, |
|
272 | - 'name' => $course['title'], |
|
273 | - 'coachName' => $coachName, |
|
274 | - ); |
|
270 | + $courses[] = array( |
|
271 | + 'id' => $courseId, |
|
272 | + 'name' => $course['title'], |
|
273 | + 'coachName' => $coachName, |
|
274 | + ); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | echo json_encode($courses); |
@@ -1875,11 +1875,11 @@ discard block |
||
1875 | 1875 | return $this->locale; |
1876 | 1876 | } |
1877 | 1877 | |
1878 | - /** |
|
1879 | - * @param string $timezone |
|
1880 | - * |
|
1881 | - * @return User |
|
1882 | - */ |
|
1878 | + /** |
|
1879 | + * @param string $timezone |
|
1880 | + * |
|
1881 | + * @return User |
|
1882 | + */ |
|
1883 | 1883 | public function setTimezone($timezone) |
1884 | 1884 | { |
1885 | 1885 | $this->timezone = $timezone; |
@@ -2048,11 +2048,11 @@ discard block |
||
2048 | 2048 | return $this->plainPassword; |
2049 | 2049 | } |
2050 | 2050 | |
2051 | - /** |
|
2052 | - * Returns the user roles |
|
2053 | - * |
|
2054 | - * @return array The roles |
|
2055 | - */ |
|
2051 | + /** |
|
2052 | + * Returns the user roles |
|
2053 | + * |
|
2054 | + * @return array The roles |
|
2055 | + */ |
|
2056 | 2056 | public function getRoles() |
2057 | 2057 | { |
2058 | 2058 | $roles = $this->roles; |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | /** |
908 | 908 | * Get pictureUri |
909 | 909 | * |
910 | - * @return Media |
|
910 | + * @return string |
|
911 | 911 | */ |
912 | 912 | public function getPictureUri() |
913 | 913 | { |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | } |
1285 | 1285 | |
1286 | 1286 | /** |
1287 | - * @return Media |
|
1287 | + * @return string |
|
1288 | 1288 | */ |
1289 | 1289 | public function getAvatar() |
1290 | 1290 | { |
@@ -2051,7 +2051,7 @@ discard block |
||
2051 | 2051 | /** |
2052 | 2052 | * Returns the user roles |
2053 | 2053 | * |
2054 | - * @return array The roles |
|
2054 | + * @return string[] The roles |
|
2055 | 2055 | */ |
2056 | 2056 | public function getRoles() |
2057 | 2057 | { |
@@ -6,19 +6,19 @@ |
||
6 | 6 | */ |
7 | 7 | class SelectTheme extends HTML_QuickForm_select |
8 | 8 | { |
9 | - /** |
|
10 | - * Class constructor |
|
11 | - */ |
|
12 | - public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) |
|
13 | - { |
|
14 | - parent::__construct($elementName, $elementLabel, $options, $attributes); |
|
15 | - // Get all languages |
|
16 | - $themes = api_get_themes(); |
|
17 | - $this->_options = array(); |
|
18 | - $this->_values = array(); |
|
19 | - $this->addOption('--',''); // no theme select |
|
20 | - for ($i=0; $i< count($themes[0]); $i++) { |
|
21 | - $this->addOption($themes[1][$i],$themes[0][$i]); |
|
22 | - } |
|
23 | - } |
|
9 | + /** |
|
10 | + * Class constructor |
|
11 | + */ |
|
12 | + public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) |
|
13 | + { |
|
14 | + parent::__construct($elementName, $elementLabel, $options, $attributes); |
|
15 | + // Get all languages |
|
16 | + $themes = api_get_themes(); |
|
17 | + $this->_options = array(); |
|
18 | + $this->_values = array(); |
|
19 | + $this->addOption('--',''); // no theme select |
|
20 | + for ($i=0; $i< count($themes[0]); $i++) { |
|
21 | + $this->addOption($themes[1][$i],$themes[0][$i]); |
|
22 | + } |
|
23 | + } |
|
24 | 24 | } |
@@ -9,16 +9,16 @@ |
||
9 | 9 | /** |
10 | 10 | * Class constructor |
11 | 11 | */ |
12 | - public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) |
|
12 | + public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null) |
|
13 | 13 | { |
14 | 14 | parent::__construct($elementName, $elementLabel, $options, $attributes); |
15 | 15 | // Get all languages |
16 | 16 | $themes = api_get_themes(); |
17 | 17 | $this->_options = array(); |
18 | 18 | $this->_values = array(); |
19 | - $this->addOption('--',''); // no theme select |
|
20 | - for ($i=0; $i< count($themes[0]); $i++) { |
|
21 | - $this->addOption($themes[1][$i],$themes[0][$i]); |
|
19 | + $this->addOption('--', ''); // no theme select |
|
20 | + for ($i = 0; $i < count($themes[0]); $i++) { |
|
21 | + $this->addOption($themes[1][$i], $themes[0][$i]); |
|
22 | 22 | } |
23 | 23 | } |
24 | 24 | } |