@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
31 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
32 | 32 | $interbreadcrumb[] = array( |
33 | 33 | 'url' => "resume_session.php?id_session=".$sessionId, |
34 | 34 | "name" => get_lang('SessionOverview') |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | if ($days > 0) { |
61 | 61 | $msg = sprintf(get_lang('FirstAccessWasXSessionDurationYEndDateInZDays'), $firstAccessString, $duration, $days); |
62 | 62 | } else { |
63 | - $endDateInSeconds = $firstAccess + $duration * 24*60*60; |
|
63 | + $endDateInSeconds = $firstAccess + $duration * 24 * 60 * 60; |
|
64 | 64 | $last = api_convert_and_format_date($endDateInSeconds, DATE_FORMAT_SHORT); |
65 | 65 | $msg = sprintf(get_lang('FirstAccessWasXSessionDurationYEndDateWasZ'), $firstAccessString, $duration, $last); |
66 | 66 | } |
@@ -108,7 +108,7 @@ |
||
108 | 108 | ], |
109 | 109 | ['BulletedList', 'NumberedList', 'HorizontalRule'], |
110 | 110 | ['JustifyLeft', 'JustifyCenter', 'JustifyBlock'], |
111 | - [ 'Styles', |
|
111 | + ['Styles', |
|
112 | 112 | 'Format', |
113 | 113 | 'Font', |
114 | 114 | 'FontSize', |
@@ -15,36 +15,36 @@ discard block |
||
15 | 15 | api_protect_admin_script(); |
16 | 16 | |
17 | 17 | // Breadcrumb |
18 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
19 | -$interbreadcrumb[] = array ('url' => 'settings.php?category=Search', 'name' => get_lang('PlatformConfigSettings')); |
|
18 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
19 | +$interbreadcrumb[] = array('url' => 'settings.php?category=Search', 'name' => get_lang('PlatformConfigSettings')); |
|
20 | 20 | |
21 | 21 | $libpath = api_get_path(LIBRARY_PATH); |
22 | 22 | |
23 | 23 | include_once $libpath.'specific_fields_manager.lib.php'; |
24 | 24 | |
25 | 25 | // Create an add-field box |
26 | -$form = new FormValidator('add_field','post','','',null,false); |
|
27 | -$renderer =& $form->defaultRenderer(); |
|
26 | +$form = new FormValidator('add_field', 'post', '', '', null, false); |
|
27 | +$renderer = & $form->defaultRenderer(); |
|
28 | 28 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
29 | -$form->addElement('static','search_advanced_link',null,'<a href="specific_fields_add.php">'.Display::return_icon('fieldadd.gif').get_lang('AddSpecificSearchField').'</a>'); |
|
29 | +$form->addElement('static', 'search_advanced_link', null, '<a href="specific_fields_add.php">'.Display::return_icon('fieldadd.gif').get_lang('AddSpecificSearchField').'</a>'); |
|
30 | 30 | |
31 | 31 | // Create a sortable table with specific fields data |
32 | -$column_show = array(1,1,1); |
|
33 | -$column_order = array(3,2,1); |
|
32 | +$column_show = array(1, 1, 1); |
|
33 | +$column_order = array(3, 2, 1); |
|
34 | 34 | $extra_fields = get_specific_field_list(); |
35 | 35 | $number_of_extra_fields = count($extra_fields); |
36 | 36 | |
37 | -$table = new SortableTableFromArrayConfig($extra_fields,2,50,'',$column_show,$column_order); |
|
38 | -$table->set_header(0, ' ', false,null,'width="2%"', 'style="display:none"'); |
|
37 | +$table = new SortableTableFromArrayConfig($extra_fields, 2, 50, '', $column_show, $column_order); |
|
38 | +$table->set_header(0, ' ', false, null, 'width="2%"', 'style="display:none"'); |
|
39 | 39 | $table->set_header(1, get_lang('Code'), TRUE, 'width="10%"'); |
40 | 40 | $table->set_header(2, get_lang('Name')); |
41 | -$table->set_header(3, get_lang('Modify'),false,'width="10%"'); |
|
41 | +$table->set_header(3, get_lang('Modify'), false, 'width="10%"'); |
|
42 | 42 | $table->set_column_filter(3, 'edit_filter'); |
43 | 43 | |
44 | -function edit_filter($id,$url_params,$row) { |
|
44 | +function edit_filter($id, $url_params, $row) { |
|
45 | 45 | global $charset; |
46 | - $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>'; |
|
47 | - $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>'; |
|
46 | + $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>'; |
|
47 | + $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>'; |
|
48 | 48 | return $return; |
49 | 49 | } |
50 | 50 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | Display::display_header(get_lang('SpecificSearchFields')); |
61 | 61 | echo Display::display_normal_message(get_lang('SpecificSearchFieldsIntro')); |
62 | 62 | |
63 | -if(!empty($_GET['message'])) { |
|
63 | +if (!empty($_GET['message'])) { |
|
64 | 64 | Display::display_confirmation_message($_GET['message']); |
65 | 65 | } |
66 | 66 |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | $table->set_column_filter(3, 'edit_filter'); |
43 | 43 | |
44 | 44 | function edit_filter($id,$url_params,$row) { |
45 | - global $charset; |
|
46 | - $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>'; |
|
47 | - $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>'; |
|
48 | - return $return; |
|
45 | + global $charset; |
|
46 | + $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>'; |
|
47 | + $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>'; |
|
48 | + return $return; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete') { |
52 | - delete_specific_field($_REQUEST['field_id']); |
|
53 | - header('Location: specific_fields.php?message='.get_lang('FieldRemoved')); |
|
52 | + delete_specific_field($_REQUEST['field_id']); |
|
53 | + header('Location: specific_fields.php?message='.get_lang('FieldRemoved')); |
|
54 | 54 | exit; |
55 | 55 | } |
56 | 56 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | echo Display::display_normal_message(get_lang('SpecificSearchFieldsIntro')); |
62 | 62 | |
63 | 63 | if(!empty($_GET['message'])) { |
64 | - Display::display_confirmation_message($_GET['message']); |
|
64 | + Display::display_confirmation_message($_GET['message']); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | echo '<div class="actions">'; |
@@ -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 | } |
@@ -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 | { |