Passed
Push — 1.10.x ( d9a04b...aeb152 )
by Yannick
123:06 queued 74:04
created
main/admin/index.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 $nameTools = get_lang('PlatformAdmin');
20 20
 
21 21
 $accessUrlId = 0;
22
-$adminExtraContentDir = api_get_path(SYS_APP_PATH) . "home/admin/";
22
+$adminExtraContentDir = api_get_path(SYS_APP_PATH)."home/admin/";
23 23
 
24 24
 if (api_is_multiple_url_enabled()) {
25 25
     $accessUrlId = api_get_current_access_url_id();
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $urlInfo = api_get_access_url($accessUrlId);
29 29
         $url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $urlInfo['url']));
30 30
         $cleanUrl = str_replace('/', '-', $url);
31
-        $adminExtraContentDir = api_get_path(SYS_APP_PATH) . "home/$cleanUrl/admin/";
31
+        $adminExtraContentDir = api_get_path(SYS_APP_PATH)."home/$cleanUrl/admin/";
32 32
     }
33 33
 }
34 34
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             <div class="form-group">
97 97
                 <input class="form-control" type="text" name="keyword" value="">
98 98
                 <button class="btn btn-default" type="submit">
99
-                    <em class="fa fa-search"></em> ' . get_lang('Search') . '
99
+                    <em class="fa fa-search"></em> ' . get_lang('Search').'
100 100
                 </button>
101 101
             </div>
102 102
         </form>';
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             <div class="form-group">
150 150
                 <input class="form-control" type="text" name="keyword" value="">
151 151
                 <button class="btn btn-default" type="submit">
152
-                    <em class="fa fa-search"></em> ' . get_lang('Search') . '
152
+                    <em class="fa fa-search"></em> ' . get_lang('Search').'
153 153
                 </button>
154 154
             </div>
155 155
         </form>';
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                 <input class="form-control" type="text" name="search_field" value="" >
210 210
                 <input type="hidden" value="search_setting" name="category">
211 211
                 <button class="btn btn-default" type="submit">
212
-                    <em class="fa fa-search"></em> ' . get_lang('Search') . '
212
+                    <em class="fa fa-search"></em> ' . get_lang('Search').'
213 213
                 </button>
214 214
             </div>
215 215
         </form>';
@@ -222,18 +222,18 @@  discard block
 block discarded – undo
222 222
     $items[] = array('url' => 'settings.php?category=Regions', 'label' => get_lang('Regions'));
223 223
     $items[] = array('url' => 'system_announcements.php', 'label' => get_lang('SystemAnnouncements'));
224 224
     $items[] = array(
225
-        'url' => api_get_path(WEB_CODE_PATH) . 'calendar/agenda_js.php?type=admin',
225
+        'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?type=admin',
226 226
         'label' => get_lang('GlobalAgenda')
227 227
     );
228 228
     $items[] = array('url' => 'configure_homepage.php', 'label' => get_lang('ConfigureHomePage'));
229 229
     $items[] = array('url' => 'configure_inscription.php', 'label' => get_lang('ConfigureInscription'));
230 230
     $items[] = array('url' => 'statistics/index.php', 'label' => get_lang('Statistics'));
231 231
     $items[] = array(
232
-        'url' => api_get_path(WEB_CODE_PATH) . 'mySpace/company_reports.php',
232
+        'url' => api_get_path(WEB_CODE_PATH).'mySpace/company_reports.php',
233 233
         'label' => get_lang('Reports')
234 234
     );
235 235
     $items[] = array(
236
-        'url' => api_get_path(WEB_CODE_PATH) . 'admin/teacher_time_report.php',
236
+        'url' => api_get_path(WEB_CODE_PATH).'admin/teacher_time_report.php',
237 237
         'label' => get_lang('TeacherTimeReport')
238 238
     );
239 239
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
                     <div class="form-group">
283 283
                         <input class="form-control" type="text" name="keyword" value="">
284 284
                         <button class="btn btn-default" type="submit">
285
-                            <em class="fa fa-search"></em> ' . get_lang('Search') . '
285
+                            <em class="fa fa-search"></em> ' . get_lang('Search').'
286 286
                         </button>
287 287
                     </div>
288 288
                 </form>';
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 
311 311
 if (api_is_platform_admin()) {
312 312
     // option only visible in development mode. Enable through code if required
313
-    if (is_dir(api_get_path(SYS_TEST_PATH) . 'datafiller/')) {
313
+    if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) {
314 314
         $items[] = array('url' => 'user_move_stats.php', 'label' => get_lang('MoveUserStats'));
315 315
     }
316 316
     $items[] = array('url' => 'career_dashboard.php', 'label' => get_lang('CareersAndPromotions'));
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
     $items = array();
338 338
     $items[] = array('url' => 'special_exports.php', 'label' => get_lang('SpecialExports'));
339 339
     $items[] = array('url' => 'system_status.php', 'label' => get_lang('SystemStatus'));
340
-    if (is_dir(api_get_path(SYS_TEST_PATH) . 'datafiller/')) {
340
+    if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) {
341 341
         $items[] = array('url' => 'filler.php', 'label' => get_lang('DataFiller'));
342 342
     }
343 343
 
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
         $items[] = array('url' => 'skill_list.php', 'label' => get_lang('ManageSkills'));
382 382
         //$items[] = array('url'=>'skills_profile.php',   'label' => get_lang('SkillsProfile'));
383 383
         $items[] = array(
384
-            'url' => api_get_path(WEB_CODE_PATH) . 'social/skills_ranking.php',
384
+            'url' => api_get_path(WEB_CODE_PATH).'social/skills_ranking.php',
385 385
             'label' => get_lang('SkillsRanking')
386 386
         );
387 387
         $items[] = array('url' => 'skills_gradebook.php', 'label' => get_lang('SkillsAndGradebooks'));
388 388
         $items[] = array(
389
-            'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php',
389
+            'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php',
390 390
             'label' => get_lang('Badges')
391 391
         );
392 392
         $blocks['skills']['items'] = $items;
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         }
440 440
     }
441 441
 }
