Completed
Push — 1.11.x ( ca7787...41c0f2 )
by José
31:51
created
main/forum/newthread.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 55
 /* Breadcrumbs */
56 56
 
57
-if (isset($_SESSION['gradebook'])){
57
+if (isset($_SESSION['gradebook'])) {
58 58
     $gradebook = Security::remove_XSS($_SESSION['gradebook']);
59 59
 }
60 60
 
61 61
 if (!empty($gradebook) && $gradebook == 'view') {
62
-    $interbreadcrumb[] = array (
62
+    $interbreadcrumb[] = array(
63 63
         'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
64 64
         'name' => get_lang('ToolGradebook')
65 65
     );
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups'));
118 118
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']);
119 119
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']);
120
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),'name' => get_lang('NewTopic'));
120
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('NewTopic'));
121 121
 } else {
122 122
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
123 123
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'], 'name' => $current_forum_category['cat_title']);
Please login to merge, or discard this patch.
main/tracking/courseLogCSV.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 if ($view == "00000010")
54 54
     $nameTools = get_lang('ScormAccess');
55 55
 
56
-$interbreadcrumb[] = array("url" => api_get_self() . "?view=0000000", "name" => get_lang('ToolName'));
56
+$interbreadcrumb[] = array("url" => api_get_self()."?view=0000000", "name" => get_lang('ToolName'));
57 57
 
58 58
 $is_allowedToTrack = $is_courseAdmin || $is_platformAdmin || api_is_drh();
59 59
 
60 60
 /* 	MAIN CODE */
61 61
 
62
-$title[0] = get_lang('StatsOfCourse') . " : " . $_course['official_code'];
62
+$title[0] = get_lang('StatsOfCourse')." : ".$_course['official_code'];
63 63
 
64 64
 
65 65
 $courseInfo = api_get_course_info($_course['official_code']);
@@ -91,40 +91,40 @@  discard block
 block discarded – undo
91 91
         $sql = "SELECT $TABLECOURSUSER.user_i, $table_user.lastname, $table_user.firstname
92 92
                 FROM $TABLECOURSUSER, $table_user
93 93
                 WHERE
94
-                    $TABLECOURSUSER.c_id = '" . api_get_course_int_id() . "' AND
94
+                    $TABLECOURSUSER.c_id = '".api_get_course_int_id()."' AND
95 95
                     $TABLECOURSUSER.user_id = $table_user.user_id AND
96
-                    $TABLECOURSUSER.relation_type<>" . COURSE_RELATION_TYPE_RRHH . "
96
+                    $TABLECOURSUSER.relation_type<>".COURSE_RELATION_TYPE_RRHH."
97 97
                 ORDER BY $table_user.lastname";
98 98
         $results = StatsUtils::getManyResults3Col($sql);
99 99
 
100 100
         //BUGFIX: get visual code instead of real course code. Scormpaths use the visual code... (should be fixed in future versions)
101
-        $sql = "SELECT visual_code FROM $TABLECOURSE WHERE code = '" . api_get_course_id() . "'";
101
+        $sql = "SELECT visual_code FROM $TABLECOURSE WHERE code = '".api_get_course_id()."'";
102 102
         $_course['visual_code'] = StatsUtils::getOneResult($sql);
103 103
 
104 104
         if (is_array($results)) {
105 105
             $line = '';
106
-            $title_line = get_lang('Name') . ";" . get_lang('FirstAccess') . ";" . get_lang('LastAccess') . ";" . get_lang('Visited') . "\n";
106
+            $title_line = get_lang('Name').";".get_lang('FirstAccess').";".get_lang('LastAccess').";".get_lang('Visited')."\n";
107 107
 
108 108
             for ($j = 0; $j < count($results); $j++) {
109 109
                 // BEGIN % visited
110 110
                 // sum of all items (= multiple learningpaths + SCORM imported paths)
111
-                $sql = "SELECT COUNT(DISTINCT(iv.lp_item_id)) FROM $tbl_learnpath_item_view iv " .
111
+                $sql = "SELECT COUNT(DISTINCT(iv.lp_item_id)) FROM $tbl_learnpath_item_view iv ".
112 112
                         "INNER JOIN $tbl_learnpath_view v
113
-                        ON iv.lp_view_id = v.id " .
113
+                        ON iv.lp_view_id = v.id ".
114 114
                         "WHERE
115 115
                         	v.c_id = $course_id AND
116 116
                         	iv.c_id = $course_id AND
117
-                		v.user_id = " . $results[$j][0];
117
+                		v.user_id = ".$results[$j][0];
118 118
                 $total_lpath_items = StatsUtils::getOneResult($sql);
119 119
 
120 120
                 // sum of all completed items (= multiple learningpaths + SCORM imported paths)
121
-                $sql = "SELECT COUNT(DISTINCT(iv.lp_item_id)) " .
122
-                        "FROM $tbl_learnpath_item_view iv " .
123
-                        "INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id = v.id " .
121
+                $sql = "SELECT COUNT(DISTINCT(iv.lp_item_id)) ".
122
+                        "FROM $tbl_learnpath_item_view iv ".
123
+                        "INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id = v.id ".
124 124
                         "WHERE
125 125
                         	v.c_id = $course_id AND
126 126
                         	iv.c_id = $course_id AND
127
-                        	v.user_id = " . $results[$j][0] . " " .
127
+                        	v.user_id = ".$results[$j][0]." ".
128 128
                         "AND (status = 'completed' OR status='passed')";
129 129
                 $total_lpath_items_completed = StatsUtils::getOneResult($sql);
130 130
 
@@ -135,23 +135,23 @@  discard block
 block discarded – undo
135 135
                 // BEGIN first/last access
136 136
                 // first access
137 137
                 $sql = "SELECT access_date FROM $TABLETRACK_ACCESS_2
138
-                        WHERE access_user_id = '" . $results[$j][0] . "' AND c_id = '" . $courseId . "' AND access_tool = 'learnpath' AND access_session_id = '" . api_get_session_id() . "'
138
+                        WHERE access_user_id = '".$results[$j][0]."' AND c_id = '".$courseId."' AND access_tool = 'learnpath' AND access_session_id = '".api_get_session_id()."'
139 139
                         ORDER BY access_id ASC LIMIT 1";
140 140
                 $first_access = StatsUtils::getOneResult($sql);
141 141
                 $first_access = empty($first_access) ? "-" : date('d.m.y', strtotime($first_access));
142 142
 
143 143
                 // last access
144
-                $sql = "SELECT access_date FROM $TABLETRACK_ACCESS WHERE access_user_id = '" . $results[$j][0] . "' AND c_id = '" . $courseId . "' AND access_tool = 'learnpath'";
144
+                $sql = "SELECT access_date FROM $TABLETRACK_ACCESS WHERE access_user_id = '".$results[$j][0]."' AND c_id = '".$courseId."' AND access_tool = 'learnpath'";
145 145
                 $last_access = StatsUtils::getOneResult($sql);
146 146
                 $last_access = empty($last_access) ? "-" : date('d.m.y', strtotime($last_access));
147 147
                 // END first/last access
148 148
                 // BEGIN presentation of data
149
-                $line .= $results[$j][1] . " " . $results[$j][2] . ";" . $first_access . ";" . $last_access . ";" . $lpath_pct_completed . "\n";
149
+                $line .= $results[$j][1]." ".$results[$j][2].";".$first_access.";".$last_access.";".$lpath_pct_completed."\n";
150 150
 
151 151
                 // END presentation of data
152 152
             }
153 153
         } else {
154
-            $line = get_lang('NoResult') . "\n";
154
+            $line = get_lang('NoResult')."\n";
155 155
         }
156 156
     }
157 157
 
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
 
164 164
         $sql = "SELECT count(*)
165 165
                 FROM $TABLECOURSUSER
166
-                WHERE c_id = '" . api_get_course_int_id() . "' AND relation_type<>" . COURSE_RELATION_TYPE_RRHH . "";
166
+                WHERE c_id = '".api_get_course_int_id()."' AND relation_type<>".COURSE_RELATION_TYPE_RRHH."";
167 167
         $count = StatsUtils::getOneResult($sql);
