Completed
Push — 1.11.x ( 78f130...f6f5c2 )
by José
50:40 queued 24:26
created
main/gamification/my_progress.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     $UserIsSubscribedToSession = SessionManager::isUserSubscribedAsStudent($lastSessionId, $user->getId());
43 43
 
44 44
     if (!empty($lastSessionId) && $UserIsSubscribedToSession) {
45
-        $urlWithSession = api_get_self() . '?' . http_build_query([
45
+        $urlWithSession = api_get_self().'?'.http_build_query([
46 46
             'session_id' => $lastCourseAccess->getSessionId()
47 47
         ]);
48 48
 
@@ -116,13 +116,13 @@  discard block
 block discarded – undo
116 116
         foreach ($learningPathList->list as $learningPathId => $learningPath) {
117 117
             $courseData['stats'][] = [
118 118
                 $learningPath['lp_name'],
119
-                'lp/lp_controller.php?' . http_build_query([
119
+                'lp/lp_controller.php?'.http_build_query([
120 120
                     'action' => 'stats',
121 121
                     'cidReq' => $course->getCode(),
122 122
                     'id_session' => $currentSession->getId(),
123 123
                     'gidReq' => 0,
124 124
                     'lp_id' => $learningPathId
125
-                ]) . api_get_cidreq()
125
+                ]).api_get_cidreq()
126 126
             ];
127 127
         }
128 128
 
Please login to merge, or discard this patch.
main/search/search_suggestions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package chamilo.search
7 7
  */
8 8
 
9
-require_once dirname(__FILE__) . '/../inc/global.inc.php';
9
+require_once dirname(__FILE__).'/../inc/global.inc.php';
10 10
 
11 11
 function get_suggestions_from_search_engine($q)
12 12
 {
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
     $i = 0;
28 28
     while ($row = Database::fetch_array($sql_result)) {
29 29
         $json[] = [
30
-            'id' => api_convert_encoding($row['value'],'UTF-8',$charset),
31
-            'value' => api_convert_encoding($row['value'],'UTF-8',$charset),
32
-            'label' => api_convert_encoding($row['value'],'UTF-8',$charset)
30
+            'id' => api_convert_encoding($row['value'], 'UTF-8', $charset),
31
+            'value' => api_convert_encoding($row['value'], 'UTF-8', $charset),
32
+            'label' => api_convert_encoding($row['value'], 'UTF-8', $charset)
33 33
         ];
34 34
 
35
-        if ($i<20) {
36
-            $data[ $row['course_code'] ] [ $row['tool_id'] ] [ $row['ref_id'] ] = 1;
35
+        if ($i < 20) {
36
+            $data[$row['course_code']] [$row['tool_id']] [$row['ref_id']] = 1;
37 37
         }
38 38
         $i++;
39 39
     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                     }
96 96
                 }
97 97
                 foreach ($output as $i=>$out) {
98
-                    if (api_stristr($out,$q) === false) {continue;}
98
+                    if (api_stristr($out, $q) === false) {continue; }
99 99
                     $s = api_convert_encoding(substr($out, 0, -3), 'UTF-8', $charset);
100 100
                     if (!in_array($s, $more_sugg)) {
101 101
                         $more_sugg[] = $s;
Please login to merge, or discard this patch.
main/gradebook/gradebook_add_user.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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">';
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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>';
Please login to merge, or discard this patch.
main/gradebook/get_badges.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 );
Please login to merge, or discard this patch.
main/work/work_list_others.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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'])) {
Please login to merge, or discard this patch.
main/session/add_courses_to_session.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -207,7 +207,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 } ?>
Please login to merge, or discard this patch.
main/social/group_add.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
main/social/invitations.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
main/admin/settings.lib.php 2 patches
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1154,7 +1154,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 {
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'));
Please login to merge, or discard this patch.