442
-$admin_ajax_url = api_get_path(WEB_AJAX_PATH) . 'admin.ajax.php';
442
+$admin_ajax_url = api_get_path(WEB_AJAX_PATH).'admin.ajax.php';
443 443
 
444 444
 $tpl = new Template();
445 445
 
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                 die;
493 493
             }
494 494
 
495
-            $fullFilePath = $adminExtraContentDir . $extraData['block'];
495
+            $fullFilePath = $adminExtraContentDir.$extraData['block'];
496 496
             $fullFilePath .= "_extra.html";
497 497
 
498 498
             file_put_contents($fullFilePath, $extraData['extra_content']);
Please login to merge, or discard this patch.
main/admin/event_type.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 
46 46
 $languages = api_get_languages();
47 47
 
48
-$ajaxPath = api_get_path(WEB_CODE_PATH) . 'inc/ajax/events.ajax.php';
48
+$ajaxPath = api_get_path(WEB_CODE_PATH).'inc/ajax/events.ajax.php';
49 49
 
50
-$action_array = array(array('url' =>'event_controller.php?action=listing' , 'content' => Display::return_icon('view_text.png', get_lang('ListView'), array(), ICON_SIZE_MEDIUM)));
50
+$action_array = array(array('url' =>'event_controller.php?action=listing', 'content' => Display::return_icon('view_text.png', get_lang('ListView'), array(), ICON_SIZE_MEDIUM)));
51 51
 
52 52
 $key_lang = get_lang('YouHaveSomeUnsavedChanges');
53 53
 $users = UserManager::get_user_list(array(), array('firstname'));
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
         <select class="col-md-6" multiple="1" id="eventList" onchange="confirmMessage(this.name); return false;" name="eventList">
312 312
         <?php
313 313
         foreach ($event_config as $key => $config) {
314
-            echo '<option value="' . $key . '">' . $config['name_lang_var'] . '</option>';
314
+            echo '<option value="'.$key.'">'.$config['name_lang_var'].'</option>';
315 315
         }
316 316
         ?>
317 317
         </select>
Please login to merge, or discard this patch.
main/admin/dashboard_add_users_to_user.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 // setting breadcrumbs
25 25
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
26
-$interbreadcrumb[] = array('url' => 'user_list.php','name' => get_lang('UserList'));
26
+$interbreadcrumb[] = array('url' => 'user_list.php', 'name' => get_lang('UserList'));
27 27
 
28 28
 // Database Table Definitions
29 29
 $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
@@ -43,17 +43,17 @@  discard block
 block discarded – undo
43 43
 $isAdmin = UserManager::is_admin($user_id);
44 44
 if ($isAdmin) {
45 45
     $userStatus = PLATFORM_ADMIN;
46
-    $tool_name= get_lang('AssignUsersToPlatformAdministrator');
46
+    $tool_name = get_lang('AssignUsersToPlatformAdministrator');
47 47
 } else if ($user_info['status'] == SESSIONADMIN) {
48
-    $tool_name= get_lang('AssignUsersToSessionsAdministrator');
49
-} else if  ($user_info['status'] == STUDENT_BOSS) {
50
-    $tool_name= get_lang('AssignUsersToBoss');
48
+    $tool_name = get_lang('AssignUsersToSessionsAdministrator');
49
+} else if ($user_info['status'] == STUDENT_BOSS) {
50
+    $tool_name = get_lang('AssignUsersToBoss');
51 51
 } else {
52
-    $tool_name= get_lang('AssignUsersToHumanResourcesManager');
52
+    $tool_name = get_lang('AssignUsersToHumanResourcesManager');
53 53
 }
54 54
 
55 55
 $add_type = 'multiple';
56
-if (isset($_GET['add_type']) && $_GET['add_type']!='') {
56
+if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
57 57
 	$add_type = Security::remove_XSS($_REQUEST['add_type']);
58 58
 }
59 59
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 function search_users($needle, $type)
65 65
 {
66
-    global $tbl_access_url_rel_user,  $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus;
66
+    global $tbl_access_url_rel_user, $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus;
67 67
 
68 68
     $xajax_response = new xajaxResponse();
69 69
     $return = '';
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                     LEFT JOIN $tbl_access_url_rel_user au ON (au.user_id = user.user_id)
102 102
                     WHERE
103 103
                         ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND
104
-                        status NOT IN(".DRH.", ".SESSIONADMIN.", " . STUDENT_BOSS . ") AND
104
+                        status NOT IN(".DRH.", ".SESSIONADMIN.", ".STUDENT_BOSS.") AND
105 105
                         user.user_id NOT IN ($user_anonymous, $current_user_id, $user_id)
106 106
                         $without_assigned_users AND
107 107
                         access_url_id = ".api_get_current_access_url_id()."
@@ -113,15 +113,15 @@  discard block
 block discarded – undo
113 113
                     FROM $tbl_user user
114 114
                     WHERE
115 115
                         ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND
116
-                        status NOT IN(".DRH.", ".SESSIONADMIN.", " . STUDENT_BOSS . ") AND
116
+                        status NOT IN(".DRH.", ".SESSIONADMIN.", ".STUDENT_BOSS.") AND
117 117
                         user_id NOT IN ($user_anonymous, $current_user_id, $user_id)
118 118
                     $without_assigned_users
119 119
                     $order_clause
120 120
             ";
121 121
         }
122 122
 
123
-		$rs	= Database::query($sql);
124
-		$xajax_response->addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return));
123
+		$rs = Database::query($sql);
124
+		$xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
125 125
 
126 126
         if ($type == 'single') {
127 127
             $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 
141 141
             switch ($userStatus) {
142 142
                 case DRH:
143
-                    $sql .= " user.status <> 6 AND user.status <> " . DRH;
143
+                    $sql .= " user.status <> 6 AND user.status <> ".DRH;
144 144
                     break;
145 145
                 case STUDENT_BOSS:
146
-                    $sql .= " user.status <> 6 AND user.status <> " . STUDENT_BOSS;
146
+                    $sql .= " user.status <> 6 AND user.status <> ".STUDENT_BOSS;
147 147
                     break;
148 148
             }
149 149
 
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
                     $return .= '...<br />';
161 161
                 }