168
-        $title_line = get_lang('CountUsers') . " ; " . $count . "\n";
168
+        $title_line = get_lang('CountUsers')." ; ".$count."\n";
169 169
     }
170 170
 
171 171
     /* 	Access to this course */
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                     AND access_tool IS NULL";
184 184
         $count = StatsUtils::getOneResult($sql);
185 185
 
186
-        $line .= get_lang('CountToolAccess') . " ; " . $count . "\n";
186
+        $line .= get_lang('CountToolAccess')." ; ".$count."\n";
187 187
 
188 188
         // last 31 days
189 189
         $sql = "SELECT count(*)
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                     AND access_tool IS NULL";
194 194
         $count = StatsUtils::getOneResult($sql);
195 195
 
196
-        $line .= get_lang('Last31days') . " ; " . $count . "\n";
196
+        $line .= get_lang('Last31days')." ; ".$count."\n";
197 197
 
198 198
         // last 7 days
199 199
         $sql = "SELECT count(*)
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                     AND access_tool IS NULL";
204 204
         $count = StatsUtils::getOneResult($sql);
205 205
 
206
-        $line .= get_lang('Last7days') . " ; " . $count . "\n";
206
+        $line .= get_lang('Last7days')." ; ".$count."\n";
207 207
 
208 208
         // today
209 209
         $sql = "SELECT count(*)
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                     AND ( access_date > CURDATE() )
213 213
                     AND access_tool IS NULL";
214 214
         $count = StatsUtils::getOneResult($sql);
215
-        $line .= get_lang('ThisDay') . " ; " . $count . "\n";
215
+        $line .= get_lang('ThisDay')." ; ".$count."\n";
216 216
     }
217 217
 
218 218
     /* 	Tools */
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $tempView[2] = '0';
222 222
         $title[1] = $nameTools;
223 223
         $line = '';
224
-        $title_line = get_lang('ToolTitleToolnameColumn') . ";" . get_lang('ToolTitleUsersColumn') . ";" . get_lang('ToolTitleCountColumn') . "\n";
224
+        $title_line = get_lang('ToolTitleToolnameColumn').";".get_lang('ToolTitleUsersColumn').";".get_lang('ToolTitleCountColumn')."\n";
225 225
 
226 226
         $sql = "SELECT access_tool, COUNT(DISTINCT access_user_id),count( access_tool )
227 227
                 FROM $TABLETRACK_ACCESS
@@ -233,10 +233,10 @@  discard block
 block discarded – undo
233 233
 
234 234
         if (is_array($results)) {
235 235
             for ($j = 0; $j < count($results); $j++) {
236
-                $line .= $results[$j][0] . "/" . get_lang($results[$j][0]) . ";" . $results[$j][1] . ";" . $results[$j][2] . "\n";
236
+                $line .= $results[$j][0]."/".get_lang($results[$j][0]).";".$results[$j][1].";".$results[$j][2]."\n";
237 237
             }
238 238
         } else {
239
-            $line = get_lang('NoResult') . "\n";
239
+            $line = get_lang('NoResult')."\n";
240 240
         }
241 241
     }
242 242
 
@@ -258,14 +258,14 @@  discard block
 block discarded – undo
258 258
 
259 259
         $title[1] = $nameTools;
260 260
         $line = '';
261
-        $title_line = get_lang('LinksTitleLinkColumn') . ";" . get_lang('LinksTitleUsersColumn') . ";" . get_lang('LinksTitleCountColumn') . "\n";
261
+        $title_line = get_lang('LinksTitleLinkColumn').";".get_lang('LinksTitleUsersColumn').";".get_lang('LinksTitleCountColumn')."\n";
262 262
 
263 263
         if (is_array($results)) {
264 264
             for ($j = 0; $j < count($results); $j++) {
265
-                $line .= $results[$j][1] . "'>" . $results[$j][0] . ";" . $results[$j][2] . ";" . $results[$j][3] . "\n";
265
+                $line .= $results[$j][1]."'>".$results[$j][0].";".$results[$j][2].";".$results[$j][3]."\n";
266 266
             }
267 267
         } else {
268
-            $line = get_lang('NoResult') . "\n";
268
+            $line = get_lang('NoResult')."\n";
269 269
         }
270 270
     }
271 271
 
@@ -284,13 +284,13 @@  discard block
 block discarded – undo
284 284
 
285 285
         $title[1] = $nameTools;
286 286
         $line = '';
287
-        $title_line = get_lang('DocumentsTitleDocumentColumn') . ";" . get_lang('DocumentsTitleUsersColumn') . ";" . get_lang('DocumentsTitleCountColumn') . "\n";
287
+        $title_line = get_lang('DocumentsTitleDocumentColumn').";".get_lang('DocumentsTitleUsersColumn').";".get_lang('DocumentsTitleCountColumn')."\n";
288 288
         if (is_array($results)) {
289 289
             for ($j = 0; $j < count($results); $j++) {
290
-                $line .= $results[$j][0] . ";" . $results[$j][1] . ";" . $results[$j][2] . "\n";
290
+                $line .= $results[$j][0].";".$results[$j][1].";".$results[$j][2]."\n";
291 291
             }
292 292
         } else {
293
-            $line = get_lang('NoResult') . "\n";
293
+            $line = get_lang('NoResult')."\n";
294 294
         }
295 295
     }
296 296
 
@@ -318,10 +318,10 @@  discard block
 block discarded – undo
318 318
                 //echo "<a href='".api_get_self()."?view=".$view."&scormcontopen=".$ar['id']."' class='specialLink'>$lp_title</a>";
