@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | $newstudents = $evaluation[0]->get_not_subscribed_students(); |
19 | 19 | |
20 | 20 | if (count($newstudents) == '0') { |
21 | - header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
22 | - exit; |
|
21 | + header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
22 | + exit; |
|
23 | 23 | } |
24 | 24 | $add_user_form = new EvalForm( |
25 | 25 | EvalForm :: TYPE_ADD_USERS_TO_EVAL, |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | |
68 | 68 | $interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook')); |
69 | 69 | $interbreadcrumb[]= array( |
70 | - 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
71 | - 'name' => get_lang('ViewResult') |
|
70 | + 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
71 | + 'name' => get_lang('ViewResult') |
|
72 | 72 | ); |
73 | 73 | Display :: display_header(get_lang('AddUserToEval')); |
74 | 74 | if (isset ($_GET['erroroneuser'])){ |
75 | - Display :: display_warning_message(get_lang('AtLeastOneUser'),false); |
|
75 | + Display :: display_warning_message(get_lang('AtLeastOneUser'),false); |
|
76 | 76 | } |
77 | 77 | DisplayGradebook :: display_header_result($evaluation[0], null, 0,0); |
78 | 78 | echo '<div class="main">'; |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | api_block_anonymous_users(); |
15 | 15 | GradebookUtils::block_students(); |
16 | 16 | |
17 | -$evaluation= Evaluation :: load($_GET['selecteval']); |
|
17 | +$evaluation = Evaluation :: load($_GET['selecteval']); |
|
18 | 18 | $newstudents = $evaluation[0]->get_not_subscribed_students(); |
19 | 19 | |
20 | 20 | if (count($newstudents) == '0') { |
21 | - header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
21 | + header('Location: gradebook_view_result.php?nouser=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
22 | 22 | exit; |
23 | 23 | } |
24 | 24 | $add_user_form = new EvalForm( |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
68 | -$interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook')); |
|
69 | -$interbreadcrumb[]= array( |
|
70 | - 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
68 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('Gradebook')); |
|
69 | +$interbreadcrumb[] = array( |
|
70 | + 'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
71 | 71 | 'name' => get_lang('ViewResult') |
72 | 72 | ); |
73 | 73 | Display :: display_header(get_lang('AddUserToEval')); |
74 | -if (isset ($_GET['erroroneuser'])){ |
|
75 | - Display :: display_warning_message(get_lang('AtLeastOneUser'),false); |
|
74 | +if (isset ($_GET['erroroneuser'])) { |
|
75 | + Display :: display_warning_message(get_lang('AtLeastOneUser'), false); |
|
76 | 76 | } |
77 | -DisplayGradebook :: display_header_result($evaluation[0], null, 0,0); |
|
77 | +DisplayGradebook :: display_header_result($evaluation[0], null, 0, 0); |
|
78 | 78 | echo '<div class="main">'; |
79 | 79 | echo $add_user_form->toHtml(); |
80 | 80 | echo '</div>'; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | foreach ($userSkills as $skill) { |
34 | 34 | $skillId = current($skill); |
35 | 35 | |
36 | - $assertionUrl = api_get_path(WEB_CODE_PATH) . "badge/assertion.php?"; |
|
36 | + $assertionUrl = api_get_path(WEB_CODE_PATH)."badge/assertion.php?"; |
|
37 | 37 | $assertionUrl .= http_build_query(array( |
38 | 38 | 'user' => $userId, |
39 | 39 | 'skill' => $skillId, |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $backpack = $configBackpack; |
52 | 52 | } |
53 | 53 | |
54 | -$htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>'; |
|
54 | +$htmlHeadXtra[] = '<script src="'.$backpack.'issuer.js"></script>'; |
|
55 | 55 | |
56 | 56 | $tpl = new Template(get_lang('Badges'), false, false); |
57 | 57 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | 'content', |
60 | 60 | "<script> |
61 | 61 | $(document).on('ready', function (){ |
62 | - OpenBadges.issue_no_modal(" . json_encode($assertions) . "); |
|
62 | + OpenBadges.issue_no_modal(" . json_encode($assertions)."); |
|
63 | 63 | }); |
64 | 64 | </script>" |
65 | 65 | ); |
@@ -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'); |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | api_block_anonymous_users(); |
10 | 10 | |
11 | 11 | if (isset($_GET['messages_page_nr'])) { |
12 | - if (api_get_setting('allow_social_tool')=='true' && |
|
13 | - api_get_setting('allow_message_tool')=='true' |
|
12 | + if (api_get_setting('allow_social_tool') == 'true' && |
|
13 | + api_get_setting('allow_message_tool') == 'true' |
|
14 | 14 | ) { |
15 | 15 | $social_link = ''; |
16 | - if ($_REQUEST['f']=='social') { |
|
16 | + if ($_REQUEST['f'] == 'social') { |
|
17 | 17 | $social_link = '&f=social'; |
18 | 18 | } |
19 | 19 | header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.''); |
@@ -51,46 +51,46 @@ discard block |
||
51 | 51 | */ |
52 | 52 | if (isset($_GET['f']) && $_GET['f'] === 'social') { |
53 | 53 | $this_section = SECTION_SOCIAL; |
54 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
55 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
54 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social')); |
|
55 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox')); |
|
56 | 56 | } else { |
57 | 57 | $this_section = SECTION_MYPROFILE; |
58 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
59 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
58 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile')); |
|
59 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox')); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $actions = ''; |
63 | 63 | if (api_get_setting('extended_profile') == 'true') { |
64 | 64 | if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
65 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
65 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
66 | 66 | Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
67 | 67 | } |
68 | 68 | if (api_get_setting('allow_message_tool') == 'true') { |
69 | 69 | //echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>'; |
70 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
71 | - Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
|
72 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
|
73 | - Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
|
74 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
|
75 | - Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
|
70 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
71 | + Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; |
|
72 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
|
73 | + Display::return_icon('inbox.png', get_lang('Inbox')).'</a>'; |
|
74 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
|
75 | + Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | 79 | |
80 | -$info_delete_outbox =array(); |
|
81 | -$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',',$_GET['form_delete_outbox']) : ''; |
|
80 | +$info_delete_outbox = array(); |
|
81 | +$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',', $_GET['form_delete_outbox']) : ''; |
|
82 | 82 | $count_delete_outbox = count($info_delete_outbox) - 1; |
83 | 83 | |
84 | 84 | if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0]) == 'delete') { |
85 | 85 | for ($i = 1; $i <= $count_delete_outbox; $i++) { |
86 | - MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]); |
|
86 | + MessageManager::delete_message_by_user_sender(api_get_user_id(), $info_delete_outbox[$i]); |
|
87 | 87 | } |
88 | - $message_box=get_lang('SelectedMessagesDeleted'). |
|
88 | + $message_box = get_lang('SelectedMessagesDeleted'). |
|
89 | 89 | '  |
90 | 90 | <br><a href="../social/index.php?#remote-tab-3">'. |
91 | 91 | get_lang('BackToOutbox'). |
92 | 92 | '</a>'; |
93 | - Display::display_normal_message(api_xml_http_response_encode($message_box),false); |
|
93 | + Display::display_normal_message(api_xml_http_response_encode($message_box), false); |
|
94 | 94 | exit; |
95 | 95 | } |
96 | 96 | |
@@ -117,23 +117,23 @@ discard block |
||
117 | 117 | } |
118 | 118 | //MAIN CONTENT |
119 | 119 | if ($action == 'delete') { |
120 | - $delete_list_id=array(); |
|
120 | + $delete_list_id = array(); |
|
121 | 121 | if (isset($_POST['out'])) { |
122 | - $delete_list_id=$_POST['out']; |
|
122 | + $delete_list_id = $_POST['out']; |
|
123 | 123 | } |
124 | 124 | if (isset($_POST['id'])) { |
125 | - $delete_list_id=$_POST['id']; |
|
125 | + $delete_list_id = $_POST['id']; |
|
126 | 126 | } |
127 | 127 | for ($i = 0; $i < count($delete_list_id); $i++) { |
128 | 128 | MessageManager::delete_message_by_user_sender(api_get_user_id(), $delete_list_id[$i]); |
129 | 129 | } |
130 | - $delete_list_id=array(); |
|
130 | + $delete_list_id = array(); |
|
131 | 131 | $social_right_content .= MessageManager::outbox_display($keyword); |
132 | 132 | } elseif ($action == 'deleteone') { |
133 | 133 | $delete_list_id = array(); |
134 | 134 | $id = Security::remove_XSS($_GET['id']); |
135 | 135 | MessageManager::delete_message_by_user_sender(api_get_user_id(), $id); |
136 | - $delete_list_id=array(); |
|
136 | + $delete_list_id = array(); |
|
137 | 137 | $social_right_content .= MessageManager::outbox_display($keyword); |
138 | 138 | } else { |
139 | 139 | $social_right_content .= MessageManager::outbox_display($keyword); |
@@ -9,20 +9,20 @@ discard block |
||
9 | 9 | api_block_anonymous_users(); |
10 | 10 | |
11 | 11 | if (isset($_GET['messages_page_nr'])) { |
12 | - if (api_get_setting('allow_social_tool')=='true' && |
|
12 | + if (api_get_setting('allow_social_tool')=='true' && |
|
13 | 13 | api_get_setting('allow_message_tool')=='true' |
14 | 14 | ) { |
15 | - $social_link = ''; |
|
16 | - if ($_REQUEST['f']=='social') { |
|
17 | - $social_link = '&f=social'; |
|
18 | - } |
|
19 | - header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.''); |
|
20 | - exit; |
|
21 | - } |
|
15 | + $social_link = ''; |
|
16 | + if ($_REQUEST['f']=='social') { |
|
17 | + $social_link = '&f=social'; |
|
18 | + } |
|
19 | + header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.''); |
|
20 | + exit; |
|
21 | + } |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | if (api_get_setting('allow_message_tool') != 'true') { |
25 | - api_not_allowed(); |
|
25 | + api_not_allowed(); |
|
26 | 26 | } |
27 | 27 | //jquery thickbox already called from main/inc/header.inc.php |
28 | 28 | |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | MAIN CODE |
51 | 51 | */ |
52 | 52 | if (isset($_GET['f']) && $_GET['f'] === 'social') { |
53 | - $this_section = SECTION_SOCIAL; |
|
54 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
55 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
53 | + $this_section = SECTION_SOCIAL; |
|
54 | + $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
55 | + $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
56 | 56 | } else { |
57 | - $this_section = SECTION_MYPROFILE; |
|
58 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
59 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
57 | + $this_section = SECTION_MYPROFILE; |
|
58 | + $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
59 | + $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $actions = ''; |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | |
84 | 84 | if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0]) == 'delete') { |
85 | 85 | for ($i = 1; $i <= $count_delete_outbox; $i++) { |
86 | - MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]); |
|
87 | - } |
|
86 | + MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]); |
|
87 | + } |
|
88 | 88 | $message_box=get_lang('SelectedMessagesDeleted'). |
89 | 89 | '  |
90 | 90 | <br><a href="../social/index.php?#remote-tab-3">'. |
@@ -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 | { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | // Plugins NOT installed |
150 | 150 | echo Display::page_subheader(get_lang('Plugins')); |
151 | - echo '<form class="form-horizontal" name="plugins" method="post" action="'.api_get_self().'?category='.Security::remove_XSS($_GET['category']).'&sec_token=' . $token . '">'; |
|
151 | + echo '<form class="form-horizontal" name="plugins" method="post" action="'.api_get_self().'?category='.Security::remove_XSS($_GET['category']).'&sec_token='.$token.'">'; |
|
152 | 152 | echo '<table class="data_table">'; |
153 | 153 | echo '<tr>'; |
154 | 154 | echo '<th width="20px">'; |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | if (file_exists(api_get_path(SYS_PLUGIN_PATH).$pluginName.'/readme.txt')) { |
198 | 198 | echo Display::url( |
199 | 199 | "<em class='fa fa-file-text-o'></em> readme.txt", |
200 | - api_get_path(WEB_PLUGIN_PATH) . $pluginName . "/readme.txt", |
|
200 | + api_get_path(WEB_PLUGIN_PATH).$pluginName."/readme.txt", |
|
201 | 201 | [ |
202 | 202 | 'class' => 'btn btn-default ajax', |
203 | 203 | 'data-title' => $plugin_info['title'], |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $form->addElement('file', 'new_stylesheet', get_lang('UploadNewStylesheet')); |
261 | 261 | $allowed_file_types = getAllowedFileTypes(); |
262 | 262 | |
263 | - $form->addRule('new_stylesheet', get_lang('InvalidExtension') . ' (' . implode(',', $allowed_file_types) . ')', |
|
263 | + $form->addRule('new_stylesheet', get_lang('InvalidExtension').' ('.implode(',', $allowed_file_types).')', |
|
264 | 264 | 'filetype', $allowed_file_types); |
265 | 265 | $form->addRule('new_stylesheet', get_lang('ThisFieldIsRequired'), 'required'); |
266 | 266 | $form->addButtonUpload(get_lang('Upload'), 'stylesheet_upload'); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $show_name = ucwords(str_replace('_', ' ', $style_dir)); |
348 | 348 | |
349 | 349 | if ($is_style_changeable) { |
350 | - $list_of_names[$style_dir] = $show_name; |
|
350 | + $list_of_names[$style_dir] = $show_name; |
|
351 | 351 | } |
352 | 352 | $counter++; |
353 | 353 | } |
@@ -387,16 +387,16 @@ discard block |
||
387 | 387 | Display::return_message(sprintf(get_lang('TheLogoMustBeSizeXAndFormatY'), '250 x 70', 'PNG'), 'info') |
388 | 388 | ); |
389 | 389 | |
390 | - $dir = api_get_path(SYS_PUBLIC_PATH).'css/themes/' . $selected . '/images/'; |
|
391 | - $url = api_get_path(WEB_CSS_PATH).'themes/' . $selected . '/images/'; |
|
390 | + $dir = api_get_path(SYS_PUBLIC_PATH).'css/themes/'.$selected.'/images/'; |
|
391 | + $url = api_get_path(WEB_CSS_PATH).'themes/'.$selected.'/images/'; |
|
392 | 392 | $logoFileName = 'header-logo.png'; |
393 | - $newLogoFileName = 'header-logo-custom' . api_get_current_access_url_id() . '.png'; |
|
393 | + $newLogoFileName = 'header-logo-custom'.api_get_current_access_url_id().'.png'; |
|
394 | 394 | $webPlatformLogoPath = ChamiloApi::getWebPlatformLogoPath(); |
395 | 395 | |
396 | 396 | if ($webPlatformLogoPath !== null) { |
397 | 397 | $logoForm->addLabel( |
398 | 398 | get_lang('CurrentLogo'), |
399 | - '<img id="header-logo-custom" src="' . $webPlatformLogoPath . '?' . time() . '">' |
|
399 | + '<img id="header-logo-custom" src="'.$webPlatformLogoPath.'?'.time().'">' |
|
400 | 400 | ); |
401 | 401 | } |
402 | 402 | |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | }); |
464 | 464 | </script>'; |
465 | 465 | echo Display::tabs( |
466 | - array(get_lang('Update'),get_lang('UpdateLogo'), get_lang('UploadNewStylesheet')), |
|
466 | + array(get_lang('Update'), get_lang('UpdateLogo'), get_lang('UploadNewStylesheet')), |
|
467 | 467 | array($form_change->return_form(), $logoForm->returnForm(), $form->returnForm()) |
468 | 468 | ); |
469 | 469 | } else { |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | if (!empty($areas_to_installed)) { |
629 | 629 | $plugin_obj->remove_all_regions($plugin); |
630 | 630 | foreach ($areas_to_installed as $region) { |
631 | - if (!empty($region) && $region != '-1' ) { |
|
631 | + if (!empty($region) && $region != '-1') { |
|
632 | 632 | $plugin_obj->add_to_region($plugin, $region); |
633 | 633 | } |
634 | 634 | } |
@@ -739,14 +739,14 @@ discard block |
||
739 | 739 | $values = api_get_settings_options('search_show_unlinked_results'); |
740 | 740 | |
741 | 741 | $group = formGenerateElementsGroup($form, $values, 'search_show_unlinked_results'); |
742 | - $form->addGroup($group, 'search_show_unlinked_results', array(get_lang('SearchShowUnlinkedResultsTitle'),get_lang('SearchShowUnlinkedResultsComment')), null, false); |
|
742 | + $form->addGroup($group, 'search_show_unlinked_results', array(get_lang('SearchShowUnlinkedResultsTitle'), get_lang('SearchShowUnlinkedResultsComment')), null, false); |
|
743 | 743 | $default_values['search_show_unlinked_results'] = api_get_setting('search_show_unlinked_results'); |
744 | 744 | |
745 | 745 | $sf_values = array(); |
746 | 746 | foreach ($specific_fields as $sf) { |
747 | 747 | $sf_values[$sf['code']] = $sf['name']; |
748 | 748 | } |
749 | - $url = Display::div(Display::url(get_lang('AddSpecificSearchField'), 'specific_fields.php'), array('class'=>'sectioncomment')); |
|
749 | + $url = Display::div(Display::url(get_lang('AddSpecificSearchField'), 'specific_fields.php'), array('class'=>'sectioncomment')); |
|
750 | 750 | if (empty($sf_values)) { |
751 | 751 | $form->addElement('label', [get_lang('SearchPrefilterPrefix'), $url]); |
752 | 752 | } else { |
@@ -841,7 +841,7 @@ discard block |
||
841 | 841 | if ($action != 'add') { |
842 | 842 | echo '<div class="actions" style="margin-left: 1px;">'; |
843 | 843 | echo '<a href="settings.php?category=Templates&action=add">'. |
844 | - Display::return_icon('new_template.png', get_lang('AddTemplate'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
844 | + Display::return_icon('new_template.png', get_lang('AddTemplate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
845 | 845 | echo '</div>'; |
846 | 846 | } |
847 | 847 | |
@@ -962,8 +962,8 @@ discard block |
||
962 | 962 | * @since v1.8.6 |
963 | 963 | */ |
964 | 964 | function actionsFilter($id) { |
965 | - $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>'; |
|
966 | - $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>'; |
|
965 | + $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>'; |
|
966 | + $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>'; |
|
967 | 967 | return $return; |
968 | 968 | } |
969 | 969 | |
@@ -1015,7 +1015,7 @@ discard block |
||
1015 | 1015 | $form->addElement('html_editor', 'template_text', get_lang('Text'), null, array('ToolbarSet' => 'AdminTemplates', 'Width' => '100%', 'Height' => '400')); |
1016 | 1016 | |
1017 | 1017 | // Setting the form elements: the form to upload an image to be used with the template. |
1018 | - $form->addElement('file','template_image',get_lang('Image'),''); |
|
1018 | + $form->addElement('file', 'template_image', get_lang('Image'), ''); |
|
1019 | 1019 | |
1020 | 1020 | // Setting the form elements: a little bit information about the template image. |
1021 | 1021 | $form->addElement('static', 'file_comment', '', get_lang('TemplateImageComment100x70')); |
@@ -1039,10 +1039,10 @@ discard block |
||
1039 | 1039 | // Adding an extra field: a preview of the image that is currently used. |
1040 | 1040 | if (!empty($row['image'])) { |
1041 | 1041 | $form->addElement('static', 'template_image_preview', '', |
1042 | - '<img src="' . api_get_path(WEB_APP_PATH) . 'home/default_platform_document/template_thumb/' . $row['image'] . '" alt="' . get_lang('TemplatePreview') . '"/>'); |
|
1042 | + '<img src="'.api_get_path(WEB_APP_PATH).'home/default_platform_document/template_thumb/'.$row['image'].'" alt="'.get_lang('TemplatePreview').'"/>'); |
|
1043 | 1043 | } else { |
1044 | 1044 | $form->addElement('static', 'template_image_preview', '', |
1045 | - '<img src="' . api_get_path(WEB_APP_PATH) . 'home/default_platform_document/template_thumb/noimage.gif" alt="' . get_lang('NoTemplatePreview') . '"/>'); |
|
1045 | + '<img src="'.api_get_path(WEB_APP_PATH).'home/default_platform_document/template_thumb/noimage.gif" alt="'.get_lang('NoTemplatePreview').'"/>'); |
|
1046 | 1046 | } |
1047 | 1047 | |
1048 | 1048 | // Setting the information of the template that we are editing. |
@@ -1095,7 +1095,7 @@ discard block |
||
1095 | 1095 | // Store the information in the database (as insert or as update). |
1096 | 1096 | $table_system_template = Database :: get_main_table('system_template'); |
1097 | 1097 | if ($_GET['action'] == 'add') { |
1098 | - $content_template = Security::remove_XSS($values['template_text'], COURSEMANAGERLOWSECURITY); |
|
1098 | + $content_template = Security::remove_XSS($values['template_text'], COURSEMANAGERLOWSECURITY); |
|
1099 | 1099 | $params = [ |
1100 | 1100 | 'title' => $values['title'], |
1101 | 1101 | 'content' => $content_template, |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | |
1106 | 1106 | // Display a feedback message. |
1107 | 1107 | Display::display_confirmation_message(get_lang('TemplateAdded')); |
1108 | - echo '<a href="settings.php?category=Templates&action=add">'.Display::return_icon('new_template.png', get_lang('AddTemplate'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
1108 | + echo '<a href="settings.php?category=Templates&action=add">'.Display::return_icon('new_template.png', get_lang('AddTemplate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
1109 | 1109 | } else { |
1110 | 1110 | $content_template = '<head>{CSS}<style type="text/css">.text{font-weight: normal;}</style></head><body>'.Database::escape_string($values['template_text']).'</body>'; |
1111 | 1111 | $sql = "UPDATE $table_system_template set title = '".Database::escape_string($values['title'])."', content = '".$content_template."'"; |
@@ -1123,7 +1123,7 @@ discard block |
||
1123 | 1123 | displayTemplates(); |
1124 | 1124 | } else { |
1125 | 1125 | $token = Security::get_token(); |
1126 | - $form->addElement('hidden','sec_token'); |
|
1126 | + $form->addElement('hidden', 'sec_token'); |
|
1127 | 1127 | $form->setConstants(array('sec_token' => $token)); |
1128 | 1128 | // Display the form. |
1129 | 1129 | $form->display(); |
@@ -1258,13 +1258,13 @@ discard block |
||
1258 | 1258 | $form->addElement( |
1259 | 1259 | 'html', |
1260 | 1260 | '<div class="pull-right"><a class="share_this_setting" data_status = "0" data_to_send = "'.$row['variable'].'" href="javascript:void(0);">'. |
1261 | - Display::return_icon('shared_setting.png', get_lang('ChangeSharedSetting') , null, ICON_SIZE_MEDIUM).'</a></div>' |
|
1261 | + Display::return_icon('shared_setting.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM).'</a></div>' |
|
1262 | 1262 | ); |
1263 | 1263 | } else { |
1264 | 1264 | $form->addElement( |
1265 | 1265 | 'html', |
1266 | 1266 | '<div class="pull-right"><a class="share_this_setting" data_status = "1" data_to_send = "'.$row['variable'].'" href="javascript:void(0);">'. |
1267 | - Display::return_icon('shared_setting_na.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM ).'</a></div>' |
|
1267 | + Display::return_icon('shared_setting_na.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM).'</a></div>' |
|
1268 | 1268 | ); |
1269 | 1269 | } |
1270 | 1270 | } else { |
@@ -1272,13 +1272,13 @@ discard block |
||
1272 | 1272 | $form->addElement( |
1273 | 1273 | 'html', |
1274 | 1274 | '<div class="pull-right">'. |
1275 | - Display::return_icon('shared_setting.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM ).'</div>' |
|
1275 | + Display::return_icon('shared_setting.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM).'</div>' |
|
1276 | 1276 | ); |
1277 | 1277 | } else { |
1278 | 1278 | $form->addElement( |
1279 | 1279 | 'html', |
1280 | 1280 | '<div class="pull-right">'. |
1281 | - Display::return_icon('shared_setting_na.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM ).'</div>' |
|
1281 | + Display::return_icon('shared_setting_na.png', get_lang('ChangeSharedSetting'), null, ICON_SIZE_MEDIUM).'</div>' |
|
1282 | 1282 | ); |
1283 | 1283 | } |
1284 | 1284 | } |
@@ -1330,7 +1330,7 @@ discard block |
||
1330 | 1330 | array('maxlength' => '8') |
1331 | 1331 | ); |
1332 | 1332 | $form->applyFilter($row['variable'], 'html_filter'); |
1333 | - $default_values[$row['variable']] = round($row['selected_value']/1024/1024, 1); |
|
1333 | + $default_values[$row['variable']] = round($row['selected_value'] / 1024 / 1024, 1); |
|
1334 | 1334 | } elseif ($row['variable'] == 'account_valid_duration') { |
1335 | 1335 | $form->addElement( |
1336 | 1336 | 'text', |
@@ -1358,7 +1358,7 @@ discard block |
||
1358 | 1358 | ), |
1359 | 1359 | $hideme |
1360 | 1360 | ); |
1361 | - $form->applyFilter($row['variable'],'html_filter'); |
|
1361 | + $form->applyFilter($row['variable'], 'html_filter'); |
|
1362 | 1362 | $default_values[$row['variable']] = $row['selected_value']; |
1363 | 1363 | } |
1364 | 1364 | break; |
@@ -1369,7 +1369,7 @@ discard block |
||
1369 | 1369 | if (file_exists($file)) { |
1370 | 1370 | $value = file_get_contents($file); |
1371 | 1371 | } |
1372 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1372 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1373 | 1373 | $default_values[$row['variable']] = $value; |
1374 | 1374 | } elseif ($row['variable'] == 'footer_extra_content') { |
1375 | 1375 | $file = api_get_home_path().'footer_extra_content.txt'; |
@@ -1377,16 +1377,16 @@ discard block |
||
1377 | 1377 | if (file_exists($file)) { |
1378 | 1378 | $value = file_get_contents($file); |
1379 | 1379 | } |
1380 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1380 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1381 | 1381 | $default_values[$row['variable']] = $value; |
1382 | 1382 | } else { |
1383 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1383 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1384 | 1384 | $default_values[$row['variable']] = $row['selected_value']; |
1385 | 1385 | } |
1386 | 1386 | break; |
1387 | 1387 | case 'radio': |
1388 | 1388 | $values = api_get_settings_options($row['variable']); |
1389 | - $group = array (); |
|
1389 | + $group = array(); |
|
1390 | 1390 | if (is_array($values)) { |
1391 | 1391 | foreach ($values as $key => $value) { |
1392 | 1392 | $element = &$form->createElement( |
@@ -1417,7 +1417,7 @@ discard block |
||
1417 | 1417 | WHERE variable='".$row['variable']."' AND access_url = 1"; |
1418 | 1418 | |
1419 | 1419 | $result = Database::query($sql); |
1420 | - $group = array (); |
|
1420 | + $group = array(); |
|
1421 | 1421 | while ($rowkeys = Database::fetch_array($result)) { |
1422 | 1422 | // Profile tab option should be hidden when the social tool is enabled. |
1423 | 1423 | if (api_get_setting('allow_social_tool') == 'true') { |
@@ -1474,7 +1474,7 @@ discard block |
||
1474 | 1474 | break; |
1475 | 1475 | case 'link': |
1476 | 1476 | $form->addElement('static', null, array(get_lang($row['title']), get_lang($row['comment'])), |
1477 | - get_lang('CurrentValue') . ' : ' . $row['selected_value'], $hideme); |
|
1477 | + get_lang('CurrentValue').' : '.$row['selected_value'], $hideme); |
|
1478 | 1478 | break; |
1479 | 1479 | case 'select': |
1480 | 1480 | /* |
@@ -1506,7 +1506,7 @@ discard block |
||
1506 | 1506 | $row['variable'], |
1507 | 1507 | [get_lang($row['title']), get_lang($row['comment'])], |
1508 | 1508 | $courseSelectOptions, |
1509 | - ['url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course'] |
|
1509 | + ['url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course'] |
|
1510 | 1510 | ); |
1511 | 1511 | $default_values[$row['variable']] = $row['selected_value']; |
1512 | 1512 | break; |
@@ -1514,10 +1514,10 @@ discard block |
||
1514 | 1514 | |
1515 | 1515 | switch ($row['variable']) { |
1516 | 1516 | case 'pdf_export_watermark_enable': |
1517 | - $url = PDF::get_watermark(null); |
|
1517 | + $url = PDF::get_watermark(null); |
|
1518 | 1518 | |
1519 | 1519 | if ($url != false) { |
1520 | - $delete_url = '<a href="?delete_watermark">'.get_lang('DelImage').' '.Display::return_icon('delete.png',get_lang('DelImage')).'</a>'; |
|
1520 | + $delete_url = '<a href="?delete_watermark">'.get_lang('DelImage').' '.Display::return_icon('delete.png', get_lang('DelImage')).'</a>'; |
|
1521 | 1521 | $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>'); |
1522 | 1522 | } |
1523 | 1523 | |
@@ -1671,7 +1671,7 @@ discard block |
||
1671 | 1671 | if (api_is_windows_os() == false) { |
1672 | 1672 | $list_of_programs = array('pdftotext', 'ps2pdf', 'catdoc', 'html2text', 'unrtf', 'catppt', 'xls2csv'); |
1673 | 1673 | |
1674 | - foreach($list_of_programs as $program) { |
|
1674 | + foreach ($list_of_programs as $program) { |
|
1675 | 1675 | $output = []; |
1676 | 1676 | $ret_val = null; |
1677 | 1677 | exec("which $program", $output, $ret_val); |
@@ -1684,7 +1684,7 @@ discard block |
||
1684 | 1684 | if (!empty($output[0])) { |
1685 | 1685 | $icon = Display::return_icon('bullet_green.png', get_lang('Installed')); |
1686 | 1686 | } |
1687 | - $data2[]= array($program, $output[0], $icon); |
|
1687 | + $data2[] = array($program, $output[0], $icon); |
|
1688 | 1688 | } |
1689 | 1689 | echo Display::tag('h3', get_lang('ProgramsNeededToConvertFiles')); |
1690 | 1690 | $table = new SortableTableFromArray($data2); |
@@ -1710,11 +1710,11 @@ discard block |
||
1710 | 1710 | if (is_dir($dir)) { |
1711 | 1711 | $zip = new PclZip($arch); |
1712 | 1712 | // Remove path prefix except the style name and put file on disk |
1713 | - $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, substr($dir,0,-strlen($style))); |
|
1714 | - $url = api_get_path(WEB_CODE_PATH) . 'course_info/download.php?archive_path=&archive=' . str_replace(api_get_path(SYS_ARCHIVE_PATH), '', $arch); |
|
1713 | + $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, substr($dir, 0, -strlen($style))); |
|
1714 | + $url = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive_path=&archive='.str_replace(api_get_path(SYS_ARCHIVE_PATH), '', $arch); |
|
1715 | 1715 | |
1716 | 1716 | //@TODO: use more generic script to download. |
1717 | - $str = '<a class="btn btn-primary btn-large" href="' .$url. '">'.get_lang('ClickHereToDownloadTheFile').'</a>'; |
|
1717 | + $str = '<a class="btn btn-primary btn-large" href="'.$url.'">'.get_lang('ClickHereToDownloadTheFile').'</a>'; |
|
1718 | 1718 | Display::display_normal_message($str, false); |
1719 | 1719 | } else { |
1720 | 1720 | 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'); |
@@ -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).' |