162 162
             }
163
-           $xajax_response->addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
163
+           $xajax_response->addAssign('ajax_list_users_single', 'innerHTML', api_utf8_encode($return));
164 164
         } else {
165 165
             $return .= '<select id="origin" class="form-control" name="NoAssignedUsersList[]" multiple="multiple" size="15" ">';
166
-            while($user = Database :: fetch_array($rs)) {
166
+            while ($user = Database :: fetch_array($rs)) {
167 167
                 $person_name = api_get_person_name($user['firstname'], $user['lastname']);
168
-                $return .= '<option value="'.$user['user_id'].'" title="'.htmlspecialchars($person_name,ENT_QUOTES).'">'.$person_name.' ('.$user['username'].')</option>';
168
+                $return .= '<option value="'.$user['user_id'].'" title="'.htmlspecialchars($person_name, ENT_QUOTES).'">'.$person_name.' ('.$user['username'].')</option>';
169 169
             }
170 170
             $return .= '</select>';
171 171
             $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 }
243 243
 </script>';
244 244
 
245
-$formSent=0;
245
+$formSent = 0;
246 246
 $errorMsg = '';
247 247
 $UserList = array();
248 248
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
 $searchForm = new FormValidator('search', 'get', api_get_self().'?user='.$user_id);
259 259
 $searchForm->addHeader(get_lang('AdvancedSearch'));
260
-$renderer =& $searchForm->defaultRenderer();
260
+$renderer = & $searchForm->defaultRenderer();
261 261
 
262 262
 $searchForm->addElement('hidden', 'user', $user_id);
263 263
 foreach ($filters as $param) {
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
             $affected_rows = 0;
300 300
     }
301 301
 
302
-    if ($affected_rows)	{
302
+    if ($affected_rows) {
303 303
         $msg = get_lang('AssignedUsersHaveBeenUpdatedSuccessfully');
304 304
     }
305 305
 }
@@ -311,17 +311,17 @@  discard block
 block discarded – undo
311 311
 
312 312
 if ($userStatus != STUDENT_BOSS) {
313 313
     $actionsLeft = Display::url(
314
-        Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM ), "dashboard_add_courses_to_user.php?user=$user_id"
314
+        Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM), "dashboard_add_courses_to_user.php?user=$user_id"
315 315
     );
316 316
 
317 317
     $actionsLeft .= Display::url(
318
-        Display::return_icon('session-add.png', get_lang('AssignSessions'), null, ICON_SIZE_MEDIUM ) , "dashboard_add_sessions_to_user.php?user=$user_id"
318
+        Display::return_icon('session-add.png', get_lang('AssignSessions'), null, ICON_SIZE_MEDIUM), "dashboard_add_sessions_to_user.php?user=$user_id"
319 319
     );
320 320
 }
321 321
 
322
-$actionsRight = Display::url('<em class="fa fa-search"></em> ' . get_lang('AdvancedSearch'), '#', array('class' => 'btn btn-default advanced_options', 'id' => 'advanced_search'));
322
+$actionsRight = Display::url('<em class="fa fa-search"></em> '.get_lang('AdvancedSearch'), '#', array('class' => 'btn btn-default advanced_options', 'id' => 'advanced_search'));
323 323
 
324
-$toolbar = Display::toolbarAction('toolbar-dashboard', $content = array( 0 => $actionsLeft, 1 => $actionsRight ));
324
+$toolbar = Display::toolbarAction('toolbar-dashboard', $content = array(0 => $actionsLeft, 1 => $actionsRight));
325 325
 echo $toolbar;
326 326
 
327 327
 echo '<div id="advanced_search_options" style="display:none">';
@@ -349,13 +349,13 @@  discard block
 block discarded – undo
349 349
 $assigned_users_id = array_keys($assigned_users_to_hrm);
350 350
 $without_assigned_users = '';
351 351
 if (count($assigned_users_id) > 0) {
352
-	$without_assigned_users = " user.user_id NOT IN(".implode(',',$assigned_users_id).") AND ";
352
+	$without_assigned_users = " user.user_id NOT IN(".implode(',', $assigned_users_id).") AND ";
353 353
 }
354 354
 
355 355
 $search_user = '';
356 356
 if (!empty($firstLetterUser)) {
357 357
 	$needle = Database::escape_string($firstLetterUser);
358
-	$search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
358
+	$search_user = "AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
359 359
 }
360 360
 
361 361
 $sqlConditions = null;
@@ -395,12 +395,12 @@  discard block
 block discarded – undo
395 395
 			    $sqlConditions
396 396
             ORDER BY firstname ";
397 397
 }
398
-$result	= Database::query($sql);
398
+$result = Database::query($sql);
399 399
 ?>
400
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" class="form-horizontal" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
400
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" class="form-horizontal" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
401 401
 <input type="hidden" name="formSent" value="1" />
402 402
 <?php
403
-if(!empty($msg)) {
403
+if (!empty($msg)) {
404 404
 	Display::display_normal_message($msg); //main API
405 405
 }
406 406
 ?>
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
                     <select id="origin" class="form-control" name="NoAssignedUsersList[]" multiple="multiple" size="15">
416 416
                         <?php   while ($enreg = Database::fetch_array($result)) {
417 417
                                 $person_name = api_get_person_name($enreg['firstname'], $enreg['lastname']); ?>
418
-                                  <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name,ENT_QUOTES).'"';?>>
418
+                                  <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name, ENT_QUOTES).'"'; ?>>
419 419
                             <?php echo $person_name.' ('.$enreg['username'].')'; ?>
420 420
                         </option>
421 421
                         <?php } ?>
@@ -428,8 +428,8 @@  discard block
 block discarded – undo
428 428
     </div>
429 429
     <div class="col-md-4">
430 430
         <div class="code-course">