319 319
                 if ($ar['id'] == $scormcontopen) { //have to list the students here
320 320
                     $contentId = $ar['id'];
321
-                    $sql2 = "SELECT u.user_id, u.lastname, u.firstname " .
322
-                            "FROM  $tbl_learnpath_view sd " .
323
-                            "INNER JOIN $table_user u " .
324
-                            "ON u.user_id = sd.user_id " .
321
+                    $sql2 = "SELECT u.user_id, u.lastname, u.firstname ".
322
+                            "FROM  $tbl_learnpath_view sd ".
323
+                            "INNER JOIN $table_user u ".
324
+                            "ON u.user_id = sd.user_id ".
325 325
                             "WHERE sd.c_id = $course_id AND sd.lp_id=$contentId group by u.user_id";
326 326
                     //error_log($sql2,0);
327 327
                     $result2 = Database::query($sql2);
@@ -333,28 +333,28 @@  discard block
 block discarded – undo
333 333
                         while ($ar2 != '') {
334 334
 
335 335
                             if (isset($_REQUEST["scormstudentopen"]) && $ar2['user_id'] == $scormstudentopen) {
336
-                                $line .= $ar['id'] . " " . $ar2['user_id'] . " " . api_get_person_name($ar2['firstname'], $ar2['lastname']);
336
+                                $line .= $ar['id']." ".$ar2['user_id']." ".api_get_person_name($ar2['firstname'], $ar2['lastname']);
337 337
                             } else {
338
-                                $line .= $ar['id'] . " " . $ar2['user_id'] . " " . api_get_person_name($ar2['firstname'], $ar2['lastname']);
338
+                                $line .= $ar['id']." ".$ar2['user_id']." ".api_get_person_name($ar2['firstname'], $ar2['lastname']);
339 339
                             }
340 340
 
341 341
                             if ($ar2['user_id'] == $scormstudentopen) { //have to list the student's results
342 342
                                 $studentId = $ar2['user_id'];
343
-                                $sql3 = "SELECT iv.status, iv.score, i.title, iv.total_time " .
344
-                                        "FROM $tbl_learnpath_item i " .
345
-                                        "INNER JOIN $tbl_learnpath_item_view iv ON i.id=iv.lp_item_id " .
346
-                                        "INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id=v.id " .
343
+                                $sql3 = "SELECT iv.status, iv.score, i.title, iv.total_time ".
344
+                                        "FROM $tbl_learnpath_item i ".
345
+                                        "INNER JOIN $tbl_learnpath_item_view iv ON i.id=iv.lp_item_id ".
346
+                                        "INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id=v.id ".
347 347
                                         "WHERE 	i.c_id = $course_id AND
348 348
                                         		iv.c_id = $course_id AND
349 349
                                         		v.c_id = $course_id AND
350 350
                                 				v.user_id=$studentId and v.lp_id=$contentId ORDER BY v.id, i.id";
351 351
                                 $result3 = Database::query($sql3);
352 352
                                 $ar3 = Database::fetch_array($result3);
353
-                                $title_line .= get_lang('ScormTitleColumn') . ";" . get_lang('ScormStatusColumn') . ";" . get_lang('ScormScoreColumn') . ";" . get_lang('ScormTimeColumn');
353
+                                $title_line .= get_lang('ScormTitleColumn').";".get_lang('ScormStatusColumn').";".get_lang('ScormScoreColumn').";".get_lang('ScormTimeColumn');
354 354
                                 while ($ar3['status'] != '') {
355 355
                                     require_once '../lp/learnpathItem.class.php';
356 356
                                     $time = learnpathItem::getScormTimeFromParameter('php', $ar3['total_time']);
357
-                                    $line .= $title . ";" . $ar3['status'] . ";" . $ar3['score'] . ";" . $time;
357
+                                    $line .= $title.";".$ar3['status'].";".$ar3['score'].";".$time;
358 358
                                     $ar3 = Database::fetch_array($result3);
359 359
                                 }
360 360
                             }
@@ -374,23 +374,23 @@  discard block
 block discarded – undo
374 374
      * Export to a CSV file
375 375
      * Force the browser to save the file instead of opening it.
376 376
      */
377
-    $len = strlen($title_line . $line);
377
+    $len = strlen($title_line.$line);
378 378
     header('Content-type: application/octet-stream');
379 379
     //header('Content-Type: application/force-download');
380
-    header('Content-length: ' . $len);
381
-    $filename = api_html_entity_decode(str_replace(":", "", str_replace(" ", "_", $title[0] . '_' . $title[1] . '.csv')));
380
+    header('Content-length: '.$len);
381
+    $filename = api_html_entity_decode(str_replace(":", "", str_replace(" ", "_", $title[0].'_'.$title[1].'.csv')));
382 382
     $filename = api_replace_dangerous_char($filename);
383 383
     if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
384
-        header('Content-Disposition: filename= ' . $filename);
384
+        header('Content-Disposition: filename= '.$filename);
385 385
     } else {
386
-        header('Content-Disposition: attachment; filename= ' . $filename);
386
+        header('Content-Disposition: attachment; filename= '.$filename);
387 387
     }
388 388
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
389 389
         header('Pragma: ');
390 390
         header('Cache-Control: ');
391 391
         header('Cache-Control: public'); // IE cannot download from sessions without a cache
392 392
     }
393
-    header('Content-Description: ' . $filename);
393
+    header('Content-Description: '.$filename);
394 394
     header('Content-transfer-encoding: binary');
395 395
 
396 396
     echo api_html_entity_decode($title_line, ENT_COMPAT);
Please login to merge, or discard this patch.
main/inc/lib/javascript/chat/video.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
 $idUserLocal = api_get_user_id();
35 35
 $userLocal = api_get_user_info($idUserLocal, true);
36 36
 $htmlHeadXtra[] = '<script type="text/javascript" src="'
37
-    . api_get_path(WEB_PATH) . 'web/assets/simpleWebRTC/latest.js'
38
-    . '"></script>' . "\n";
37
+    . api_get_path(WEB_PATH).'web/assets/simpleWebRTC/latest.js'
38
+    . '"></script>'."\n";
39 39
 
40 40
 $template = new Template();
41 41
 $template->assign('room_name', $chatVideo->getRoomName());
Please login to merge, or discard this patch.
main/admin/user_import.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
     global $current_tag;
281 281
     switch ($data) {
282 282
         case 'Contact':
283
-            $user = array ();
283
+            $user = array();
284 284
             break;
285 285
         default:
286 286
             $current_tag = $data;
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
     $allowed_file_mimetype = array('csv', 'xml');
374 374
     $error_kind_file = false;
375 375
 
376
-    $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] :null;
376
+    $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] : null;
377 377
 
378 378
     $uploadInfo = pathinfo($_FILES['import_file']['name']);
