@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | require_once '../inc/global.inc.php'; |
5 | 5 | |
6 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
6 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
7 | 7 | |
8 | 8 | api_protect_course_script(true); |
9 | 9 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | echo '<div class="actions">'; |
80 | 80 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq().'>'. |
81 | - Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
81 | + Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
82 | 82 | echo '</div>'; |
83 | 83 | |
84 | 84 | if (!empty($my_folder_data['description'])) { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | // setting breadcrumbs |
26 | 26 | //$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
27 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
27 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
28 | 28 | $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$sessionId, "name" => get_lang('SessionOverview')); |
29 | 29 | |
30 | 30 | // Database Table Definitions |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
36 | 36 | |
37 | 37 | // setting the name of the tool |
38 | -$tool_name= get_lang('SubscribeCoursesToSession'); |
|
38 | +$tool_name = get_lang('SubscribeCoursesToSession'); |
|
39 | 39 | |
40 | 40 | $add_type = 'multiple'; |
41 | -if (isset($_GET['add_type']) && $_GET['add_type']!=''){ |
|
41 | +if (isset($_GET['add_type']) && $_GET['add_type'] != '') { |
|
42 | 42 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
43 | 43 | } |
44 | 44 | |
@@ -124,18 +124,18 @@ discard block |
||
124 | 124 | $nosessionCourses = $sessionCourses = array(); |
125 | 125 | if ($ajax_search) { |
126 | 126 | |
127 | - $sql="SELECT course.id, code, title, visual_code, session_id |
|
127 | + $sql = "SELECT course.id, code, title, visual_code, session_id |
|
128 | 128 | FROM $tbl_course course |
129 | 129 | INNER JOIN $tbl_session_rel_course session_rel_course |
130 | 130 | ON |
131 | 131 | course.id = session_rel_course.c_id AND |
132 | 132 | session_rel_course.session_id = ".intval($sessionId)." |
133 | - ORDER BY ".(sizeof($courses)?"(code IN(".implode(',', $courses).")) DESC,":"")." title"; |
|
133 | + ORDER BY ".(sizeof($courses) ? "(code IN(".implode(',', $courses).")) DESC," : "")." title"; |
|
134 | 134 | |
135 | 135 | if (api_is_multiple_url_enabled()) { |
136 | 136 | $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
137 | 137 | $access_url_id = api_get_current_access_url_id(); |
138 | - if ($access_url_id != -1){ |
|
138 | + if ($access_url_id != -1) { |
|
139 | 139 | $sql = "SELECT course.id, code, title, visual_code, session_id |
140 | 140 | FROM $tbl_course course |
141 | 141 | INNER JOIN $tbl_session_rel_course session_rel_course |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | INNER JOIN $tbl_course_rel_access_url url_course |
145 | 145 | ON (url_course.c_id = course.id) |
146 | 146 | WHERE access_url_id = $access_url_id |
147 | - ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title"; |
|
147 | + ORDER BY ".(sizeof($courses) ? "(code IN(".implode(',', $courses).")) DESC," : "")." title"; |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $Courses = Database::store_result($result); |
153 | 153 | |
154 | 154 | foreach ($Courses as $course) { |
155 | - $sessionCourses[$course['id']] = $course ; |
|
155 | + $sessionCourses[$course['id']] = $course; |
|
156 | 156 | } |
157 | 157 | } else { |
158 | 158 | $sql = "SELECT course.id, code, title, visual_code, session_id |
@@ -161,12 +161,12 @@ discard block |
||
161 | 161 | ON |
162 | 162 | course.id = session_rel_course.c_id AND |
163 | 163 | session_rel_course.session_id = ".intval($sessionId)." |
164 | - ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title"; |
|
164 | + ORDER BY ".(sizeof($courses) ? "(code IN(".implode(',', $courses).")) DESC," : "")." title"; |
|
165 | 165 | |
166 | 166 | if (api_is_multiple_url_enabled()) { |
167 | 167 | $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
168 | 168 | $access_url_id = api_get_current_access_url_id(); |
169 | - if ($access_url_id != -1){ |
|
169 | + if ($access_url_id != -1) { |
|
170 | 170 | $sql = "SELECT course.id, code, title, visual_code, session_id |
171 | 171 | FROM $tbl_course course |
172 | 172 | LEFT JOIN $tbl_session_rel_course session_rel_course |
@@ -176,16 +176,16 @@ discard block |
||
176 | 176 | INNER JOIN $tbl_course_rel_access_url url_course |
177 | 177 | ON (url_course.c_id = course.id) |
178 | 178 | WHERE access_url_id = $access_url_id |
179 | - ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title"; |
|
179 | + ORDER BY ".(sizeof($courses) ? "(code IN(".implode(',', $courses).")) DESC," : "")." title"; |
|
180 | 180 | } |
181 | 181 | } |
182 | 182 | $result = Database::query($sql); |
183 | 183 | $Courses = Database::store_result($result); |
184 | 184 | foreach ($Courses as $course) { |
185 | 185 | if ($course['session_id'] == $sessionId) { |
186 | - $sessionCourses[$course['id']] = $course ; |
|
186 | + $sessionCourses[$course['id']] = $course; |
|
187 | 187 | } else { |
188 | - $nosessionCourses[$course['id']] = $course ; |
|
188 | + $nosessionCourses[$course['id']] = $course; |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | unset($Courses); |
209 | 209 | ?> |
210 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
210 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
211 | 211 | <legend><?php echo $tool_name.' ('.$session_info['name'].')'; ?></legend> |
212 | 212 | <input type="hidden" name="formSent" value="1" /> |
213 | 213 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | <div id="ajax_list_courses_multiple"> |
231 | 231 | <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" class="form-control"> |
232 | 232 | <?php foreach ($nosessionCourses as $enreg) { ?> |
233 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>> |
|
233 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')', ENT_QUOTES).'"'; if (in_array($enreg['code'], $CourseList)) echo 'selected="selected"'; ?>> |
|
234 | 234 | <?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?> |
235 | 235 | </option> |
236 | 236 | <?php } ?> |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | ?> |
243 | 243 | </div> |
244 | 244 | <div class="col-md-4"> |
245 | - <?php if($add_type == 'multiple') { ?> |
|
245 | + <?php if ($add_type == 'multiple') { ?> |
|
246 | 246 | <div class="code-course"> |
247 | 247 | <?php echo get_lang('FirstLetterCourse'); ?> : |
248 | 248 | |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | <option value="%">--</option> |
251 | 251 | <?php |
252 | 252 | echo Display :: get_alphabet_options(); |
253 | - echo Display :: get_numeric_options(0,9,''); |
|
253 | + echo Display :: get_numeric_options(0, 9, ''); |
|
254 | 254 | ?> |
255 | 255 | </select> |
256 | 256 | </div> |
@@ -306,9 +306,9 @@ discard block |
||
306 | 306 | <select id='destination' name="SessionCoursesList[]" multiple="multiple" size="20" class="form-control"> |
307 | 307 | |
308 | 308 | <?php |
309 | - foreach($sessionCourses as $enreg) { |
|
309 | + foreach ($sessionCourses as $enreg) { |
|
310 | 310 | ?> |
311 | - <option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES); ?>"> |
|
311 | + <option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')', ENT_QUOTES); ?>"> |
|
312 | 312 | <?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?> |
313 | 313 | </option> |
314 | 314 | <?php |
@@ -207,7 +207,10 @@ discard block |
||
207 | 207 | |
208 | 208 | unset($Courses); |
209 | 209 | ?> |
210 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
210 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if(!empty($_GET['add'])) { |
|
211 | + echo '&add=true' ; |
|
212 | +} |
|
213 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
211 | 214 | <legend><?php echo $tool_name.' ('.$session_info['name'].')'; ?></legend> |
212 | 215 | <input type="hidden" name="formSent" value="1" /> |
213 | 216 | |
@@ -230,7 +233,10 @@ discard block |
||
230 | 233 | <div id="ajax_list_courses_multiple"> |
231 | 234 | <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" class="form-control"> |
232 | 235 | <?php foreach ($nosessionCourses as $enreg) { ?> |
233 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>> |
|
236 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) { |
|
237 | + echo 'selected="selected"'; |
|
238 | +} |
|
239 | +?>> |
|
234 | 240 | <?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?> |
235 | 241 | </option> |
236 | 242 | <?php } ?> |
@@ -38,9 +38,9 @@ |
||
38 | 38 | $nameTools = get_lang('AddGroup'); |
39 | 39 | $this_section = SECTION_SOCIAL; |
40 | 40 | |
41 | -$interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social')); |
|
42 | -$interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
43 | -$interbreadcrumb[]= array ('url' =>'#','name' => $nameTools); |
|
41 | +$interbreadcrumb[] = array('url' =>'home.php', 'name' => get_lang('Social')); |
|
42 | +$interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
43 | +$interbreadcrumb[] = array('url' =>'#', 'name' => $nameTools); |
|
44 | 44 | |
45 | 45 | $social_avatar_block = SocialManager::show_social_avatar_block('group_add'); |
46 | 46 | $social_menu_block = SocialManager::show_social_menu('group_add'); |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | |
17 | 17 | $this_section = SECTION_SOCIAL; |
18 | 18 | |
19 | -$interbreadcrumb[] = array ('url' =>'profile.php','name' => get_lang('SocialNetwork')); |
|
20 | -$interbreadcrumb[] = array ('url' =>'#','name' => get_lang('Invitations')); |
|
19 | +$interbreadcrumb[] = array('url' =>'profile.php', 'name' => get_lang('SocialNetwork')); |
|
20 | +$interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Invitations')); |
|
21 | 21 | |
22 | 22 | if (is_array($_GET) && count($_GET) > 0) { |
23 | 23 | foreach ($_GET as $key => $value) { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | Display::return_message(get_lang('UserIsNotSubscribedToThisGroup'), 'warning') |
63 | 63 | ); |
64 | 64 | |
65 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php'); |
|
65 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php'); |
|
66 | 66 | exit; |
67 | 67 | break; |
68 | 68 | case 'deny': |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | Display::return_message(get_lang('GroupInvitationWasDeny')) |
73 | 73 | ); |
74 | 74 | |
75 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php'); |
|
75 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php'); |
|
76 | 76 | exit; |
77 | 77 | } |
78 | 78 | } |
@@ -133,24 +133,24 @@ discard block |
||
133 | 133 | $invitationHtml .= '<div class="btn-group" role="group">'; |
134 | 134 | $invitationHtml .= Display::toolbarButton( |
135 | 135 | get_lang('AcceptInvitation'), |
136 | - api_get_path(WEB_AJAX_PATH) . 'social.ajax.php?' . http_build_query([ |
|
136 | + api_get_path(WEB_AJAX_PATH).'social.ajax.php?'.http_build_query([ |
|
137 | 137 | 'a' => 'add_friend', |
138 | 138 | 'friend_id' => $sender_user_id, |
139 | 139 | 'is_my_friend' => 'friend' |
140 | 140 | ]), |
141 | 141 | 'check', |
142 | 142 | 'success', |
143 | - ['id' => 'btn-accept-' . $sender_user_id] |
|
143 | + ['id' => 'btn-accept-'.$sender_user_id] |
|
144 | 144 | ); |
145 | 145 | $invitationHtml .= Display::toolbarButton( |
146 | 146 | get_lang('DenyInvitation'), |
147 | - api_get_path(WEB_AJAX_PATH) . 'social.ajax.php?' . http_build_query([ |
|
147 | + api_get_path(WEB_AJAX_PATH).'social.ajax.php?'.http_build_query([ |
|
148 | 148 | 'a' => 'deny_friend', |
149 | 149 | 'denied_friend_id' => $sender_user_id, |
150 | 150 | ]), |
151 | 151 | 'times', |
152 | 152 | 'danger', |
153 | - ['id' => 'btn-deny-' . $sender_user_id] |
|
153 | + ['id' => 'btn-deny-'.$sender_user_id] |
|
154 | 154 | ); |
155 | 155 | $invitationHtml .= '</div>'; |
156 | 156 | $invitationHtml .= '</div>'; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $invitationSentHtml .= '<div class="col-md-9">'; |
179 | 179 | $invitationSentHtml .= '<h4 class="title-profile"><a class="profile_link" href="profile.php?u='.$sender_user_id.'">'.$user_info['complete_name'].'</a></h4>'; |
180 | 180 | $invitationSentHtml .= '<div class="content-invitation">'.$title.' : '.$content.'</div>'; |
181 | - $invitationSentHtml .= '<div class="date-invitation">'. get_lang('DateSend').' : '.$date.'</div>'; |
|
181 | + $invitationSentHtml .= '<div class="date-invitation">'.get_lang('DateSend').' : '.$date.'</div>'; |
|
182 | 182 | $invitationSentHtml .= '</div>'; |
183 | 183 | $invitationSentHtml .= '</div></div>'; |
184 | 184 | } |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | ); |
197 | 197 | $img = '<img class="social-groups-image" src="'.$picture['file'].'" />'; |
198 | 198 | $invitation['picture_uri'] = '<a href="group_view.php?id='.$invitation['id'].'">'.$img.'</a>'; |
199 | - $invitation['name'] = '<a href="group_view.php?id='.$invitation['id'].'">'.cut($invitation['name'],120,true).'</a>'; |
|
200 | - $invitation['description'] = cut($invitation['description'],220,true); |
|
201 | - $new_invitation[]=$invitation; |
|
199 | + $invitation['name'] = '<a href="group_view.php?id='.$invitation['id'].'">'.cut($invitation['name'], 120, true).'</a>'; |
|
200 | + $invitation['description'] = cut($invitation['description'], 220, true); |
|
201 | + $new_invitation[] = $invitation; |
|
202 | 202 | |
203 | 203 | $waitingInvitation .= '<div class="well"><div class="row">'; |
204 | 204 | $waitingInvitation .= '<div class="col-md-3">'.$invitation['picture_uri'].'</div>'; |
@@ -208,19 +208,19 @@ discard block |
||
208 | 208 | $waitingInvitation .= '<div class="btn-group" role="group">'; |
209 | 209 | $waitingInvitation .= Display::toolbarButton( |
210 | 210 | get_lang('AcceptInvitation'), |
211 | - api_get_path(WEB_CODE_PATH) . 'social/invitations.php?' . http_build_query(['accept' => $invitation['id']]), |
|
211 | + api_get_path(WEB_CODE_PATH).'social/invitations.php?'.http_build_query(['accept' => $invitation['id']]), |
|
212 | 212 | 'check', |
213 | 213 | 'success', |
214 | - ['id' => 'accept-invitation-' . $invitation['id']] |
|
214 | + ['id' => 'accept-invitation-'.$invitation['id']] |
|
215 | 215 | ); |
216 | 216 | $waitingInvitation .= Display::toolbarButton( |
217 | 217 | get_lang('DenyInvitation'), |
218 | - api_get_path(WEB_CODE_PATH) . 'social/invitations.php?' . http_build_query(['deny' => $invitation['id']]), |
|
218 | + api_get_path(WEB_CODE_PATH).'social/invitations.php?'.http_build_query(['deny' => $invitation['id']]), |
|
219 | 219 | 'times', |
220 | 220 | 'danger', |
221 | - ['id' => 'deny-invitation-' . $invitation['id']] |
|
221 | + ['id' => 'deny-invitation-'.$invitation['id']] |
|
222 | 222 | ); |
223 | - $waitingInvitation .='</div>'; |
|
223 | + $waitingInvitation .= '</div>'; |
|
224 | 224 | $waitingInvitation .= '</div></div>'; |
225 | 225 | } |
226 | 226 | $socialInvitationsBlock .= Display::panel($waitingInvitation, get_lang('GroupsWaitingApproval')); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $tpl = new Template(null); |
230 | 230 | SocialManager::setSocialUserBlock($tpl, $user_id, 'invitations'); |
231 | 231 | $tpl->assign('social_menu_block', $social_menu_block); |
232 | -$tpl->assign('social_invitations_block',$socialInvitationsBlock); |
|
232 | +$tpl->assign('social_invitations_block', $socialInvitationsBlock); |
|
233 | 233 | $tpl->assign('content', $content); |
234 | 234 | $social_layout = $tpl->get_template('social/invitations.tpl'); |
235 | 235 | $tpl->display($social_layout); |
@@ -1154,7 +1154,7 @@ discard block |
||
1154 | 1154 | /** |
1155 | 1155 | * Returns an array containing the list of options used to populate the gradebook_number_decimals variable |
1156 | 1156 | * This function is called through a call_user_func() in the generate_settings_form function. |
1157 | - * @return array List of gradebook_number_decimals options |
|
1157 | + * @return string[] List of gradebook_number_decimals options |
|
1158 | 1158 | * |
1159 | 1159 | * @author Guillaume Viguier <[email protected]> |
1160 | 1160 | */ |
@@ -1575,8 +1575,9 @@ discard block |
||
1575 | 1575 | } |
1576 | 1576 | /** |
1577 | 1577 | * Helper function to generates a form elements group |
1578 | - * @param object $form The form where the elements group has to be added |
|
1578 | + * @param FormValidator $form The form where the elements group has to be added |
|
1579 | 1579 | * @param array $values Values to browse through |
1580 | + * @param string $elementName |
|
1580 | 1581 | * @return array |
1581 | 1582 | */ |
1582 | 1583 | function formGenerateElementsGroup($form, $values = array(), $elementName) |
@@ -1592,7 +1593,7 @@ discard block |
||
1592 | 1593 | } |
1593 | 1594 | /** |
1594 | 1595 | * Helper function with allowed file types for CSS |
1595 | - * @return array Array of file types (no indexes) |
|
1596 | + * @return string[] Array of file types (no indexes) |
|
1596 | 1597 | */ |
1597 | 1598 | function getAllowedFileTypes() |
1598 | 1599 | { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | // Plugins NOT installed |
140 | 140 | echo Display::page_subheader(get_lang('Plugins')); |
141 | - echo '<form class="form-horizontal" name="plugins" method="post" action="'.api_get_self().'?category='.Security::remove_XSS($_GET['category']).'&sec_token=' . $token . '">'; |
|
141 | + echo '<form class="form-horizontal" name="plugins" method="post" action="'.api_get_self().'?category='.Security::remove_XSS($_GET['category']).'&sec_token='.$token.'">'; |
|
142 | 142 | echo '<table class="data_table">'; |
143 | 143 | echo '<tr>'; |
144 | 144 | echo '<th width="20px">'; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | if (file_exists(api_get_path(SYS_PLUGIN_PATH).$pluginName.'/readme.txt')) { |
188 | 188 | echo Display::url( |
189 | 189 | "<em class='fa fa-file-text-o'></em> readme.txt", |
190 | - api_get_path(WEB_PLUGIN_PATH) . $pluginName . "/readme.txt", |
|
190 | + api_get_path(WEB_PLUGIN_PATH).$pluginName."/readme.txt", |
|
191 | 191 | [ |
192 | 192 | 'class' => 'btn btn-default ajax', |
193 | 193 | 'data-title' => $plugin_info['title'], |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $form->addElement('file', 'new_stylesheet', get_lang('UploadNewStylesheet')); |
251 | 251 | $allowed_file_types = getAllowedFileTypes(); |
252 | 252 | |
253 | - $form->addRule('new_stylesheet', get_lang('InvalidExtension') . ' (' . implode(',', $allowed_file_types) . ')', |
|
253 | + $form->addRule('new_stylesheet', get_lang('InvalidExtension').' ('.implode(',', $allowed_file_types).')', |
|
254 | 254 | 'filetype', $allowed_file_types); |
255 | 255 | $form->addRule('new_stylesheet', get_lang('ThisFieldIsRequired'), 'required'); |
256 | 256 | $form->addButtonUpload(get_lang('Upload'), 'stylesheet_upload'); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $show_name = ucwords(str_replace('_', ' ', $style_dir)); |
338 | 338 | |
339 | 339 | if ($is_style_changeable) { |
340 | - $list_of_names[$style_dir] = $show_name; |
|
340 | + $list_of_names[$style_dir] = $show_name; |
|
341 | 341 | } |
342 | 342 | $counter++; |
343 | 343 | } |
@@ -377,16 +377,16 @@ discard block |
||
377 | 377 | Display::return_message(sprintf(get_lang('TheLogoMustBeSizeXAndFormatY'), '250 x 70', 'PNG'), 'info') |
378 | 378 | ); |
379 | 379 | |
380 | - $dir = api_get_path(SYS_PUBLIC_PATH).'css/themes/' . $selected . '/images/'; |
|
381 | - $url = api_get_path(WEB_CSS_PATH).'themes/' . $selected . '/images/'; |
|
380 | + $dir = api_get_path(SYS_PUBLIC_PATH).'css/themes/'.$selected.'/images/'; |
|
381 | + $url = api_get_path(WEB_CSS_PATH).'themes/'.$selected.'/images/'; |
|
382 | 382 | $logoFileName = 'header-logo.png'; |
383 | - $newLogoFileName = 'header-logo-custom' . api_get_current_access_url_id() . '.png'; |
|
383 | + $newLogoFileName = 'header-logo-custom'.api_get_current_access_url_id().'.png'; |
|
384 | 384 | $webPlatformLogoPath = ChamiloApi::getWebPlatformLogoPath(); |
385 | 385 | |
386 | 386 | if ($webPlatformLogoPath !== null) { |
387 | 387 | $logoForm->addLabel( |
388 | 388 | get_lang('CurrentLogo'), |
389 | - '<img id="header-logo-custom" src="' . $webPlatformLogoPath . '?' . time() . '">' |
|
389 | + '<img id="header-logo-custom" src="'.$webPlatformLogoPath.'?'.time().'">' |
|
390 | 390 | ); |
391 | 391 | } |
392 | 392 | |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | }); |
454 | 454 | </script>'; |
455 | 455 | echo Display::tabs( |
456 | - array(get_lang('Update'),get_lang('UpdateLogo'), get_lang('UploadNewStylesheet')), |
|
456 | + array(get_lang('Update'), get_lang('UpdateLogo'), get_lang('UploadNewStylesheet')), |
|
457 | 457 | array($form_change->return_form(), $logoForm->returnForm(), $form->returnForm()) |
458 | 458 | ); |
459 | 459 | } else { |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | if (!empty($areas_to_installed)) { |
619 | 619 | $plugin_obj->remove_all_regions($plugin); |
620 | 620 | foreach ($areas_to_installed as $region) { |
621 | - if (!empty($region) && $region != '-1' ) { |
|
621 | + if (!empty($region) && $region != '-1') { |
|
622 | 622 | $plugin_obj->add_to_region($plugin, $region); |
623 | 623 | } |
624 | 624 | } |
@@ -729,14 +729,14 @@ discard block |
||
729 | 729 | $values = api_get_settings_options('search_show_unlinked_results'); |
730 | 730 | |
731 | 731 | $group = formGenerateElementsGroup($form, $values, 'search_show_unlinked_results'); |
732 | - $form->addGroup($group, 'search_show_unlinked_results', array(get_lang('SearchShowUnlinkedResultsTitle'),get_lang('SearchShowUnlinkedResultsComment')), null, false); |
|
732 | + $form->addGroup($group, 'search_show_unlinked_results', array(get_lang('SearchShowUnlinkedResultsTitle'), get_lang('SearchShowUnlinkedResultsComment')), null, false); |
|
733 | 733 | $default_values['search_show_unlinked_results'] = api_get_setting('search_show_unlinked_results'); |
734 | 734 | |
735 | 735 | $sf_values = array(); |
736 | 736 | foreach ($specific_fields as $sf) { |
737 | 737 | $sf_values[$sf['code']] = $sf['name']; |
738 | 738 | } |
739 | - $url = Display::div(Display::url(get_lang('AddSpecificSearchField'), 'specific_fields.php'), array('class'=>'sectioncomment')); |
|
739 | + $url = Display::div(Display::url(get_lang('AddSpecificSearchField'), 'specific_fields.php'), array('class'=>'sectioncomment')); |
|
740 | 740 | if (empty($sf_values)) { |
741 | 741 | $form->addElement('label', [get_lang('SearchPrefilterPrefix'), $url]); |
742 | 742 | } else { |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | if ($action != 'add') { |
832 | 832 | echo '<div class="actions" style="margin-left: 1px;">'; |
833 | 833 | echo '<a href="settings.php?category=Templates&action=add">'. |
834 | - Display::return_icon('new_template.png', get_lang('AddTemplate'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
834 | + Display::return_icon('new_template.png', get_lang('AddTemplate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
835 | 835 | echo '</div>'; |
836 | 836 | } |
837 | 837 | |
@@ -952,8 +952,8 @@ discard block |
||
952 | 952 | * @since v1.8.6 |
953 | 953 | */ |
954 | 954 | function actionsFilter($id) { |
955 | - $return = '<a href="settings.php?category=Templates&action=edit&id='.Security::remove_XSS($id).'">'.Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'; |
|
956 | - $return .= '<a href="settings.php?category=Templates&action=delete&id='.Security::remove_XSS($id).'" onClick="javascript:if(!confirm('."'".get_lang('ConfirmYourChoice')."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
955 | + $return = '<a href="settings.php?category=Templates&action=edit&id='.Security::remove_XSS($id).'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
|
956 | + $return .= '<a href="settings.php?category=Templates&action=delete&id='.Security::remove_XSS($id).'" onClick="javascript:if(!confirm('."'".get_lang('ConfirmYourChoice')."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
957 | 957 | return $return; |
958 | 958 | } |
959 | 959 | |
@@ -1005,7 +1005,7 @@ discard block |
||
1005 | 1005 | $form->addElement('html_editor', 'template_text', get_lang('Text'), null, array('ToolbarSet' => 'AdminTemplates', 'Width' => '100%', 'Height' => '400')); |
1006 | 1006 | |
1007 | 1007 | // Setting the form elements: the form to upload an image to be used with the template. |
1008 | - $form->addElement('file','template_image',get_lang('Image'),''); |
|
1008 | + $form->addElement('file', 'template_image', get_lang('Image'), ''); |
|
1009 | 1009 | |
1010 | 1010 | // Setting the form elements: a little bit information about the template image. |
1011 | 1011 | $form->addElement('static', 'file_comment', '', get_lang('TemplateImageComment100x70')); |
@@ -1029,10 +1029,10 @@ discard block |
||
1029 | 1029 | // Adding an extra field: a preview of the image that is currently used. |
1030 | 1030 | if (!empty($row['image'])) { |
1031 | 1031 | $form->addElement('static', 'template_image_preview', '', |
1032 | - '<img src="' . api_get_path(WEB_APP_PATH) . 'home/default_platform_document/template_thumb/' . $row['image'] . '" alt="' . get_lang('TemplatePreview') . '"/>'); |
|
1032 | + '<img src="'.api_get_path(WEB_APP_PATH).'home/default_platform_document/template_thumb/'.$row['image'].'" alt="'.get_lang('TemplatePreview').'"/>'); |
|
1033 | 1033 | } else { |
1034 | 1034 | $form->addElement('static', 'template_image_preview', '', |
1035 | - '<img src="' . api_get_path(WEB_APP_PATH) . 'home/default_platform_document/template_thumb/noimage.gif" alt="' . get_lang('NoTemplatePreview') . '"/>'); |
|
1035 | + '<img src="'.api_get_path(WEB_APP_PATH).'home/default_platform_document/template_thumb/noimage.gif" alt="'.get_lang('NoTemplatePreview').'"/>'); |
|
1036 | 1036 | } |
1037 | 1037 | |
1038 | 1038 | // Setting the information of the template that we are editing. |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | // Store the information in the database (as insert or as update). |
1086 | 1086 | $table_system_template = Database :: get_main_table('system_template'); |
1087 | 1087 | if ($_GET['action'] == 'add') { |
1088 | - $content_template = Security::remove_XSS($values['template_text'], COURSEMANAGERLOWSECURITY); |
|
1088 | + $content_template = Security::remove_XSS($values['template_text'], COURSEMANAGERLOWSECURITY); |
|
1089 | 1089 | $params = [ |
1090 | 1090 | 'title' => $values['title'], |
1091 | 1091 | 'content' => $content_template, |
@@ -1095,7 +1095,7 @@ discard block |
||
1095 | 1095 | |
1096 | 1096 | // Display a feedback message. |
1097 | 1097 | Display::display_confirmation_message(get_lang('TemplateAdded')); |
1098 | - echo '<a href="settings.php?category=Templates&action=add">'.Display::return_icon('new_template.png', get_lang('AddTemplate'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
1098 | + echo '<a href="settings.php?category=Templates&action=add">'.Display::return_icon('new_template.png', get_lang('AddTemplate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
1099 | 1099 | } else { |
1100 | 1100 | $content_template = '<head>{CSS}<style type="text/css">.text{font-weight: normal;}</style></head><body>'.Database::escape_string($values['template_text']).'</body>'; |
1101 | 1101 | $sql = "UPDATE $table_system_template set title = '".Database::escape_string($values['title'])."', content = '".$content_template."'"; |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | displayTemplates(); |
1114 | 1114 | } else { |
1115 | 1115 | $token = Security::get_token(); |
1116 | - $form->addElement('hidden','sec_token'); |
|
1116 | + $form->addElement('hidden', 'sec_token'); |
|
1117 | 1117 | $form->setConstants(array('sec_token' => $token)); |
1118 | 1118 | // Display the form. |
1119 | 1119 | $form->display(); |
@@ -1248,13 +1248,13 @@ discard block |
||
1248 | 1248 | $form->addElement( |
1249 | 1249 | 'html', |
1250 | 1250 | '<div class="pull-right"><a class="share_this_setting" data_status = "0" data_to_send = "'.$row['variable'].'" href="javascript:void(0);">'. |
1251 | - Display::return_icon('shared_setting.png', get_lang('ChangeSharedSetting') , null, ICON_SIZE_MEDIUM).'</a></div>' |
|
1251 | + Display::return_icon('shared_setting.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM).'</a></div>' |
|
1252 | 1252 | ); |
1253 | 1253 | } else { |
1254 | 1254 | $form->addElement( |
1255 | 1255 | 'html', |
1256 | 1256 | '<div class="pull-right"><a class="share_this_setting" data_status = "1" data_to_send = "'.$row['variable'].'" href="javascript:void(0);">'. |
1257 | - Display::return_icon('shared_setting_na.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM ).'</a></div>' |
|
1257 | + Display::return_icon('shared_setting_na.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM).'</a></div>' |
|
1258 | 1258 | ); |
1259 | 1259 | } |
1260 | 1260 | } else { |
@@ -1262,13 +1262,13 @@ discard block |
||
1262 | 1262 | $form->addElement( |
1263 | 1263 | 'html', |
1264 | 1264 | '<div class="pull-right">'. |
1265 | - Display::return_icon('shared_setting.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM ).'</div>' |
|
1265 | + Display::return_icon('shared_setting.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM).'</div>' |
|
1266 | 1266 | ); |
1267 | 1267 | } else { |
1268 | 1268 | $form->addElement( |
1269 | 1269 | 'html', |
1270 | 1270 | '<div class="pull-right">'. |
1271 | - Display::return_icon('shared_setting_na.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM ).'</div>' |
|
1271 | + Display::return_icon('shared_setting_na.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM).'</div>' |
|
1272 | 1272 | ); |
1273 | 1273 | } |
1274 | 1274 | } |
@@ -1320,7 +1320,7 @@ discard block |
||
1320 | 1320 | array('maxlength' => '8') |
1321 | 1321 | ); |
1322 | 1322 | $form->applyFilter($row['variable'], 'html_filter'); |
1323 | - $default_values[$row['variable']] = round($row['selected_value']/1024/1024, 1); |
|
1323 | + $default_values[$row['variable']] = round($row['selected_value'] / 1024 / 1024, 1); |
|
1324 | 1324 | } elseif ($row['variable'] == 'account_valid_duration') { |
1325 | 1325 | $form->addElement( |
1326 | 1326 | 'text', |
@@ -1348,7 +1348,7 @@ discard block |
||
1348 | 1348 | ), |
1349 | 1349 | $hideme |
1350 | 1350 | ); |
1351 | - $form->applyFilter($row['variable'],'html_filter'); |
|
1351 | + $form->applyFilter($row['variable'], 'html_filter'); |
|
1352 | 1352 | $default_values[$row['variable']] = $row['selected_value']; |
1353 | 1353 | } |
1354 | 1354 | break; |
@@ -1359,7 +1359,7 @@ discard block |
||
1359 | 1359 | if (file_exists($file)) { |
1360 | 1360 | $value = file_get_contents($file); |
1361 | 1361 | } |
1362 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1362 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1363 | 1363 | $default_values[$row['variable']] = $value; |
1364 | 1364 | } elseif ($row['variable'] == 'footer_extra_content') { |
1365 | 1365 | $file = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt'; |
@@ -1367,16 +1367,16 @@ discard block |
||
1367 | 1367 | if (file_exists($file)) { |
1368 | 1368 | $value = file_get_contents($file); |
1369 | 1369 | } |
1370 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1370 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1371 | 1371 | $default_values[$row['variable']] = $value; |
1372 | 1372 | } else { |
1373 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1373 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1374 | 1374 | $default_values[$row['variable']] = $row['selected_value']; |
1375 | 1375 | } |
1376 | 1376 | break; |
1377 | 1377 | case 'radio': |
1378 | 1378 | $values = api_get_settings_options($row['variable']); |
1379 | - $group = array (); |
|
1379 | + $group = array(); |
|
1380 | 1380 | if (is_array($values)) { |
1381 | 1381 | foreach ($values as $key => $value) { |
1382 | 1382 | $element = &$form->createElement( |
@@ -1407,7 +1407,7 @@ discard block |
||
1407 | 1407 | WHERE variable='".$row['variable']."' AND access_url = 1"; |
1408 | 1408 | |
1409 | 1409 | $result = Database::query($sql); |
1410 | - $group = array (); |
|
1410 | + $group = array(); |
|
1411 | 1411 | while ($rowkeys = Database::fetch_array($result)) { |
1412 | 1412 | // Profile tab option should be hidden when the social tool is enabled. |
1413 | 1413 | if (api_get_setting('allow_social_tool') == 'true') { |
@@ -1464,7 +1464,7 @@ discard block |
||
1464 | 1464 | break; |
1465 | 1465 | case 'link': |
1466 | 1466 | $form->addElement('static', null, array(get_lang($row['title']), get_lang($row['comment'])), |
1467 | - get_lang('CurrentValue') . ' : ' . $row['selected_value'], $hideme); |
|
1467 | + get_lang('CurrentValue').' : '.$row['selected_value'], $hideme); |
|
1468 | 1468 | break; |
1469 | 1469 | case 'select': |
1470 | 1470 | /* |
@@ -1496,7 +1496,7 @@ discard block |
||
1496 | 1496 | $row['variable'], |
1497 | 1497 | [get_lang($row['title']), get_lang($row['comment'])], |
1498 | 1498 | $courseSelectOptions, |
1499 | - ['url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course'] |
|
1499 | + ['url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course'] |
|
1500 | 1500 | ); |
1501 | 1501 | $default_values[$row['variable']] = $row['selected_value']; |
1502 | 1502 | break; |
@@ -1504,10 +1504,10 @@ discard block |
||
1504 | 1504 | |
1505 | 1505 | switch ($row['variable']) { |
1506 | 1506 | case 'pdf_export_watermark_enable': |
1507 | - $url = PDF::get_watermark(null); |
|
1507 | + $url = PDF::get_watermark(null); |
|
1508 | 1508 | |
1509 | 1509 | if ($url != false) { |
1510 | - $delete_url = '<a href="?delete_watermark">'.get_lang('DelImage').' '.Display::return_icon('delete.png',get_lang('DelImage')).'</a>'; |
|
1510 | + $delete_url = '<a href="?delete_watermark">'.get_lang('DelImage').' '.Display::return_icon('delete.png', get_lang('DelImage')).'</a>'; |
|
1511 | 1511 | $form->addElement('html', '<div style="max-height:100px; max-width:100px; margin-left:162px; margin-bottom:10px; clear:both;"><img src="'.$url.'" style="margin-bottom:10px;" />'.$delete_url.'</div>'); |
1512 | 1512 | } |
1513 | 1513 | |
@@ -1661,7 +1661,7 @@ discard block |
||
1661 | 1661 | if (api_is_windows_os() == false) { |
1662 | 1662 | $list_of_programs = array('pdftotext', 'ps2pdf', 'catdoc', 'html2text', 'unrtf', 'catppt', 'xls2csv'); |
1663 | 1663 | |
1664 | - foreach($list_of_programs as $program) { |
|
1664 | + foreach ($list_of_programs as $program) { |
|
1665 | 1665 | $output = []; |
1666 | 1666 | $ret_val = null; |
1667 | 1667 | exec("which $program", $output, $ret_val); |
@@ -1674,7 +1674,7 @@ discard block |
||
1674 | 1674 | if (!empty($output[0])) { |
1675 | 1675 | $icon = Display::return_icon('bullet_green.png', get_lang('Installed')); |
1676 | 1676 | } |
1677 | - $data2[]= array($program, $output[0], $icon); |
|
1677 | + $data2[] = array($program, $output[0], $icon); |
|
1678 | 1678 | } |
1679 | 1679 | echo Display::tag('h3', get_lang('ProgramsNeededToConvertFiles')); |
1680 | 1680 | $table = new SortableTableFromArray($data2); |
@@ -1700,9 +1700,9 @@ discard block |
||
1700 | 1700 | if (is_dir($dir)) { |
1701 | 1701 | $zip = new PclZip($arch); |
1702 | 1702 | // Remove path prefix except the style name and put file on disk |
1703 | - $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, substr($dir,0,-strlen($style))); |
|
1703 | + $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, substr($dir, 0, -strlen($style))); |
|
1704 | 1704 | //@TODO: use more generic script to download. |
1705 | - $str = '<a class="btn btn-primary btn-large" href="' . api_get_path(WEB_CODE_PATH) . 'course_info/download.php?archive=' . str_replace(api_get_path(SYS_ARCHIVE_PATH), '', $arch) . '">'.get_lang('ClickHereToDownloadTheFile').'</a>'; |
|
1705 | + $str = '<a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.str_replace(api_get_path(SYS_ARCHIVE_PATH), '', $arch).'">'.get_lang('ClickHereToDownloadTheFile').'</a>'; |
|
1706 | 1706 | Display::display_normal_message($str, false); |
1707 | 1707 | } else { |
1708 | 1708 | Display::addFlash(Display::return_message(get_lang('FileNotFound'), 'warning')); |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * Gets an array of options for a specific field |
413 | 413 | * @param int $field_id The field ID |
414 | 414 | * @param bool $add_id_in_array Whether to add the row ID in the result |
415 | - * @param null $ordered_by Extra ordering query bit |
|
415 | + * @param null|string $ordered_by Extra ordering query bit |
|
416 | 416 | * @return array The options if they exists. Otherwise return false |
417 | 417 | */ |
418 | 418 | public function get_field_options_by_field($field_id, $add_id_in_array = false, $ordered_by = null) |
@@ -782,8 +782,8 @@ discard block |
||
782 | 782 | } |
783 | 783 | |
784 | 784 | /** |
785 | - * @param $defaultDisplayText |
|
786 | - * @return mixed|string |
|
785 | + * @param string $defaultDisplayText |
|
786 | + * @return string |
|
787 | 787 | */ |
788 | 788 | public static function getLanguageVariable($defaultDisplayText) |
789 | 789 | { |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | foreach ($sub_options as $sub_option) { |
218 | 218 | if (!empty($sub_option)) { |
219 | - $new_params = array( |
|
219 | + $new_params = array( |
|
220 | 220 | 'field_id' => $field_id, |
221 | 221 | 'option_value' => $sub_id, |
222 | 222 | 'display_text' => $sub_option, |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | $form->addElement('hidden', 'field_id', $this->field_id); |
661 | 661 | |
662 | 662 | if ($action == 'edit') { |
663 | - $translateUrl = api_get_path(WEB_CODE_PATH) . 'extrafield/translate.php?' . http_build_query([ |
|
663 | + $translateUrl = api_get_path(WEB_CODE_PATH).'extrafield/translate.php?'.http_build_query([ |
|
664 | 664 | 'extra_field_option' => $id |
665 | 665 | ]); |
666 | 666 | $translateButton = Display::toolbarButton(get_lang('TranslateThisTerm'), $translateUrl, 'language', 'link'); |
@@ -954,7 +954,7 @@ |
||
954 | 954 | /** |
955 | 955 | * This function has been created for avoiding changes directly within QuickForm class. |
956 | 956 | * When we use it, the element is threated as 'required' to be dealt during validation. |
957 | - * @param array $element The array of elements |
|
957 | + * @param array $elements The array of elements |
|
958 | 958 | * @param string $message The message displayed |
959 | 959 | */ |
960 | 960 | public function add_multiple_required_rule($elements, $message) |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $renderer->setHeaderTemplate('<legend>{header}</legend>'); |
100 | 100 | |
101 | 101 | //Set required field template |
102 | - $this->setRequiredNote('<span class="form_required">*</span> <small>' . get_lang('ThisFieldIsRequired') . '</small>'); |
|
102 | + $this->setRequiredNote('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>'); |
|
103 | 103 | $noteTemplate = <<<EOT |
104 | 104 | <div class="form-group"> |
105 | 105 | <div class="col-sm-offset-2 col-sm-10">{requiredNote}</div> |
@@ -902,8 +902,8 @@ discard block |
||
902 | 902 | $this->with_progress_bar = true; |
903 | 903 | $id = $this->getAttribute('id'); |
904 | 904 | |
905 | - $this->updateAttributes("onsubmit=\"javascript: addProgress('" . $id . "')\""); |
|
906 | - $this->addHtml('<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/upload.js" type="text/javascript"></script>'); |
|
905 | + $this->updateAttributes("onsubmit=\"javascript: addProgress('".$id."')\""); |
|
906 | + $this->addHtml('<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/upload.js" type="text/javascript"></script>'); |
|
907 | 907 | } |
908 | 908 | |
909 | 909 | /** |
@@ -1402,7 +1402,7 @@ discard block |
||
1402 | 1402 | .prop('href', file.url); |
1403 | 1403 | $(data.context.children()[index]).parent().wrap(link); |
1404 | 1404 | |
1405 | - var successMessage = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-success\"/>').text('" . addslashes(get_lang('UplUploadSucceeded')) . "')); |
|
1405 | + var successMessage = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-success\"/>').text('" . addslashes(get_lang('UplUploadSucceeded'))."')); |
|
1406 | 1406 | $(data.context.children()[index]).parent().append(successMessage); |
1407 | 1407 | } else if (file.error) { |
1408 | 1408 | var error = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-danger\"/>').text(file.error)); |
@@ -1411,7 +1411,7 @@ discard block |
||
1411 | 1411 | }); |
1412 | 1412 | }).on('fileuploadfail', function (e, data) { |
1413 | 1413 | $.each(data.files, function (index) { |
1414 | - var failedMessage = '" . addslashes(get_lang('UplUploadFailed')) . "'; |
|
1414 | + var failedMessage = '" . addslashes(get_lang('UplUploadFailed'))."'; |
|
1415 | 1415 | var error = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-danger\"/>').text(failedMessage)); |
1416 | 1416 | $(data.context.children()[index]).parent().append(error); |
1417 | 1417 | }); |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | "</td>\n". |
127 | 127 | "<td>\n". |
128 | 128 | "<select name=\"image\">\n". |
129 | - "<option selected>". $image. "</option>\n"; |
|
129 | + "<option selected>".$image."</option>\n"; |
|
130 | 130 | |
131 | 131 | if ($dir = @opendir($chemin)) { |
132 | 132 | while ($file = readdir($dir)) { |
133 | 133 | if ($file == '..' || $file == '.') { |
134 | 134 | unset($file); |
135 | 135 | } |
136 | - $content .= "<option>". $file. "</option>\n"; |
|
136 | + $content .= "<option>".$file."</option>\n"; |
|
137 | 137 | } |
138 | 138 | closedir($dir); |
139 | 139 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | "</td>\n". |
143 | 143 | "</tr>\n". |
144 | 144 | "<tr>\n". |
145 | - "<td>". get_lang('NameOfTheLink'). " : </td>\n". |
|
146 | - "<td><input type=\"text\" name=\"name\" value=\"". $name. "\"></td>\n". |
|
145 | + "<td>".get_lang('NameOfTheLink')." : </td>\n". |
|
146 | + "<td><input type=\"text\" name=\"name\" value=\"".$name."\"></td>\n". |
|
147 | 147 | "</tr>\n". |
148 | 148 | "<tr>\n". |
149 | 149 | "<td>Lien :</td>\n". |
150 | - "<td><input type=\"text\" name=\"link\" value=\"". $link. "\"></td>\n". |
|
150 | + "<td><input type=\"text\" name=\"link\" value=\"".$link."\"></td>\n". |
|
151 | 151 | "</tr>\n". |
152 | 152 | "<tr>\n". |
153 | - "<td colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"". get_lang('Ok'). "\"></td>\n". |
|
153 | + "<td colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"".get_lang('Ok')."\"></td>\n". |
|
154 | 154 | "</tr>\n". |
155 | 155 | "</form>\n". |
156 | 156 | "</table>\n". |
@@ -203,21 +203,21 @@ discard block |
||
203 | 203 | "<tr><td colspan=\"6\"><font color=\"#F66105\">\n".get_lang('CourseAdminOnly')."</font> |
204 | 204 | </td></tr>\n"; |
205 | 205 | $content .= "<tr>\n<td colspan=\"6\">"; |
206 | - $content .=CourseHome::show_tool_3column('courseAdmin'); |
|
206 | + $content .= CourseHome::show_tool_3column('courseAdmin'); |
|
207 | 207 | $content .= "</td>\n</tr>\n"; |
208 | 208 | } |
209 | 209 | |
210 | 210 | /* TOOLS FOR PLATFORM ADMIN ONLY */ |
211 | 211 | if (api_is_platform_admin() && api_is_allowed_to_edit(null, true) && !api_is_coach()) { |
212 | - $content .= "<tr>"."<td colspan=\"6\">". |
|
212 | + $content .= "<tr>"."<td colspan=\"6\">". |
|
213 | 213 | "<hr noshade size=\"1\" />". |
214 | 214 | "</td>"."</tr>\n". |
215 | 215 | "<tr>\n"."<td colspan=\"6\">\n". |
216 | - "<font color=\"#F66105\" >". get_lang('PlatformAdminOnly'). "</font>\n". |
|
216 | + "<font color=\"#F66105\" >".get_lang('PlatformAdminOnly')."</font>\n". |
|
217 | 217 | "</td>\n"."</tr>\n"; |
218 | - $content .= "<tr>\n<td colspan=\"6\">"; |
|
218 | + $content .= "<tr>\n<td colspan=\"6\">"; |
|
219 | 219 | $content .= CourseHome::show_tool_3column('platformAdmin'); |
220 | - $content .= "</td>\n</tr>\n"; |
|
220 | + $content .= "</td>\n</tr>\n"; |
|
221 | 221 | } |
222 | 222 | |
223 | -$content .= "</table>\n"; |
|
223 | +$content .= "</table>\n"; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | // Show message to confirm that a tool it to be hidden from available tools |
57 | 57 | // visibility 0,1->2 |
58 | 58 | if (!empty($_GET['askDelete'])) { |
59 | - $content .='<div id="toolhide">'.get_lang('DelLk').'<br /> |
|
59 | + $content .= '<div id="toolhide">'.get_lang('DelLk').'<br /> |
|
60 | 60 | <a href="'.api_get_self().'">'.get_lang('No').'</a> | |
61 | 61 | <a href="'.api_get_self().'?delete=yes&id='.intval($_GET['id']).'">'.get_lang('Yes').'</a> |
62 | 62 | </div>'; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | /* INACTIVE TOOLS - HIDDEN (GREY) LINKS */ |
94 | 94 | |
95 | - $content .= "<tr><td colspan=\"4\"><hr style='color:\"#4171B5\"' noshade=\"noshade\" size=\"1\" /></td></tr>\n". |
|
95 | + $content .= "<tr><td colspan=\"4\"><hr style='color:\"#4171B5\"' noshade=\"noshade\" size=\"1\" /></td></tr>\n". |
|
96 | 96 | "<tr>\n". |
97 | 97 | "<td colspan=\"4\">\n". |
98 | 98 | "<div style=\"margin-bottom: 10px;\"><font color=\"#808080\">\n".get_lang('InLnk')."</font></div>". |
@@ -101,14 +101,14 @@ discard block |
||
101 | 101 | |
102 | 102 | $content .= CourseHome::show_tool_2column(TOOL_PUBLIC_BUT_HIDDEN); |
103 | 103 | |
104 | - $content .= "</table>"; |
|
105 | - $content .= "</div> "; |
|
104 | + $content .= "</table>"; |
|
105 | + $content .= "</div> "; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /* Tools for platform admin only */ |
109 | 109 | |
110 | 110 | if (api_is_platform_admin() && api_is_allowed_to_edit(null, true) && !api_is_coach()) { |
111 | - $content .='<div class="platformadminview"> |
|
111 | + $content .= '<div class="platformadminview"> |
|
112 | 112 | <span class="viewcaption">'.get_lang('PlatformAdminOnly').'</span> |
113 | 113 | <table width="100%"> |
114 | 114 | '.CourseHome::show_tool_2column(TOOL_PLATFORM_ADMIN).' |