431
-            <?php if($add_type == 'multiple') { ?>
432
-                <p><?php echo get_lang('FirstLetterUser');?></p>
431
+            <?php if ($add_type == 'multiple') { ?>
432
+                <p><?php echo get_lang('FirstLetterUser'); ?></p>
433 433
                 <select class="selectpicker show-tick form-control" name="firstLetterUser" onchange = "xajax_search_users(this.value,'multiple')">
434 434
                     <option value="%">--</option>
435 435
                     <?php echo Display::get_alphabet_options($firstLetterUser); ?>
@@ -481,10 +481,10 @@  discard block
 block discarded – undo
481 481
                 <select id='destination' class="form-control" name="UsersList[]" multiple="multiple" size="15" >
482 482
                     <?php
483 483
                     if (is_array($assigned_users_to_hrm)) {
484
-                            foreach($assigned_users_to_hrm as $enreg) {
484
+                            foreach ($assigned_users_to_hrm as $enreg) {
485 485
                                     $person_name = api_get_person_name($enreg['firstname'], $enreg['lastname']);
486 486
                     ?>
487
-                            <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name,ENT_QUOTES).'"'; ?>>
487
+                            <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name, ENT_QUOTES).'"'; ?>>
488 488
                         <?php echo $person_name.' ('.$enreg['username'].')'; ?>
489 489
                     </option>
490 490
                     <?php }
Please login to merge, or discard this patch.
main/admin/class_list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
 function get_class_data($from, $number_of_items, $column, $direction = 'ASC') {
36 36
     $tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER);
37 37
     $tbl_class = Database :: get_main_table(TABLE_MAIN_CLASS);
38
-    $from 				= intval($from);
39
-    $number_of_items 	= intval($number_of_items);
38
+    $from = intval($from);
39
+    $number_of_items = intval($number_of_items);
40 40
     $column 			= intval($column);
41
-    $direction 			= ($direction == 'ASC'?'ASC':'DESC');
41
+    $direction = ($direction == 'ASC' ? 'ASC' : 'DESC');
42 42
 
43 43
     $sql = "SELECT 	id AS col0, name AS col1, COUNT(user_id) AS col2, id AS col3
44 44
         FROM $tbl_class
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     }
49 49
     $sql .= " GROUP BY id,name ORDER BY col$column $direction LIMIT $from,$number_of_items";
50 50
     $res = Database::query($sql);
51
-    $classes = array ();
51
+    $classes = array();
52 52
     while ($class = Database::fetch_row($res)) {
53 53
         $classes[] = $class;
54 54
     }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 }
69 69
 
70 70
 $tool_name = get_lang('ClassList');
71
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
71
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
72 72
 