379 379
     $ext_import_file = $uploadInfo['extension'];
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
         if (strcmp($file_type, 'csv') === 0 &&
383 383
             $ext_import_file == $allowed_file_mimetype[0]
384 384
         ) {
385
-            $users	= parse_csv_data($_FILES['import_file']['tmp_name']);
385
+            $users = parse_csv_data($_FILES['import_file']['tmp_name']);
386 386
             $errors = validate_data($users, $checkUniqueEmail);
387 387
             $error_kind_file = false;
388 388
         } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) {
Please login to merge, or discard this patch.
main/inc/lib/thematic.lib.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $from = intval($from);
75 75
         $number_of_items = intval($number_of_items);
76 76
 
77
-        if (!in_array($direction, array('ASC','DESC'))) {
77
+        if (!in_array($direction, array('ASC', 'DESC'))) {
78 78
             $direction = 'ASC';
79 79
         }
80 80
 
@@ -97,24 +97,24 @@  discard block
 block discarded – undo
97 97
             $thematic[1] = '<a href="index.php?'.api_get_cidreq().'&action=thematic_details&thematic_id='.$thematic[0].'">'.
98 98
                 Security::remove_XSS($thematic[1], STUDENT).$session_star.'</a>';
99 99
             if (api_is_allowed_to_edit(null, true)) {
100
-                $actions  = '';
100
+                $actions = '';
101 101
 
102 102
                 if (api_get_session_id()) {
103 103
                     if (api_get_session_id() == $thematic[3]) {
104 104
                         $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic[0].'">'.
105
-                            Display::return_icon('lesson_plan.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
105
+                            Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
106 106
                         $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic[0].'">'.
107
-                            Display::return_icon('lesson_plan_calendar.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
107
+                            Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
108 108
 
109 109
                         $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].'">'.
110
-                            Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>';
110
+                            Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
111 111
                         $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].'">'.
112
-                            Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
112
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
113 113
                     } else {
114
-                        $actions .= Display::return_icon('lesson_plan_na.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'&nbsp;';
115
-                        $actions .= Display::return_icon('lesson_plan_calendar_na.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'&nbsp;';
116
-                        $actions .= Display::return_icon('edit_na.png',get_lang('Edit'),'',ICON_SIZE_SMALL);
117
-                        $actions .= Display::return_icon('delete_na.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'&nbsp;';
114
+                        $actions .= Display::return_icon('lesson_plan_na.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).'&nbsp;';
115
+                        $actions .= Display::return_icon('lesson_plan_calendar_na.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).'&nbsp;';
116
+                        $actions .= Display::return_icon('edit_na.png', get_lang('Edit'), '', ICON_SIZE_SMALL);
117
+                        $actions .= Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'&nbsp;';
118 118
                         $actions .= Display::url(
119 119
                             Display::return_icon('cd.gif', get_lang('Copy')),
120 120
                             'index.php?'.api_get_cidreq().'&action=thematic_copy&thematic_id='.$thematic[0]
@@ -122,26 +122,26 @@  discard block
 block discarded – undo
122 122
                     }
123 123
                 } else {
124 124
                     $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic[0].'">'.
125
-                        Display::return_icon('lesson_plan.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
125
+                        Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
126 126
                     $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic[0].'">'.
127
-                        Display::return_icon('lesson_plan_calendar.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
127
+                        Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
128 128
 
129 129
                     if ($thematic[2] > 1) {
130 130
                         $actions .= '<a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$thematic[0].'">'.
131
-                            Display::return_icon('up.png', get_lang('Up'),'',ICON_SIZE_SMALL).'</a>';
131
+                            Display::return_icon('up.png', get_lang('Up'), '', ICON_SIZE_SMALL).'</a>';
132 132
                     } else {
133
-                        $actions .= Display::return_icon('up_na.png','&nbsp;','',ICON_SIZE_SMALL);
133
+                        $actions .= Display::return_icon('up_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
134 134
                     }
135 135
                     if ($thematic[2] < self::get_max_thematic_item()) {
136 136
                         $actions .= '<a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$thematic[0].'">'.
137
-                            Display::return_icon('down.png',get_lang('Down'),'',ICON_SIZE_SMALL).'</a>';
137
+                            Display::return_icon('down.png', get_lang('Down'), '', ICON_SIZE_SMALL).'</a>';
138 138
                     } else {
139
-                        $actions .= Display::return_icon('down_na.png','&nbsp;','',ICON_SIZE_SMALL);
139
+                        $actions .= Display::return_icon('down_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
140 140
                     }
141 141
                     $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].'">'.
142
-                        Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>';
142
+                        Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
143 143
                     $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].'">'.
144
-                        Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
144
+                        Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
145 145
                 }
146 146
                 $thematics[] = array($thematic[0], $thematic[1], $actions);
147 147
             }
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
         if (is_array($thematic_id)) {
377 377
             foreach ($thematic_id as $id) {
378
-                $id	= intval($id);
378
+                $id = intval($id);
379 379
                 $sql = "UPDATE $tbl_thematic SET active = 0
380 380
                         WHERE c_id = $course_id AND id = $id";
381 381
                 $result = Database::query($sql);
@@ -391,8 +391,8 @@  discard block
 block discarded – undo
391 391
                     );
392 392
                 }
393 393
             }
394
-        } else  {
395
-            $thematic_id	= intval($thematic_id);
394
+        } else {
395
+            $thematic_id = intval($thematic_id);
396 396
             $sql = "UPDATE $tbl_thematic SET active = 0
397 397
                     WHERE c_id = $course_id AND id = $thematic_id";
398 398
             $result = Database::query($sql);
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
         $new_thematic_id = $thematic_copy->thematic_save();
430 430
         if (!empty($new_thematic_id)) {
431 431
             $thematic_advanced = self::get_thematic_advance_by_thematic_id($thematic_id);
432
-            if(!empty($thematic_advanced)) {
433
-                foreach($thematic_advanced as $item) {
432
+            if (!empty($thematic_advanced)) {
433
+                foreach ($thematic_advanced as $item) {
434 434
                     $thematic = new Thematic();
435 435
                     $thematic->set_thematic_advance_attributes(
436 436
                         0,
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
         $column = intval($column);
495 495
         $from   = intval($from);
496 496
         $number_of_items = intval($number_of_items);
497
-        if (!in_array($direction, array('ASC','DESC'))) {
497
+        if (!in_array($direction, array('ASC', 'DESC'))) {
498 498
             $direction = 'ASC';
499 499
         }
500 500
         $data = array();
@@ -527,8 +527,8 @@  discard block
 block discarded – undo
527 527
                     $thematic_advance[1] = api_get_local_time($thematic_advance[1]);
528 528
                     $thematic_advance[1] = api_format_date($thematic_advance[1], DATE_TIME_FORMAT_LONG);
529 529
                     $actions  = '';
530
-                    $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',22).'</a>';
531
-                    $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('delete.png',get_lang('Delete'),'',22).'</a></center>';
530
+                    $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('edit.png', get_lang('Edit'), '', 22).'</a>';
531
+                    $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('delete.png', get_lang('Delete'), '', 22).'</a></center>';
532 532
                     $data[] = array($i, $thematic_advance[1], $thematic_advance[2], $thematic_advance[3], $actions);
533 533
                     $i++;
534 534
                 }
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 
593 593
                 $session_star = '';
594 594
                 if (api_is_allowed_to_edit(null, true)) {
595
-                    if ($thematic_advance['session_id'] !=0) {
595
+                    if ($thematic_advance['session_id'] != 0) {
596 596
                         $session_star = api_get_session_image(api_get_session_id(), $uinfo['status']);
597 597
                     }
598 598
                 }
@@ -618,13 +618,13 @@  discard block
 block discarded – undo
618 618
 
619 619
         foreach ($data as $thematic_id => $thematic_plan_data) {
620 620
             $new_thematic_plan_data = array();
621
-            foreach($thematic_plan_data as $thematic_item) {
621
+            foreach ($thematic_plan_data as $thematic_item) {
622 622
                 $thematic_simple_list[] = $thematic_item['description_type'];
623 623
                 $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item;
624 624
             }
625 625
 
626 626
             if (!empty($thematic_simple_list)) {
627
-                foreach($thematic_simple_list as $item) {
627
+                foreach ($thematic_simple_list as $item) {
628 628
                     $default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title'];
629 629
                 }
630 630
             }
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
                     }
641 641
                     if (!empty($data[$thematic_id][$id]['title']) && !empty($data[$thematic_id][$id]['description'])) {
642 642
                         if (api_is_allowed_to_edit(null, true)) {
643
-                            if ($data[$thematic_id][$id]['session_id'] !=0) {
643
+                            if ($data[$thematic_id][$id]['session_id'] != 0) {
644 644
                                 $session_star = api_get_session_image(api_get_session_id(), $uinfo['status']);
645 645
                             }
646 646
                         }
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
             if ($no_data) {
654 654
                 $return .= '<div><em>'.get_lang('StillDoNotHaveAThematicPlan').'</em></div>';
655 655
             }
656
-            $return  .= '</div>';
656
+            $return .= '</div>';
657 657
             $final_return[$thematic_id] = $return;
658 658
         }
659 659
 
@@ -866,18 +866,18 @@  discard block
 block discarded – undo
866 866
             api_get_session_id()
867 867
         );
868 868
 
869
-        $thematic_plan_complete_list  = array();
869
+        $thematic_plan_complete_list = array();
870 870
         $thematic_plan_id_list = array();
871 871
 
872 872
         if (!empty($items_from_course)) {
873
-            foreach($items_from_course as $item) {
873
+            foreach ($items_from_course as $item) {
874 874
                 $thematic_plan_id_list[] = $item['ref'];
875 875
                 $thematic_plan_complete_list[$item['ref']] = $item;
876 876
             }
877 877
         }
878 878
 
879 879
         if (!empty($items_from_session)) {
880
-            foreach($items_from_session as $item) {
880
+            foreach ($items_from_session as $item) {
881 881
                 $thematic_plan_id_list[] = $item['ref'];
882 882
                 $thematic_plan_complete_list[$item['ref']] = $item;
883 883
             }
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
                 if (!isset($thematic_id) && !isset($description_type)) {
901 901
                     // group all data group by thematic id
902 902
                     $tmp = array();
903
-                    while ($row = Database::fetch_array($rs,'ASSOC')) {
903
+                    while ($row = Database::fetch_array($rs, 'ASSOC')) {
904 904
                         $tmp[] = $row['thematic_id'];
905 905
                         if (in_array($row['thematic_id'], $tmp)) {
906 906
                             $row['session_id'] = $thematic_plan_complete_list[$row['id']];
@@ -908,7 +908,7 @@  discard block
 block discarded – undo
908 908
                         }
909 909
                     }
910 910
                 } else {
911
-                    while ($row = Database::fetch_array($rs,'ASSOC')) {
911
+                    while ($row = Database::fetch_array($rs, 'ASSOC')) {
912 912
                         $row['session_id'] = $thematic_plan_complete_list[$row['id']];
913 913
                         $data[] = $row;
914 914
                     }
@@ -943,8 +943,8 @@  discard block
 block discarded – undo
943 943
         );
944 944
 
945 945
         $elements_to_show = array();
946
-        foreach($list as $value) {
947
-            $elements_to_show[]= $value['ref'];
946
+        foreach ($list as $value) {
947
+            $elements_to_show[] = $value['ref'];
948 948
         }
949 949
         $condition = '';
950 950
         if (!empty($elements_to_show)) {
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
                     c_id = $course_id AND
957 957
                     thematic_id = $thematic_id AND
958 958
                     description_type = '$description_type'";
959
-        $rs	 = Database::query($sql);
959
+        $rs = Database::query($sql);
960 960
 
961 961
         $affected_rows = 0;
962 962
         if (Database::num_rows($rs) > 0) {
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
             $diff = array_diff($all, $a_thematic_advance_ids);
1191 1191
             if (!empty($diff)) {
1192 1192
                 $upd = "UPDATE $tbl_thematic_advance SET done_advance = 0
1193
-    			        WHERE c_id = $course_id AND id IN(".implode(',',$diff).") ";
1193
+    			        WHERE c_id = $course_id AND id IN(".implode(',', $diff).") ";
1194 1194
                 Database::query($upd);
1195 1195
             }
1196 1196
 
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
             $course_code = api_get_course_id();
1306 1306
         }
1307 1307
         if (api_get_session_id()) {
1308
-            $thematic_data = $this->get_thematic_list(null, $course_code );
1308
+            $thematic_data = $this->get_thematic_list(null, $course_code);
1309 1309
         } else {
1310 1310
             $thematic_data = $this->get_thematic_list(null, $course_code, 0);
1311 1311
         }
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
             }
1362 1362
             // calculate average by thematic
1363 1363
             $count_total_advances = count($advances);
1364
-            $average = round(($count_done_advances*100)/$count_total_advances);
1364
+            $average = round(($count_done_advances * 100) / $count_total_advances);
1365 1365
         }
1366 1366
 
1367 1367
         return $average;
@@ -1451,12 +1451,12 @@  discard block
 block discarded – undo
1451 1451
     public function get_default_thematic_plan_title()
1452 1452
     {
1453 1453
         $default_thematic_plan_titles = array();
1454
-        $default_thematic_plan_titles[1]= get_lang('Objectives');
1455
-        $default_thematic_plan_titles[2]= get_lang('SkillToAcquire');
1456
-        $default_thematic_plan_titles[3]= get_lang('Methodology');
1457
-        $default_thematic_plan_titles[4]= get_lang('Infrastructure');
1458
-        $default_thematic_plan_titles[5]= get_lang('Assessment');
1459
-        $default_thematic_plan_titles[6]= get_lang('Others');
1454
+        $default_thematic_plan_titles[1] = get_lang('Objectives');
1455
+        $default_thematic_plan_titles[2] = get_lang('SkillToAcquire');
1456
+        $default_thematic_plan_titles[3] = get_lang('Methodology');
1457
+        $default_thematic_plan_titles[4] = get_lang('Infrastructure');
1458
+        $default_thematic_plan_titles[5] = get_lang('Assessment');
1459
+        $default_thematic_plan_titles[6] = get_lang('Others');
1460 1460
 
1461 1461
         return $default_thematic_plan_titles;
1462 1462
     }
@@ -1468,12 +1468,12 @@  discard block
 block discarded – undo
1468 1468
     public function get_default_thematic_plan_icon()
1469 1469
     {
1470 1470
         $default_thematic_plan_icon = array();
1471
-        $default_thematic_plan_icon[1]= 'icons/32/objective.png';
1472
-        $default_thematic_plan_icon[2]= 'icons/32/skills.png';
1473
-        $default_thematic_plan_icon[3]= 'icons/32/strategy.png';
1474
-        $default_thematic_plan_icon[4]= 'icons/32/laptop.png';
1475
-        $default_thematic_plan_icon[5]= 'icons/32/assessment.png';
1476
-        $default_thematic_plan_icon[6]= 'icons/32/wizard.png';
1471
+        $default_thematic_plan_icon[1] = 'icons/32/objective.png';
1472
+        $default_thematic_plan_icon[2] = 'icons/32/skills.png';
1473
+        $default_thematic_plan_icon[3] = 'icons/32/strategy.png';
1474
+        $default_thematic_plan_icon[4] = 'icons/32/laptop.png';
1475
+        $default_thematic_plan_icon[5] = 'icons/32/assessment.png';
1476
+        $default_thematic_plan_icon[6] = 'icons/32/wizard.png';
1477 1477
 
1478 1478
         return $default_thematic_plan_icon;
1479 1479
     }
@@ -1485,11 +1485,11 @@  discard block
 block discarded – undo
1485 1485
     public function get_default_question()
1486 1486
     {
1487 1487
         $question = array();
1488
-        $question[1]= get_lang('ObjectivesQuestions');
1489
-        $question[2]= get_lang('SkillToAcquireQuestions');
1490
-        $question[3]= get_lang('MethodologyQuestions');
1491
-        $question[4]= get_lang('InfrastructureQuestions');
1492
-        $question[5]= get_lang('AssessmentQuestions');
1488
+        $question[1] = get_lang('ObjectivesQuestions');
1489
+        $question[2] = get_lang('SkillToAcquireQuestions');
1490
+        $question[3] = get_lang('MethodologyQuestions');
1491
+        $question[4] = get_lang('InfrastructureQuestions');
1492
+        $question[5] = get_lang('AssessmentQuestions');
1493 1493
 
1494 1494
         return $question;
1495 1495
     }
Please login to merge, or discard this patch.
main/inc/lib/usergroup.lib.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
             ";
83 83
             $result = Database::query($sql);
84 84
             if (Database::num_rows($result)) {
85
-                $row  = Database::fetch_array($result);
85
+                $row = Database::fetch_array($result);
86 86
 
87 87
                 return $row['count'];
88 88
             }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             ";
103 103
             $result = Database::query($sql);
104 104
             if (Database::num_rows($result)) {
105
-                $row  = Database::fetch_array($result);
105
+                $row = Database::fetch_array($result);
106 106
                 return $row['count'];
107 107
             }
108 108
         }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             ";
128 128
             $result = Database::query($sql);
129 129
             if (Database::num_rows($result)) {
130
-                $row  = Database::fetch_array($result);
130
+                $row = Database::fetch_array($result);
131 131
                 return $row['count'];
132 132
             }
133 133
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             ";
149 149
             $result = Database::query($sql);
150 150
             if (Database::num_rows($result)) {
151
-                $row  = Database::fetch_array($result);
151
+                $row = Database::fetch_array($result);
152 152
                 return $row['count'];
153 153
             }
154 154
 
@@ -529,13 +529,13 @@  discard block
 block discarded – undo
529 529
                 INNER JOIN {$this->table} g
530 530
                 ON (u.usergroup_id = g.id)
531 531
                 ";
532
-            $where =  array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId)));
532
+            $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId)));
533 533
         } else {
534 534
             $from = $this->usergroup_rel_user_table." u
535 535
                 INNER JOIN {$this->table} g
536 536
                 ON (u.usergroup_id = g.id)
537 537
                 ";
538
-            $where =  array('where' => array('user_id = ?' => $userId));
538
+            $where = array('where' => array('user_id = ?' => $userId));
539 539
         }
540 540
 
541 541
         if ($filterByType !== null) {
@@ -568,10 +568,10 @@  discard block
 block discarded – undo
568 568
             $urlId = api_get_current_access_url_id();
569 569
             $from = $this->usergroup_rel_user_table." u
570 570
                     INNER JOIN {$this->access_url_rel_usergroup} a ON (a.usergroup_id AND u.usergroup_id)";
571
-            $where =  array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId)));
571
+            $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId)));
572 572
         } else {
573 573
             $from = $this->usergroup_rel_user_table." u ";
574
-            $where =  array('where' => array('user_id = ?' => $userId));
574
+            $where = array('where' => array('user_id = ?' => $userId));
575 575
         }
576 576
 
577 577
         $results = Database::select(
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
             }
859 859
             $result = $new_result;
860 860
         }
861
-        $columns = array('name', 'users', 'courses','sessions', 'group_type');
861
+        $columns = array('name', 'users', 'courses', 'sessions', 'group_type');
862 862
 
863 863
         if (!in_array($sidx, $columns)) {
864 864
             $sidx = 'name';
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
                 }
1264 1264
             }
1265 1265
         }
1266
-        $response->addAssign('ajax_list_courses','innerHTML', api_utf8_encode($return));
1266
+        $response->addAssign('ajax_list_courses', 'innerHTML', api_utf8_encode($return));
1267 1267
 
1268 1268
         return $response;
1269 1269
     }
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
      * @param string style css
1372 1372
      * @return array with the file and the style of an image i.e $array['file'] $array['style']
1373 1373
      */
1374
-    public function get_picture_group($id, $picture_file, $height, $size_picture = GROUP_IMAGE_SIZE_MEDIUM , $style = '')
1374
+    public function get_picture_group($id, $picture_file, $height, $size_picture = GROUP_IMAGE_SIZE_MEDIUM, $style = '')
1375 1375
     {
1376 1376
         $picture = array();
1377 1377
         //$picture['style'] = $style;
@@ -1414,7 +1414,7 @@  discard block
 block discarded – undo
1414 1414
             if (file_exists($file) && !is_dir($file)) {
1415 1415
                 $picture['file'] = $image_array['dir'].$picture_file;
1416 1416
             } else {
1417
-                $picture['file'] = Display::returnIconPath('group_na.png',64);
1417
+                $picture['file'] = Display::returnIconPath('group_na.png', 64);
1418 1418
             }
1419 1419
         }
1420 1420
         return $picture;
@@ -1518,7 +1518,7 @@  discard block
 block discarded – undo
1518 1518
         if (empty($user_id)) {
1519 1519
             $user_id = api_get_user_id();
1520 1520
         }
1521
-        $user_role	= $this->get_user_group_role($user_id, $group_id);
1521
+        $user_role = $this->get_user_group_role($user_id, $group_id);
1522 1522
         if (in_array($user_role, array(GROUP_USER_PERMISSION_ADMIN))) {
1523 1523
             return true;
1524 1524
         } else {
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
         if (empty($user_id)) {
1537 1537
             $user_id = api_get_user_id();
1538 1538
         }
1539
-        $user_role	= $this->get_user_group_role($user_id, $group_id);
1539
+        $user_role = $this->get_user_group_role($user_id, $group_id);
1540 1540
         if (in_array($user_role, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_MODERATOR))) {
1541 1541
             return true;
1542 1542
         } else {
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
             GROUP_USER_PERMISSION_READER,
1564 1564
             GROUP_USER_PERMISSION_HRM,
1565 1565
         );
1566
-        $user_role	= self::get_user_group_role($user_id, $group_id);
1566
+        $user_role = self::get_user_group_role($user_id, $group_id);
1567 1567
         if (in_array($user_role, $roles)) {
1568 1568
             return true;
1569 1569
         } else {
@@ -1580,7 +1580,7 @@  discard block
 block discarded – undo
1580 1580
      * */
1581 1581
     public function get_user_group_role($user_id, $group_id)
1582 1582
     {
1583
-        $table_group_rel_user= $this->usergroup_rel_user_table;
1583
+        $table_group_rel_user = $this->usergroup_rel_user_table;
1584 1584
         $return_value = 0;
1585 1585
         if (!empty($user_id) && !empty($group_id)) {
1586 1586
             $sql = "SELECT relation_type FROM $table_group_rel_user
@@ -1588,8 +1588,8 @@  discard block
 block discarded – undo
1588 1588
                         usergroup_id = ".intval($group_id)." AND
1589 1589
                         user_id = ".intval($user_id)." ";
1590 1590
             $result = Database::query($sql);
1591
-            if (Database::num_rows($result)>0) {
1592
-                $row = Database::fetch_array($result,'ASSOC');
1591
+            if (Database::num_rows($result) > 0) {
1592
+                $row = Database::fetch_array($result, 'ASSOC');
1593 1593
                 $return_value = $row['relation_type'];
1594 1594
             }
1595 1595
         }
@@ -1644,7 +1644,7 @@  discard block
 block discarded – undo
1644 1644
         if (is_array($user_list) && is_array($group_list)) {
1645 1645
             foreach ($group_list as $group_id) {
1646 1646
                 foreach ($user_list as $user_id) {
1647
-                    $role = self::get_user_group_role($user_id,$group_id);
1647
+                    $role = self::get_user_group_role($user_id, $group_id);
1648 1648
                     if ($role == 0) {
1649 1649
                         $sql = "INSERT INTO $table_url_rel_group
1650 1650
 		               			SET
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
     public function delete_user_rel_group($user_id, $group_id)
1676 1676
     {
1677 1677
         $table = $this->usergroup_rel_user_table;
1678
-        $sql= "DELETE FROM $table
1678
+        $sql = "DELETE FROM $table
1679 1679
                WHERE
1680 1680
                 user_id = ".intval($user_id)." AND
1681 1681
                 usergroup_id = ".intval($group_id)."  ";
@@ -1731,7 +1731,7 @@  discard block
 block discarded – undo
1731 1731
 
1732 1732
         $sql = "UPDATE $table_group_rel_user
1733 1733
    				SET relation_type = ".intval($relation_type)."
1734
-                WHERE user_id = $user_id AND usergroup_id = $group_id" ;
1734
+                WHERE user_id = $user_id AND usergroup_id = $group_id";
1735 1735
         Database::query($sql);
1736 1736
     }
1737 1737
 
@@ -1773,7 +1773,7 @@  discard block
 block discarded – undo
1773 1773
         if (Database::num_rows($result) > 0) {
1774 1774
             while ($row = Database::fetch_array($result, 'ASSOC')) {
1775 1775
                 if ($with_image) {
1776
-                    $picture = self::get_picture_group($row['id'], $row['picture'],80);
1776
+                    $picture = self::get_picture_group($row['id'], $row['picture'], 80);
1777 1777
                     $img = '<img src="'.$picture['file'].'" />';
1778 1778
                     $row['picture'] = $img;
1779 1779
                 }
@@ -1809,11 +1809,11 @@  discard block
 block discarded – undo
1809 1809
 				ORDER BY count DESC
1810 1810
 				LIMIT $num";
1811 1811
 
1812
-        $result=Database::query($sql);
1812
+        $result = Database::query($sql);
1813 1813
         $array = array();
1814 1814
         while ($row = Database::fetch_array($result, 'ASSOC')) {
1815 1815
             if ($with_image) {
1816
-                $picture = self::get_picture_group($row['id'], $row['picture'],80);
1816
+                $picture = self::get_picture_group($row['id'], $row['picture'], 80);
1817 1817
                 $img = '<img src="'.$picture['file'].'" />';
1818 1818
                 $row['picture'] = $img;
1819 1819
             }
@@ -1858,11 +1858,11 @@  discard block
 block discarded – undo
1858 1858
                 ORDER BY created_at DESC
1859 1859
                 LIMIT $num ";
1860 1860
 
1861
-        $result=Database::query($sql);
1861
+        $result = Database::query($sql);
1862 1862
         $array = array();
1863 1863
         while ($row = Database::fetch_array($result, 'ASSOC')) {
1864 1864
             if ($with_image) {
1865
-                $picture = self::get_picture_group($row['id'], $row['picture'],80);
1865
+                $picture = self::get_picture_group($row['id'], $row['picture'], 80);
1866 1866
                 $img = '<img src="'.$picture['file'].'" />';
1867 1867
                 $row['picture'] = $img;
1868 1868
             }
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
         $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
1897 1897
         $group_id = intval($group_id);
1898 1898
 
1899
-        if (empty($group_id)){
1899
+        if (empty($group_id)) {
1900 1900
             return array();
1901 1901
         }
1902 1902
 
@@ -1911,9 +1911,9 @@  discard block
 block discarded – undo
1911 1911
             $where_relation_condition = '';
1912 1912
         } else {
1913 1913
             $new_relation_type = array();
1914
-            foreach($relation_type as $rel) {
1914
+            foreach ($relation_type as $rel) {
1915 1915
                 $rel = intval($rel);
1916
-                $new_relation_type[] ="'$rel'";
1916
+                $new_relation_type[] = "'$rel'";
1917 1917
             }
1918 1918
             $relation_type = implode(',', $new_relation_type);
1919 1919
             if (!empty($relation_type))
@@ -1957,7 +1957,7 @@  discard block
 block discarded – undo
1957 1957
         $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
1958 1958
         $group_id = intval($group_id);
1959 1959
 
1960
-        if (empty($group_id)){
1960
+        if (empty($group_id)) {
1961 1961
             return array();
1962 1962
         }
1963 1963
 
@@ -1968,7 +1968,7 @@  discard block
 block discarded – undo
1968 1968
 			    WHERE gu.usergroup_id= $group_id
1969 1969
 			    ORDER BY relation_type, firstname";
1970 1970
 
1971
-        $result=Database::query($sql);
1971
+        $result = Database::query($sql);
1972 1972
         $array = array();
1973 1973
         while ($row = Database::fetch_array($result, 'ASSOC')) {
1974 1974
             $array[$row['id']] = $row;
@@ -1996,33 +1996,33 @@  discard block
 block discarded – undo
1996 1996
             case GROUP_USER_PERMISSION_READER:
1997 1997
                 // I'm just a reader
1998 1998
                 $relation_group_title = get_lang('IAmAReader');
1999
-                $links .=  '<li class="'. ($show == 'invite_friends' ? 'active' : '') .'"><a href="group_invitation.php?id='.$group_id.'">'.
2000
-                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends')) . get_lang('InviteFriends') . '</a></li>';
2001
-                $links .=  '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2002
-                            Display::return_icon('group_leave.png', get_lang('LeaveGroup')) . get_lang('LeaveGroup') . '</a></li>';
1999
+                $links .= '<li class="'.($show == 'invite_friends' ? 'active' : '').'"><a href="group_invitation.php?id='.$group_id.'">'.
2000
+                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends')).get_lang('InviteFriends').'</a></li>';
2001
+                $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2002
+                            Display::return_icon('group_leave.png', get_lang('LeaveGroup')).get_lang('LeaveGroup').'</a></li>';
2003 2003
                 if (UserGroup::canLeave($group_info)) {
2004
-                    $links .=  '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2005
-                        Display::return_icon('group_leave.png', get_lang('LeaveGroup')) . get_lang('LeaveGroup') . '</a></li>';
2004
+                    $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2005
+                        Display::return_icon('group_leave.png', get_lang('LeaveGroup')).get_lang('LeaveGroup').'</a></li>';
2006 2006
                 }
2007 2007
                 break;
2008 2008
             case GROUP_USER_PERMISSION_ADMIN:
2009 2009
                 $relation_group_title = get_lang('IAmAnAdmin');
2010
-                $links .=  '<li class="'. ($show == 'group_edit' ? 'active' : '') .'"><a href="group_edit.php?id='.$group_id.'">'.
2011
-                            Display::return_icon('group_edit.png', get_lang('EditGroup')) . get_lang('EditGroup') . '</a></li>';
2012
-                $links .=  '<li class="'. ($show == 'member_list' ? 'active' : '') .'"><a href="group_waiting_list.php?id='.$group_id.'">'.
2013
-                            Display::return_icon('waiting_list.png', get_lang('WaitingList')) . get_lang('WaitingList') . '</a></li>';
2014
-                $links .=  '<li class="'. ($show == 'invite_friends' ? 'active' : '') .'"><a href="group_invitation.php?id='.$group_id.'">'.
2015
-                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends')) . get_lang('InviteFriends') . '</a></li>';
2010
+                $links .= '<li class="'.($show == 'group_edit' ? 'active' : '').'"><a href="group_edit.php?id='.$group_id.'">'.
2011
+                            Display::return_icon('group_edit.png', get_lang('EditGroup')).get_lang('EditGroup').'</a></li>';
2012
+                $links .= '<li class="'.($show == 'member_list' ? 'active' : '').'"><a href="group_waiting_list.php?id='.$group_id.'">'.
2013
+                            Display::return_icon('waiting_list.png', get_lang('WaitingList')).get_lang('WaitingList').'</a></li>';
2014
+                $links .= '<li class="'.($show == 'invite_friends' ? 'active' : '').'"><a href="group_invitation.php?id='.$group_id.'">'.
2015
+                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends')).get_lang('InviteFriends').'</a></li>';
2016 2016
                 if (UserGroup::canLeave($group_info)) {
2017 2017
                     $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2018
-                        Display::return_icon('group_leave.png', get_lang('LeaveGroup')) . get_lang('LeaveGroup') . '</a></li>';
2018
+                        Display::return_icon('group_leave.png', get_lang('LeaveGroup')).get_lang('LeaveGroup').'</a></li>';
2019 2019
                 }
2020 2020
                 break;
2021 2021
             case GROUP_USER_PERMISSION_PENDING_INVITATION:
2022 2022
 //				$links .=  '<li><a href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.Display::return_icon('addd.gif', get_lang('YouHaveBeenInvitedJoinNow'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('YouHaveBeenInvitedJoinNow').'</span></a></li>';
2023 2023
                 break;
2024 2024
             case GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER:
2025
-                $relation_group_title =  get_lang('WaitingForAdminResponse');
2025
+                $relation_group_title = get_lang('WaitingForAdminResponse');
2026 2026
                 break;
2027 2027
             case GROUP_USER_PERMISSION_MODERATOR:
2028 2028
                 $relation_group_title = get_lang('IAmAModerator');
@@ -2030,28 +2030,28 @@  discard block
 block discarded – undo
2030 2030
                 //$links .=  '<li><a href="groups.php?id='.$group_id.'">'.				Display::return_icon('message_list.png', get_lang('MessageList'), array('hspace'=>'6')).'<span class="'.($show=='messages_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MessageList').'</span></a></li>';
2031 2031
                 //$links .=  '<li><a href="group_members.php?id='.$group_id.'">'.		Display::return_icon('member_list.png', get_lang('MemberList'), array('hspace'=>'6')).'<span class="'.($show=='member_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MemberList').'</span></a></li>';
2032 2032
                 if ($group_info['visibility'] == GROUP_PERMISSION_CLOSED) {
2033
-                    $links .=  '<li><a href="group_waiting_list.php?id='.$group_id.'">'.
2034
-                                Display::return_icon('waiting_list.png', get_lang('WaitingList')) . get_lang('WaitingList') . '</a></li>';
2033
+                    $links .= '<li><a href="group_waiting_list.php?id='.$group_id.'">'.
2034
+                                Display::return_icon('waiting_list.png', get_lang('WaitingList')).get_lang('WaitingList').'</a></li>';
2035 2035
                 }
2036
-                $links .=  '<li><a href="group_invitation.php?id='.$group_id.'">'.
2037
-                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends')) . get_lang('InviteFriends') . '</a></li>';
2036
+                $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'.
2037
+                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends')).get_lang('InviteFriends').'</a></li>';
2038 2038
                 if (UserGroup::canLeave($group_info)) {
2039
-                    $links .=  '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2040
-                        Display::return_icon('group_leave.png', get_lang('LeaveGroup')) . get_lang('LeaveGroup') . '</a></li>';
2039
+                    $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2040
+                        Display::return_icon('group_leave.png', get_lang('LeaveGroup')).get_lang('LeaveGroup').'</a></li>';
2041 2041
                 }
2042 2042
                 break;
2043 2043
             case GROUP_USER_PERMISSION_HRM:
2044 2044
                 $relation_group_title = get_lang('IAmAHRM');
2045 2045
                 $links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group" class="ajax" title="'.get_lang('ComposeMessage').'" data-size="lg" data-title="'.get_lang('ComposeMessage').'">'.
2046
-                            Display::return_icon('new-message.png', get_lang('NewTopic')) . get_lang('NewTopic') . '</a></li>';
2047
-                $links .=  '<li><a href="group_view.php?id='.$group_id.'">'.
2048
-                            Display::return_icon('message_list.png', get_lang('MessageList')) . get_lang('MessageList') . '</a></li>';
2049
-                $links .=  '<li><a href="group_invitation.php?id='.$group_id.'">'.
2050
-                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends')) . get_lang('InviteFriends') . '</a></li>';
2051
-                $links .=  '<li><a href="group_members.php?id='.$group_id.'">'.
2052
-                            Display::return_icon('member_list.png', get_lang('MemberList')) . get_lang('MemberList') . '</a></li>';
2053
-                $links .=  '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2054
-                            Display::return_icon('delete_data.gif', get_lang('LeaveGroup')) . get_lang('LeaveGroup') . '</a></li>';
2046
+                            Display::return_icon('new-message.png', get_lang('NewTopic')).get_lang('NewTopic').'</a></li>';
2047
+                $links .= '<li><a href="group_view.php?id='.$group_id.'">'.
2048
+                            Display::return_icon('message_list.png', get_lang('MessageList')).get_lang('MessageList').'</a></li>';
2049
+                $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'.
2050
+                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends')).get_lang('InviteFriends').'</a></li>';
2051
+                $links .= '<li><a href="group_members.php?id='.$group_id.'">'.
2052
+                            Display::return_icon('member_list.png', get_lang('MemberList')).get_lang('MemberList').'</a></li>';
2053
+                $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2054
+                            Display::return_icon('delete_data.gif', get_lang('LeaveGroup')).get_lang('LeaveGroup').'</a></li>';
2055 2055
                 break;
2056 2056
             default:
2057 2057
                 //$links .=  '<li><a href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.Display::return_icon('addd.gif', get_lang('JoinGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('JoinGroup').'</a></span></li>';
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
         }
2144 2144
 
2145 2145
         $direction = 'ASC';
2146
-        if (!in_array($direction, array('ASC','DESC'))) {
2146
+        if (!in_array($direction, array('ASC', 'DESC'))) {
2147 2147
             $direction = 'ASC';
2148 2148
         }
2149 2149
 
@@ -2154,8 +2154,8 @@  discard block
 block discarded – undo
2154 2154
         $sql .= " LIMIT $from,$number_of_items";
2155 2155
 
2156 2156
         $res = Database::query($sql);
2157
-        if (Database::num_rows($res)> 0) {
2158
-            while ($row = Database::fetch_array($res,'ASSOC')) {
2157
+        if (Database::num_rows($res) > 0) {
2158
+            while ($row = Database::fetch_array($res, 'ASSOC')) {
2159 2159
                 if (!in_array($row['id'], $return)) {
2160 2160
                     $return[$row['id']] = $row;
2161 2161
                 }
@@ -2180,7 +2180,7 @@  discard block
 block discarded – undo
2180 2180
             if ($i == $max_level) {
2181 2181
                 $select_part .= "rg$rg_number.group_id as id_$rg_number ";
2182 2182
             } else {
2183
-                $select_part .="rg$rg_number.group_id as id_$rg_number, ";
2183
+                $select_part .= "rg$rg_number.group_id as id_$rg_number, ";
2184 2184
             }
2185 2185
             if ($i == 1) {
2186 2186
                 $cond_part .= "FROM $t_rel_group rg0 LEFT JOIN $t_rel_group rg$i on rg$rg_number.group_id = rg$i.subgroup_id ";
@@ -2365,7 +2365,7 @@  discard block
 block discarded – undo
2365 2365
         $nameList = '<ul class="list-unstyled">';
2366 2366
 
2367 2367
         foreach ($groupsNameListParsed as $name) {
2368
-            $nameList .= '<li>' . Display::span($name, ['class' => 'label label-info']) . '</li>';
2368
+            $nameList .= '<li>'.Display::span($name, ['class' => 'label label-info']).'</li>';
2369 2369
         }
2370 2370
 
2371 2371
         $nameList .= '</ul>';
Please login to merge, or discard this patch.
main/inc/lib/fileDisplay.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -249,7 +249,7 @@
 block discarded – undo
249 249
         'props.session_id'
250 250
     );
251 251
 
252
-    $visibility_rule = ' props.visibility ' . ($can_see_invisible ? '<> 2' : '= 1');
252
+    $visibility_rule = ' props.visibility '.($can_see_invisible ? '<> 2' : '= 1');
253 253
 
254 254
     $sql = "SELECT SUM(table1.size) FROM (
255 255
                 SELECT props.ref, size
Please login to merge, or discard this patch.
main/inc/lib/promotion.lib.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                     case 'updated_at':
64 64
                         break;
65 65
                     case 'name':
66
-                        $val .= ' ' . get_lang('CopyLabelSuffix');
66
+                        $val .= ' '.get_lang('CopyLabelSuffix');
67 67
                         $new[$key] = $val;
68 68
                         break;
69 69
                     case 'created_at':
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                         break;
73 73
                     case 'career_id':
74 74
                         if (!empty($career_id)) {
75
-                            $val = (int)$career_id;
75
+                            $val = (int) $career_id;
76 76
                         }
77 77
                         $new[$key] = $val;
78 78
                         break;
@@ -160,22 +160,22 @@  discard block
 block discarded – undo
160 160
     {
161 161
         // Action links
162 162
         echo '<div class="actions" style="margin-bottom:20px">';
163
-        echo '<a href="career_dashboard.php">' . Display::return_icon('back.png',
164
-                get_lang('Back'), '', '32') . '</a>';
165
-        echo '<a href="' . api_get_self() . '?action=add">' .
163
+        echo '<a href="career_dashboard.php">'.Display::return_icon('back.png',
164
+                get_lang('Back'), '', '32').'</a>';
165
+        echo '<a href="'.api_get_self().'?action=add">'.
166 166
             Display::return_icon(
167 167
                 'new_promotion.png',
168 168
                 get_lang('Add'),
169 169
                 '',
170 170
                 '32'
171
-            ) . '</a>';
172
-        echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'session/session_add.php">' .
171
+            ).'</a>';
172
+        echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_add.php">'.
173 173
             Display::return_icon(
174 174
                 'new_session.png',
175 175
                 get_lang('AddSession'),
176 176
                 '',
177 177
                 '32'
178
-            ) . '</a>';
178
+            ).'</a>';
179 179
         echo '</div>';
180 180
         echo Display::grid_html('promotions');
181 181
     }
Please login to merge, or discard this patch.
main/admin/extra_field_workflow.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 api_protect_admin_script();
16 16
 
17 17
 // setting breadcrumbs
18
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
18
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
19 19
 
20 20
 $tool_name = null;
21 21
 
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
 $token = Security::get_token();
37 37
 
38 38
 if ($action == 'add') {
39
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extraField->type,'name' => $extraField->pageName);
40
-    $interbreadcrumb[]=array(
39
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extraField->type, 'name' => $extraField->pageName);
40
+    $interbreadcrumb[] = array(
41 41
         'url' => 'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
42 42
         'name' => $extraFieldInfo['display_text']
43 43
     );
44
-    $interbreadcrumb[]=array(
44
+    $interbreadcrumb[] = array(
45 45
         'url' => 'extra_field_options.php?type='.$extraField->type.'&field_id='.$extraFieldInfo['id'],
46 46
         'name' => get_lang('EditExtraFieldOptions')
47 47
     );
48
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add'));
48
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
49 49
 } elseif ($action == 'edit') {
50 50
     $interbreadcrumb[] = array(
51 51
         'url' => 'extra_fields.php?type='.$extraField->type,
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 $paramsNoRole = 'field_id='.$field_id.'&type='.$extraField->type;
84 84
 
85 85
 //The order is important you need to check the the $column variable in the model.ajax.php file
86
-$columns = array(get_lang('Name'), get_lang('Value'),  get_lang('Order'), get_lang('Actions'));
86
+$columns = array(get_lang('Name'), get_lang('Value'), get_lang('Order'), get_lang('Actions'));
87 87
 
88
-$htmlHeadXtra[]='<script>
88
+$htmlHeadXtra[] = '<script>
89 89
 
90 90
     function setHidden(obj) {
91 91
         var name = $(obj).attr("name");
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
 if (!empty($roleId)) {
187 187
     $form->addElement('html', $table->toHtml());
188 188
     $group = array();
189
-    $group[]= $form->createElement('button', 'submit', get_lang('Save'));
190
-    $group[]= $form->createElement('button', 'select_all', get_lang('SelectAll'), array('class' => 'btn select_all'));
191
-    $group[]= $form->createElement('button', 'unselect_all', get_lang('UnSelectAll'), array('class' => 'btn unselect_all'));
189
+    $group[] = $form->createElement('button', 'submit', get_lang('Save'));
190
+    $group[] = $form->createElement('button', 'select_all', get_lang('SelectAll'), array('class' => 'btn select_all'));
191
+    $group[] = $form->createElement('button', 'unselect_all', get_lang('UnSelectAll'), array('class' => 'btn unselect_all'));
192 192
     $form->addGroup($group, '', null, ' ');
193 193
 
194 194
     $form->setDefaults(array('status' => $roleId));
Please login to merge, or discard this patch.