73 73
 if (isset($_POST['action'])) {
74 74
     switch ($_POST['action']) {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 // Create a search-box
101 101
 $form = new FormValidator('search_simple', 'get', '', '', null, false);
102
-$renderer =& $form->defaultRenderer();
102
+$renderer = & $form->defaultRenderer();
103 103
 $renderer->setCustomElementTemplate('<span>{element}</span> ');
104 104
 $form->addElement('text', 'keyword', get_lang('Keyword'));
105 105
 $form->addElement('button', 'submit', get_lang('Search'));
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 $table->set_header(2, get_lang('NumberOfUsers'));
114 114
 $table->set_header(3, '', false);
115 115
 $table->set_column_filter(3, 'modify_filter');
116
-$table->set_form_actions(array ('delete_classes' => get_lang('DeleteSelectedClasses')), 'class');
116
+$table->set_form_actions(array('delete_classes' => get_lang('DeleteSelectedClasses')), 'class');
117 117
 
118 118
 $content .= $table->return_table();
119 119
 
Please login to merge, or discard this patch.
main/admin/class_information.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
     api_not_allowed();
19 19
 }
20 20
 
21
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
22
-$interbreadcrumb[] = array ('url' => 'class_list.php', 'name' => get_lang('AdminClasses'));
21
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
22
+$interbreadcrumb[] = array('url' => 'class_list.php', 'name' => get_lang('AdminClasses'));
23 23
 
24 24
 $class_id = $_GET['id'];
25 25
 $class = ClassManager::get_class_info($class_id);
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
 $users = ClassManager::get_users($class_id);
36 36
 if (count($users) > 0) {
37 37
     $is_western_name_order = api_is_western_name_order();
38
-    $table_header[] = array (get_lang('OfficialCode'), true);
38
+    $table_header[] = array(get_lang('OfficialCode'), true);
39 39
     if ($is_western_name_order) {
40
-        $table_header[] = array (get_lang('FirstName'), true);
41
-        $table_header[] = array (get_lang('LastName'), true);
40
+        $table_header[] = array(get_lang('FirstName'), true);
41
+        $table_header[] = array(get_lang('LastName'), true);
42 42
     } else {
43
-        $table_header[] = array (get_lang('LastName'), true);
44
-        $table_header[] = array (get_lang('FirstName'), true);
43
+        $table_header[] = array(get_lang('LastName'), true);
44
+        $table_header[] = array(get_lang('FirstName'), true);
45 45
     }
46
-    $table_header[] = array (get_lang('Email'), true);
47
-    $table_header[] = array (get_lang('Status'), true);
48
-    $table_header[] = array ('', false);
46
+    $table_header[] = array(get_lang('Email'), true);
47
+    $table_header[] = array(get_lang('Status'), true);
48
+    $table_header[] = array('', false);
49 49
     $data = array();
50
-    foreach($users as $index => $user) {
50
+    foreach ($users as $index => $user) {
51 51
         $username = api_htmlentities(sprintf(get_lang('LoginX'), $user['username']), ENT_QUOTES);
52
-        $row = array ();
52
+        $row = array();
53 53
         $row[] = $user['official_code'];
54 54
         if ($is_western_name_order) {
55 55
             $row[] = $user['firstname'];
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $row[] = '<a href="user_information.php?user_id='.$user['user_id'].'">'.Display::return_icon('synthese_view.gif', get_lang('Info')).'</a>';
64 64
         $data[] = $row;
65 65
     }
66
-    Display::display_sortable_table($table_header,$data,array(),array(),array('id'=>$_GET['id']));
66
+    Display::display_sortable_table($table_header, $data, array(), array(), array('id'=>$_GET['id']));
67 67
 } else {
68 68
     echo get_lang('NoUsersInClass');
69 69
 }
@@ -73,22 +73,22 @@  discard block
 block discarded – undo
73 73
  */
74 74
 $courses = ClassManager::get_courses($class_id);
75 75
 if (count($courses) > 0) {
76
-    $header[] = array (get_lang('Code'), true);
77
-    $header[] = array (get_lang('Title'), true);
78
-    $header[] = array ('', false);
79
-    $data = array ();
80
-    foreach( $courses as $index => $course) {
81
-        $row = array ();
76
+    $header[] = array(get_lang('Code'), true);
77
+    $header[] = array(get_lang('Title'), true);
78
+    $header[] = array('', false);
79
+    $data = array();
80
+    foreach ($courses as $index => $course) {
81
+        $row = array();
82 82
         $row[] = $course['visual_code'];
83 83
         $row[] = $course['title'];
84 84
         $row[] = '<a href="course_information.php?code='.$course['code'].'">'.Display::return_icon('info_small.gif', get_lang('Delete')).'</a>'.
85
-                    '<a href="'.api_get_path(WEB_COURSE_PATH).$course['directory'].'">'.Display::return_icon('course_home.gif', get_lang('CourseHome')).'</a>' .
85
+                    '<a href="'.api_get_path(WEB_COURSE_PATH).$course['directory'].'">'.Display::return_icon('course_home.gif', get_lang('CourseHome')).'</a>'.
86 86
                     '<a href="course_edit.php?course_code='.$course['code'].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
87 87
         $data[] = $row;
88 88
     }
89 89
     echo '<p><b>'.get_lang('Courses').'</b></p>';
90 90
     echo '<blockquote>';
91
-    Display :: display_sortable_table($header, $data, array (), array (), array('id'=>$_GET['id']));
91
+    Display :: display_sortable_table($header, $data, array(), array(), array('id'=>$_GET['id']));
92 92
     echo '</blockquote>';
93 93
 } else {
94 94
     echo '<p>'.get_lang('NoCoursesForThisClass').'</p>';
Please login to merge, or discard this patch.
main/admin/sub_language.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 $this_section = SECTION_PLATFORM_ADMIN;
12 12
 
13 13
 api_protect_admin_script();
14
-$htmlHeadXtra[] ='<script type="text/javascript">
14
+$htmlHeadXtra[] = '<script type="text/javascript">
15 15
  $(document).ready(function() {
16 16
 	$(".save").click(function() {
17 17
 		button_name=$(this).attr("name");
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 // setting the name of the tool
54 54
 $tool_name = get_lang('CreateSubLanguage');
55 55
 // setting breadcrumbs
56
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
57
-$interbreadcrumb[] = array ('url' => 'languages.php', 'name' => get_lang('PlatformLanguages'));
56
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
57
+$interbreadcrumb[] = array('url' => 'languages.php', 'name' => get_lang('PlatformLanguages'));
58 58
 
59 59
 $sublanguage_folder_error = false;
60 60
 
61
-if (isset($_GET['id']) && $_GET['id']==strval(intval($_GET['id']))) {
62
-	$language_name              = SubLanguageManager::get_name_of_language_by_id ($_GET['id']);
63
-	$sub_language_name          = SubLanguageManager::get_name_of_language_by_id ($_GET['sub_language_id']);
61
+if (isset($_GET['id']) && $_GET['id'] == strval(intval($_GET['id']))) {
62
+	$language_name              = SubLanguageManager::get_name_of_language_by_id($_GET['id']);
63
+	$sub_language_name          = SubLanguageManager::get_name_of_language_by_id($_GET['sub_language_id']);
64 64
 	$all_data_of_language       = SubLanguageManager::get_all_information_of_language($_GET['id']);
65 65
 	$all_data_of_sublanguage    = SubLanguageManager::get_all_information_of_language($_GET['sub_language_id']);
66 66
 	$sub_language_file          = api_get_path(SYS_LANG_PATH).$all_data_of_sublanguage['dokeos_folder'];
@@ -68,20 +68,20 @@  discard block
 block discarded – undo
68 68
 	if (!file_exists($sub_language_file) || !is_writable($sub_language_file)) {
69 69
 		$sublanguage_folder_error = $sub_language_file.' '.get_lang('IsNotWritable');
70 70
 	}
71
-	if (SubLanguageManager::check_if_exist_language_by_id($_GET['id'])===true) {
71
+	if (SubLanguageManager::check_if_exist_language_by_id($_GET['id']) === true) {
72 72
 		$language_id_exist = true;
73 73
 	} else {
74 74
 		$language_id_exist = false;
75 75
 	}
76 76
 } else {
77
-	$language_name='';
78
-	$language_id_exist=false;
77
+	$language_name = '';
78
+	$language_id_exist = false;
79 79
 }
80 80
 
81 81
 $intro = sprintf(get_lang('RegisterTermsOfSubLanguageForX'), strtolower($sub_language_name));
82 82
 $path_folder = api_get_path(SYS_LANG_PATH).$all_data_of_language['dokeos_folder'];
83 83
 
84
-if (!is_dir($path_folder) || strlen($all_data_of_language['dokeos_folder'])==0) {
84
+if (!is_dir($path_folder) || strlen($all_data_of_language['dokeos_folder']) == 0) {
85 85
 	api_not_allowed(true);
86 86
 }
87 87
 
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
 
103 103
 
104 104
 $txt_search_word = (!empty($_REQUEST['txt_search_word']) ? Security::remove_XSS($_REQUEST['txt_search_word']) : '');
105
-$html ='<div style="float:left" class="actions">';
106
-$html.='<form style="float:left"  id="Searchlanguage" name="Searchlanguage" method="GET" action="sub_language.php">';
107
-$html.='&nbsp;'.get_lang('OriginalName').'&nbsp; :&nbsp;';
105
+$html = '<div style="float:left" class="actions">';
106
+$html .= '<form style="float:left"  id="Searchlanguage" name="Searchlanguage" method="GET" action="sub_language.php">';
107
+$html .= '&nbsp;'.get_lang('OriginalName').'&nbsp; :&nbsp;';
108 108
 
109
-$html.='<input name="id" type="hidden"  id="id" value="'.Security::remove_XSS($_REQUEST['id']).'" />';
110
-$html.='<input name="sub_language_id" type="hidden"  id="id" value="'.Security::remove_XSS($_REQUEST['sub_language_id']).'" />';
111
-$html.='<input name="txt_search_word" type="text" size="50"  id="txt_search_word" value="'.$txt_search_word.'" />';
112
-$html.="&nbsp;".'<button name="SubmitSearchLanguage" class="search" type="submit">'.get_lang('Search').'</button>';
113
-$html.='</form>';
114
-$html.='</div>';
109
+$html .= '<input name="id" type="hidden"  id="id" value="'.Security::remove_XSS($_REQUEST['id']).'" />';
110
+$html .= '<input name="sub_language_id" type="hidden"  id="id" value="'.Security::remove_XSS($_REQUEST['sub_language_id']).'" />';
111
+$html .= '<input name="txt_search_word" type="text" size="50"  id="txt_search_word" value="'.$txt_search_word.'" />';
112
+$html .= "&nbsp;".'<button name="SubmitSearchLanguage" class="search" type="submit">'.get_lang('Search').'</button>';
113
+$html .= '</form>';
114
+$html .= '</div>';
115 115
 echo $html;
116 116
 echo '<br /><br /><br />';
117 117
 if (!empty($sublanguage_folder_error)) {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	$language_files_to_load_keys = array_flip($language_files_to_load);
149 149
 	$array_to_search = $parent_language_array;
150 150
 	$list_info = array();
151
-	$term='/'.Security::remove_XSS(trim($_REQUEST['txt_search_word'])).'/i';
151
+	$term = '/'.Security::remove_XSS(trim($_REQUEST['txt_search_word'])).'/i';
152 152
 	//@todo optimize this foreach
153 153
 	foreach ($language_files_to_load as $lang_file) {
154 154
 		//searching in parent language of the sub language
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 				}
162 162
 				$founded = false;
163 163
 				// searching the item in the parent tool
164
-				if (preg_match($term,$parent_variable_value)!==0) {
164
+				if (preg_match($term, $parent_variable_value) !== 0) {
165 165
 					$founded = true;
166 166
 				}
167 167
 				if ($founded) {
@@ -177,11 +177,11 @@  discard block
 block discarded – undo
177 177
 						$size =4;
178 178
 					}*/
179 179
 
180
-					$obj_text='<textarea rows="10" cols="40" name="txt|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$parent_name_variable.'" >'.$sub_language_name_variable.'</textarea>';
181
-					$obj_button='<button class="save" type="button" name="btn|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$parent_name_variable.'"  />'.get_lang('Save').'</button>';
180
+					$obj_text = '<textarea rows="10" cols="40" name="txt|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$parent_name_variable.'" >'.$sub_language_name_variable.'</textarea>';
181
+					$obj_button = '<button class="save" type="button" name="btn|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$parent_name_variable.'"  />'.get_lang('Save').'</button>';
182 182
 
183 183
 					$list_info[] = array(
184
-						$lang_file . '.inc.php',
184
+						$lang_file.'.inc.php',
185 185
 						$parent_name_variable,
186 186
 						$english_name_variable,
187 187
 						$parent_variable_value,
@@ -205,16 +205,16 @@  discard block
 block discarded – undo
205 205
 				$founded = false;
206 206
 				if ($search_in_english && $search_in_variable) {
207 207
 					// searching the item in the parent tool
208
-					if (preg_match($term,$variable_value)!==0 || preg_match($term,$name_variable)!==0 ) {
208
+					if (preg_match($term, $variable_value) !== 0 || preg_match($term, $name_variable) !== 0) {
209 209
 						$founded = true;
210 210
 					}
211 211
 				} else {
212 212
 					if ($search_in_english) {
213
-						if (preg_match($term,$variable_value)!==0) {
213
+						if (preg_match($term, $variable_value) !== 0) {
214 214
 							$founded = true;
215 215
 						}
216 216
 					} else {
217
-						if (preg_match($term,$name_variable)!==0) {
217
+						if (preg_match($term, $name_variable) !== 0) {
218 218
 							$founded = true;
219 219
 						}
220 220
 					}
@@ -231,16 +231,16 @@  discard block
 block discarded – undo
231 231
 						$parent_variable_value = $parent_language_array[$lang_file][$name_variable];
232 232
 					}
233 233
 					//config buttons
234
-					$obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.
234
+					$obj_text = '<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.
235 235
 						$sub_language_name_variable.'
236 236
 						</textarea>';
237
-					$obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
237
+					$obj_button = '<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
238 238
 
239 239
 					//loading variable from the english array
240 240
 					$english_name_variable = $english_language_array[$lang_file][$name_variable];
241 241
 
242 242
 					$list_info[] = array(
243
-						$lang_file . '.inc.php',
243
+						$lang_file.'.inc.php',
244 244
 						$name_variable,
245 245
 						$english_name_variable,
246 246
 						$parent_variable_value,
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 
262 262
 				$founded = false;
263 263
 				// searching the item in the parent tool
264
-				if (preg_match($term,$variable_value)!==0) {
264
+				if (preg_match($term, $variable_value) !== 0) {
265 265
 					$founded = true;
266 266
 				}
267 267
 				if ($founded) {
@@ -269,15 +269,15 @@  discard block
 block discarded – undo
269 269
 					$sub_language_name_variable = $sub_language_array[$lang_file][$name_variable];
270 270
 					$parent_variable_value = $parent_language_array[$lang_file][$name_variable];
271 271
 					//config buttons
272
-					$obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.$sub_language_name_variable.'</textarea>';
273
-					$obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
272
+					$obj_text = '<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.$sub_language_name_variable.'</textarea>';
273
+					$obj_button = '<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
274 274
 
275 275
 					//loading variable from the english array
276 276
 					$english_name_variable = $english_language_array[$lang_file][$name_variable];
277
-					$list_info[]=array($lang_file.'.inc.php',
277
+					$list_info[] = array($lang_file.'.inc.php',
278 278
 						$name_variable,
279 279
 						$english_name_variable,
280
-						$parent_variable_value,$obj_text,$obj_button);
280
+						$parent_variable_value, $obj_text, $obj_button);
281 281
 				}
282 282
 			}
283 283
 		}
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 $list_info = array();
292 292
 if (isset($_REQUEST['txt_search_word'])) {
293 293
 	//@todo fix to accept a char with 1 char
294
-	if (strlen(trim($_REQUEST['txt_search_word']))>2) {
294
+	if (strlen(trim($_REQUEST['txt_search_word'])) > 2) {
295 295
 		$list_info = search_language_term(
296 296
 			$_REQUEST['txt_search_word'],
297 297
 			true,
@@ -307,14 +307,14 @@  discard block
 block discarded – undo
307 307
 	'sub_language_id' => intval($_GET['sub_language_id']),
308 308
 	'txt_search_word' => $txt_search_word
309 309
 );
310
-$table = new SortableTableFromArrayConfig($list_info, 1,20,'data_info');
310
+$table = new SortableTableFromArrayConfig($list_info, 1, 20, 'data_info');
311 311
 $table->set_additional_parameters($parameters);
312 312
 $table->set_header(0, get_lang('LanguageFile'));
313 313
 $table->set_header(1, get_lang('LanguageVariable'));
314 314
 $table->set_header(2, get_lang('EnglishName'));
315 315
 $table->set_header(3, get_lang('OriginalName'));
316
-$table->set_header(4, get_lang('SubLanguage'),false);
317
-$table->set_header(5, get_lang('Edit'),false);
316
+$table->set_header(4, get_lang('SubLanguage'), false);
317
+$table->set_header(5, get_lang('Edit'), false);
318 318
 $table->display();
319 319
 
320 320
 Display :: display_footer();
Please login to merge, or discard this patch.
main/admin/group_list.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -117,14 +117,12 @@
 block discarded – undo
117 117
         // Loops while the current group is a subgroup
118 118
         while (isset($groupRelations[$id]['group_id'])) {
119 119
             $name = $name ?
120
-                $groupRelations[$id]['name'] . " > " . $name :
121
-                $groupRelations[$id]['name'];
120
+                $groupRelations[$id]['name']." > ".$name : $groupRelations[$id]['name'];
122 121
             $id = $groupRelations[$id]['group_id'];
123 122
         }
124 123
         // The base group
125 124
         $name = $name ?
126
-            $groupRelations[$id]['name'] . " > " . $name :
127
-            $groupRelations[$id]['name'];
125
+            $groupRelations[$id]['name']." > ".$name : $groupRelations[$id]['name'];
128 126
         $group[3] = $status[$group[3]];
129 127
         $group['1'] = '<a href="'.api_get_path(WEB_CODE_PATH).'social/group_view.php?id='.$group['0'].'">'.$name.'</a>';
130 128
         $groups[] = $group;
Please login to merge, or discard this patch.
main/admin/extra_fields.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 $obj->setupBreadcrumb($interbreadcrumb, $action);
37 37
 
38 38
 //jqgrid will use this URL to do the selects
39
-$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_extra_fields&type=' . $extraFieldType;
39
+$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_extra_fields&type='.$extraFieldType;
40 40
 
41 41
 //The order is important you need to check the the $column variable in the model.ajax.php file
42 42
 $columns = $obj->getJqgridColumnNames();
@@ -64,43 +64,43 @@  discard block
 block discarded – undo
64 64
         array(),
65 65
         $action_links,
66 66
         true
67
-    ). '
67
+    ).'
68 68
 
69 69
     $("#field_type").on("change", function() {
70 70
         id = $(this).val();
71 71
         switch(id) {
72 72
             case "1":
73
-                $("#example").html("' . addslashes(Display::return_icon('userfield_text.png')) . '");
73
+                $("#example").html("' . addslashes(Display::return_icon('userfield_text.png')).'");
74 74
                 break;
75 75
             case "2":
76
-                $("#example").html("' . addslashes(Display::return_icon('userfield_text_area.png')) . '");
76
+                $("#example").html("' . addslashes(Display::return_icon('userfield_text_area.png')).'");
77 77
                 break;
78 78
             case "3":
79
-                $("#example").html("' . addslashes(Display::return_icon('add_user_field_howto.png')) . '");
79
+                $("#example").html("' . addslashes(Display::return_icon('add_user_field_howto.png')).'");
80 80
                 break;
81 81
             case "4":
82
-                $("#example").html("' . addslashes(Display::return_icon('userfield_drop_down.png')) . '");
82
+                $("#example").html("' . addslashes(Display::return_icon('userfield_drop_down.png')).'");
83 83
                 break;
84 84
             case "5":
85
-                $("#example").html("' . addslashes(Display::return_icon('userfield_multidropdown.png')) . '");
85
+                $("#example").html("' . addslashes(Display::return_icon('userfield_multidropdown.png')).'");
86 86
                 break;
87 87
             case "6":
88
-                $("#example").html("' . addslashes(Display::return_icon('userfield_data.png')) . '");
88
+                $("#example").html("' . addslashes(Display::return_icon('userfield_data.png')).'");
89 89
                 break;
90 90
             case "7":
91
-                $("#example").html("' . addslashes(Display::return_icon('userfield_date_time.png')) . '");
91
+                $("#example").html("' . addslashes(Display::return_icon('userfield_date_time.png')).'");
92 92
                 break;
93 93
             case "8":
94
-                $("#example").html("' . addslashes(Display::return_icon('userfield_doubleselect.png')) . '");
94
+                $("#example").html("' . addslashes(Display::return_icon('userfield_doubleselect.png')).'");
95 95
                 break;
96 96
             case "9":
97
-                $("#example").html("' . addslashes(Display::return_icon('userfield_divider.png')) . '");
97
+                $("#example").html("' . addslashes(Display::return_icon('userfield_divider.png')).'");
98 98
                 break;
99 99
             case "10":
100
-                $("#example").html("' . addslashes(Display::return_icon('userfield_user_tag.png')) . '");
100
+                $("#example").html("' . addslashes(Display::return_icon('userfield_user_tag.png')).'");
101 101
                 break;
102 102
             case "11":
103
-                $("#example").html("' . addslashes(Display::return_icon('userfield_data.png')) . '");
103
+                $("#example").html("' . addslashes(Display::return_icon('userfield_data.png')).'");
104 104
                 break;
105 105
         }
106 106
     });
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         ) {
120 120
             api_not_allowed();
121 121
         }
122
-        $url = api_get_self() . '?type=' . $obj->type . '&action=' . Security::remove_XSS($_GET['action']);
122
+        $url = api_get_self().'?type='.$obj->type.'&action='.Security::remove_XSS($_GET['action']);
123 123
         $form = $obj->return_form($url, 'add');
124 124
 
125 125
         // The validation or display
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
             $obj->display();
136 136
         } else {
137 137
             echo '<div class="actions">';
138
-            echo '<a href="' . api_get_self() . '?type=' . $obj->type . '">' .
139
-            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . '</a>';
138
+            echo '<a href="'.api_get_self().'?type='.$obj->type.'">'.
139
+            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
140 140
             echo '</div>';
141 141
             $form->addElement('hidden', 'sec_token');
142 142
             $form->setConstants(array('sec_token' => $token));
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         break;
146 146
     case 'edit':
147 147
         // Action handling: Editing
148
-        $url = api_get_self() . '?type=' . $obj->type . '&action=' . Security::remove_XSS($_GET['action']) . '&id=' . intval($_GET['id']);
148
+        $url = api_get_self().'?type='.$obj->type.'&action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']);
149 149
         $form = $obj->return_form($url, 'edit');
150 150
 
151 151
         // The validation or display
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
             $obj->display();
160 160
         } else {
161 161
             echo '<div class="actions">';
162
-            echo '<a href="' . api_get_self() . '?type=' . $obj->type . '">' .
163
-            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . '</a>';
162
+            echo '<a href="'.api_get_self().'?type='.$obj->type.'">'.
163
+            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
164 164
             echo '</div>';
165 165
             $form->addElement('hidden', 'sec_token');
166 166
             $form->setConstants(array('sec_token' => $token));
Please login to merge, or discard this patch.
main/admin/user_add.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     });
43 43
     </script>';
44 44
 }
45
-$htmlHeadXtra[] = '<link  href="'. api_get_path(WEB_PATH) .'web/assets/cropper/dist/cropper.min.css" rel="stylesheet">';
46
-$htmlHeadXtra[] = '<script src="'. api_get_path(WEB_PATH) .'web/assets/cropper/dist/cropper.min.js"></script>';
45
+$htmlHeadXtra[] = '<link  href="'.api_get_path(WEB_PATH).'web/assets/cropper/dist/cropper.min.css" rel="stylesheet">';
46
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_PATH).'web/assets/cropper/dist/cropper.min.js"></script>';
47 47
 $htmlHeadXtra[] = '<script>
48 48
 $(document).ready(function() {
49 49
     var $image = $("#previewImage");
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 }
184 184
 
185 185
 if (api_get_setting('login_is_email') == 'true') {
186
-    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
186
+    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
187 187
     $form->addRule('email', get_lang('UserTaken'), 'username_available');
188 188
 }
189 189
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 $form->addElement('text', 'phone', get_lang('PhoneNumber'));
192 192
 // Picture
193 193
 $form->addElement('file', 'picture', get_lang('AddImage'), array('id' => 'picture', 'class' => 'picture-form'));
194
-$allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif');
194
+$allowed_picture_types = array('jpg', 'jpeg', 'png', 'gif');
195 195
 
196 196
 $form->addHtml(''
197 197
             . '<div class="form-group">'
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 if (api_get_setting('login_is_email') != 'true') {
215 215
     $form->addElement('text', 'username', get_lang('LoginName'), array('id'=> 'username', 'maxlength' => USERNAME_MAX_LENGTH, 'autocomplete' => 'off'));
216 216
     $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
217
-    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
217
+    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
218 218
     $form->addRule('username', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
219 219
     $form->addRule('username', get_lang('UserTaken'), 'username_available');
220 220
 }
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 );
302 302
 
303 303
 //drh list (display only if student)
304
-$display = isset($_POST['status']) && $_POST['status'] == STUDENT  || !isset($_POST['status']) ? 'block' : 'none';
304
+$display = isset($_POST['status']) && $_POST['status'] == STUDENT || !isset($_POST['status']) ? 'block' : 'none';
305 305
 
306 306
 //@todo remove the drh list here. This code is unused
307 307
 $form->addElement('html', '<div id="drh_list" style="display:'.$display.';">');
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 $form->addGroup($group, 'mail', get_lang('SendMailToNewUser'), '&nbsp;');
336 336
 // Expiration Date
337 337
 $form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
338
-$group = array ();
338
+$group = array();
339 339
 $group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1);
340 340
 $group[] = $form->createElement(
341 341
     'DateTimePicker',
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 $jquery_ready_content = $returnParams['jquery_ready_content'];
357 357
 
358 358
 // the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
359
-$htmlHeadXtra[] ='<script>
359
+$htmlHeadXtra[] = '<script>
360 360
 $(document).ready(function(){
361 361
 	'.$jquery_ready_content.'
362 362
 });
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 			//If any error ocurred during user creation, print it (api_failureList
459 459
 			// stores values as separate words, so rework it
460 460
 			$message = '';
461
-			$message_bits = explode(' ',api_get_last_failure());
461
+			$message_bits = explode(' ', api_get_last_failure());
462 462
 			foreach ($message_bits as $bit) {
463 463
 				$message .= ucfirst($bit);
464 464
 			}
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 	$form->setConstants(array('sec_token' => $token));
517 517
 }
518 518
 
519
-if (!empty($message)){
519
+if (!empty($message)) {
520 520
 	$message = Display::return_message(stripslashes($message));
521 521
 }
522 522
 $content = $form->returnForm();
Please login to merge, or discard this patch.