Completed
Push — 1.10.x ( f2aaaf...ef00db )
by Yannick
241:15 queued 197:35
created
main/admin/dashboard_add_users_to_user.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 $add_type = 'multiple';
56 56
 if (isset($_GET['add_type']) && $_GET['add_type']!='') {
57
-	$add_type = Security::remove_XSS($_REQUEST['add_type']);
57
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
58 58
 }
59 59
 
60 60
 if (!api_is_platform_admin()) {
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
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);
@@ -160,7 +160,7 @@  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 166
             while($user = Database :: fetch_array($rs)) {
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
             $return .= '</select>';
171 171
             $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
172 172
         }
173
-	}
174
-	return $xajax_response;
173
+    }
174
+    return $xajax_response;
175 175
 }
176 176
 
177 177
 $xajax->processRequests();
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
 $msg = '';
286 286
 if (isset($_POST['formSent']) && intval($_POST['formSent']) == 1) {
287
-	$user_list = $_POST['UsersList'];
287
+    $user_list = $_POST['UsersList'];
288 288
 
289 289
     switch ($userStatus) {
290 290
         case DRH:
@@ -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
-	$needle = Database::escape_string($firstLetterUser);
358
-	$search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
357
+    $needle = Database::escape_string($firstLetterUser);
358
+    $search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
359 359
 }
360 360
 
361 361
 $sqlConditions = null;
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 }
376 376
 
377 377
 if (api_is_multiple_url_enabled()) {
378
-	$sql = "SELECT user.user_id, username, lastname, firstname
378
+    $sql = "SELECT user.user_id, username, lastname, firstname
379 379
 	        FROM $tbl_user user  LEFT JOIN $tbl_access_url_rel_user au ON (au.user_id = user.user_id)
380 380
 			WHERE
381 381
                 $without_assigned_users
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
                 $sqlConditions
386 386
             ORDER BY firstname";
387 387
 } else {
388
-	$sql = "SELECT user_id, username, lastname, firstname
388
+    $sql = "SELECT user_id, username, lastname, firstname
389 389
 	        FROM $tbl_user user
390 390
 			WHERE
391 391
 			    $without_assigned_users
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 <input type="hidden" name="formSent" value="1" />
402 402
 <?php
403 403
 if(!empty($msg)) {
404
-	Display::display_normal_message($msg); //main API
404
+    Display::display_normal_message($msg); //main API
405 405
 }
406 406
 ?>
407 407
 
@@ -454,26 +454,26 @@  discard block
 block discarded – undo
454 454
             </div>
455 455
             
456 456
           <?php
457
-          }
458
-          ?>
457
+            }
458
+            ?>
459 459
             <div class="separate-action">
460 460
                 <?php
461
-		echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.$tool_name.'</button>';
461
+        echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.$tool_name.'</button>';
462 462
             ?>
463 463
             </div>
464 464
         </div>
465 465
     </div>
466 466
     <div class="col-md-4">
467 467
         <?php
468
-	if (UserManager::is_admin($user_id)) {
469
-		echo get_lang('AssignedUsersListToPlatformAdministrator');
468
+    if (UserManager::is_admin($user_id)) {
469
+        echo get_lang('AssignedUsersListToPlatformAdministrator');
470 470
             } else if ($user_info['status'] == SESSIONADMIN) {
471 471
                     echo get_lang('AssignedUsersListToSessionsAdministrator');
472 472
             } else if ($user_info['status'] == STUDENT_BOSS) {
473 473
                     echo get_lang('AssignedUsersListToStudentBoss');
474 474
             } else {
475 475
                     echo get_lang('AssignedUsersListToHumanResourcesManager');
476
-	}
476
+    }
477 477
         ?>
478 478
         <div class="form-group">
479 479
             <div class="col-sm-12">
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 // setting breadcrumbs
26 26
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
27
-$interbreadcrumb[] = array('url' => 'user_list.php','name' => get_lang('UserList'));
27
+$interbreadcrumb[] = array('url' => 'user_list.php', 'name' => get_lang('UserList'));
28 28
 
29 29
 // Database Table Definitions
30 30
 $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
@@ -44,17 +44,17 @@  discard block
 block discarded – undo
44 44
 $isAdmin = UserManager::is_admin($user_id);
45 45
 if ($isAdmin) {
46 46
     $userStatus = PLATFORM_ADMIN;
47
-    $tool_name= get_lang('AssignUsersToPlatformAdministrator');
47
+    $tool_name = get_lang('AssignUsersToPlatformAdministrator');
48 48
 } else if ($user_info['status'] == SESSIONADMIN) {
49
-    $tool_name= get_lang('AssignUsersToSessionsAdministrator');
50
-} else if  ($user_info['status'] == STUDENT_BOSS) {
51
-    $tool_name= get_lang('AssignUsersToBoss');
49
+    $tool_name = get_lang('AssignUsersToSessionsAdministrator');
50
+} else if ($user_info['status'] == STUDENT_BOSS) {
51
+    $tool_name = get_lang('AssignUsersToBoss');
52 52
 } else {
53
-    $tool_name= get_lang('AssignUsersToHumanResourcesManager');
53
+    $tool_name = get_lang('AssignUsersToHumanResourcesManager');
54 54
 }
55 55
 
56 56
 $add_type = 'multiple';
57
-if (isset($_GET['add_type']) && $_GET['add_type']!='') {
57
+if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
58 58
 	$add_type = Security::remove_XSS($_REQUEST['add_type']);
59 59
 }
60 60
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 function search_users($needle, $type)
66 66
 {
67
-    global $tbl_access_url_rel_user,  $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus;
67
+    global $tbl_access_url_rel_user, $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus;
68 68
 
69 69
     $xajax_response = new xajaxResponse();
70 70
     $return = '';
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                     LEFT JOIN $tbl_access_url_rel_user au ON (au.user_id = user.user_id)
103 103
                     WHERE
104 104
                         ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND
105
-                        status NOT IN(".DRH.", ".SESSIONADMIN.", " . STUDENT_BOSS . ") AND
105
+                        status NOT IN(".DRH.", ".SESSIONADMIN.", ".STUDENT_BOSS.") AND
106 106
                         user.user_id NOT IN ($user_anonymous, $current_user_id, $user_id)
107 107
                         $without_assigned_users AND
108 108
                         access_url_id = ".api_get_current_access_url_id()."
@@ -114,15 +114,15 @@  discard block
 block discarded – undo
114 114
                     FROM $tbl_user user
115 115
                     WHERE
116 116
                         ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND
117
-                        status NOT IN(".DRH.", ".SESSIONADMIN.", " . STUDENT_BOSS . ") AND
117
+                        status NOT IN(".DRH.", ".SESSIONADMIN.", ".STUDENT_BOSS.") AND
118 118
                         user_id NOT IN ($user_anonymous, $current_user_id, $user_id)
119 119
                     $without_assigned_users
120 120
                     $order_clause
121 121
             ";
122 122
         }
123 123
 
124
-		$rs	= Database::query($sql);
125
-		$xajax_response->addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return));
124
+		$rs = Database::query($sql);
125
+		$xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
126 126
 
127 127
         if ($type == 'single') {
128 128
             $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
@@ -141,10 +141,10 @@  discard block
 block discarded – undo
141 141
 
142 142
             switch ($userStatus) {
143 143
                 case DRH:
144
-                    $sql .= " user.status <> 6 AND user.status <> " . DRH;
144
+                    $sql .= " user.status <> 6 AND user.status <> ".DRH;
145 145
                     break;
146 146
                 case STUDENT_BOSS:
147
-                    $sql .= " user.status <> 6 AND user.status <> " . STUDENT_BOSS;
147
+                    $sql .= " user.status <> 6 AND user.status <> ".STUDENT_BOSS;
148 148
                     break;
149 149
             }
150 150
 
@@ -161,12 +161,12 @@  discard block
 block discarded – undo
161 161
                     $return .= '...<br />';
162 162
                 }
163 163
             }
164
-           $xajax_response->addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
164
+           $xajax_response->addAssign('ajax_list_users_single', 'innerHTML', api_utf8_encode($return));
165 165
         } else {
166 166
             $return .= '<select id="origin" class="form-control" name="NoAssignedUsersList[]" multiple="multiple" size="15" ">';
167
-            while($user = Database :: fetch_array($rs)) {
167
+            while ($user = Database :: fetch_array($rs)) {
168 168
                 $person_name = api_get_person_name($user['firstname'], $user['lastname']);
169
-                $return .= '<option value="'.$user['user_id'].'" title="'.htmlspecialchars($person_name,ENT_QUOTES).'">'.$person_name.' ('.$user['username'].')</option>';
169
+                $return .= '<option value="'.$user['user_id'].'" title="'.htmlspecialchars($person_name, ENT_QUOTES).'">'.$person_name.' ('.$user['username'].')</option>';
170 170
             }
171 171
             $return .= '</select>';
172 172
             $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 }
244 244
 </script>';
245 245
 
246
-$formSent=0;
246
+$formSent = 0;
247 247
 $errorMsg = '';
248 248
 $UserList = array();
249 249
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 $searchForm = new FormValidator('search', 'get', api_get_self().'?user='.$user_id);
260 260
 $searchForm->addHeader(get_lang('AdvancedSearch'));
261
-$renderer =& $searchForm->defaultRenderer();
261
+$renderer = & $searchForm->defaultRenderer();
262 262
 
263 263
 $searchForm->addElement('hidden', 'user', $user_id);
264 264
 foreach ($filters as $param) {
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
             $affected_rows = 0;
301 301
     }
302 302
 
303
-    if ($affected_rows)	{
303
+    if ($affected_rows) {
304 304
         $msg = get_lang('AssignedUsersHaveBeenUpdatedSuccessfully');
305 305
     }
306 306
 }
@@ -312,18 +312,18 @@  discard block
 block discarded – undo
312 312
 $actionsLeft = '';
313 313
 if ($userStatus != STUDENT_BOSS) {
314 314
     $actionsLeft = Display::url(
315
-        Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM ),
315
+        Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM),
316 316
         "dashboard_add_courses_to_user.php?user=$user_id"
317 317
     );
318 318
 
319 319
     $actionsLeft .= Display::url(
320
-        Display::return_icon('session-add.png', get_lang('AssignSessions'), null, ICON_SIZE_MEDIUM ) ,
320
+        Display::return_icon('session-add.png', get_lang('AssignSessions'), null, ICON_SIZE_MEDIUM),
321 321
         "dashboard_add_sessions_to_user.php?user=$user_id"
322 322
     );
323 323
 }
324 324
 
325 325
 $actionsRight = Display::url(
326
-    '<em class="fa fa-search"></em> ' . get_lang('AdvancedSearch'),
326
+    '<em class="fa fa-search"></em> '.get_lang('AdvancedSearch'),
327 327
     '#',
328 328
     array('class' => 'btn btn-default advanced_options', 'id' => 'advanced_search')
329 329
 );
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
 $assigned_users_id = array_keys($assigned_users_to_hrm);
361 361
 $without_assigned_users = '';
362 362
 if (count($assigned_users_id) > 0) {
363
-	$without_assigned_users = " user.user_id NOT IN(".implode(',',$assigned_users_id).") AND ";
363
+	$without_assigned_users = " user.user_id NOT IN(".implode(',', $assigned_users_id).") AND ";
364 364
 }
365 365
 
366 366
 $search_user = '';
367 367
 if (!empty($firstLetterUser)) {
368 368
 	$needle = Database::escape_string($firstLetterUser);
369
-	$search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
369
+	$search_user = "AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
370 370
 }
371 371
 
372 372
 $sqlConditions = null;
@@ -406,12 +406,12 @@  discard block
 block discarded – undo
406 406
 			    $sqlConditions
407 407
             ORDER BY firstname ";
408 408
 }
409
-$result	= Database::query($sql);
409
+$result = Database::query($sql);
410 410
 ?>
411
-<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();"';}?>>
411
+<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();"'; }?>>
412 412
 <input type="hidden" name="formSent" value="1" />
413 413
 <?php
414
-if(!empty($msg)) {
414
+if (!empty($msg)) {
415 415
 	Display::display_normal_message($msg); //main API
416 416
 }
417 417
 ?>
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                     <select id="origin" class="form-control" name="NoAssignedUsersList[]" multiple="multiple" size="15">
427 427
                         <?php   while ($enreg = Database::fetch_array($result)) {
428 428
                                 $person_name = api_get_person_name($enreg['firstname'], $enreg['lastname']); ?>
429
-                                  <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name,ENT_QUOTES).'"';?>>
429
+                                  <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name, ENT_QUOTES).'"'; ?>>
430 430
                             <?php echo $person_name.' ('.$enreg['username'].')'; ?>
431 431
                         </option>
432 432
                         <?php } ?>
@@ -439,8 +439,8 @@  discard block
 block discarded – undo
439 439
     </div>
440 440
     <div class="col-md-4">
441 441
         <div class="code-course">
442
-            <?php if($add_type == 'multiple') { ?>
443
-                <p><?php echo get_lang('FirstLetterUser');?></p>
442
+            <?php if ($add_type == 'multiple') { ?>
443
+                <p><?php echo get_lang('FirstLetterUser'); ?></p>
444 444
                 <select class="selectpicker show-tick form-control" name="firstLetterUser" onchange = "xajax_search_users(this.value,'multiple')">
445 445
                     <option value="%">--</option>
446 446
                     <?php echo Display::get_alphabet_options($firstLetterUser); ?>
@@ -492,10 +492,10 @@  discard block
 block discarded – undo
492 492
                 <select id='destination' class="form-control" name="UsersList[]" multiple="multiple" size="15" >
493 493
                     <?php
494 494
                     if (is_array($assigned_users_to_hrm)) {
495
-                            foreach($assigned_users_to_hrm as $enreg) {
495
+                            foreach ($assigned_users_to_hrm as $enreg) {
496 496
                                     $person_name = api_get_person_name($enreg['firstname'], $enreg['lastname']);
497 497
                     ?>
498
-                            <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name,ENT_QUOTES).'"'; ?>>
498
+                            <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name, ENT_QUOTES).'"'; ?>>
499 499
                         <?php echo $person_name.' ('.$enreg['username'].')'; ?>
500 500
                     </option>
501 501
                     <?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 3 patches
Indentation   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -59,30 +59,30 @@  discard block
 block discarded – undo
59 59
 $sublanguage_folder_error = false;
60 60
 
61 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
-	$all_data_of_language       = SubLanguageManager::get_all_information_of_language($_GET['id']);
65
-	$all_data_of_sublanguage    = SubLanguageManager::get_all_information_of_language($_GET['sub_language_id']);
66
-	$sub_language_file          = api_get_path(SYS_LANG_PATH).$all_data_of_sublanguage['dokeos_folder'];
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
+    $all_data_of_language       = SubLanguageManager::get_all_information_of_language($_GET['id']);
65
+    $all_data_of_sublanguage    = SubLanguageManager::get_all_information_of_language($_GET['sub_language_id']);
66
+    $sub_language_file          = api_get_path(SYS_LANG_PATH).$all_data_of_sublanguage['dokeos_folder'];
67 67
 
68
-	if (!file_exists($sub_language_file) || !is_writable($sub_language_file)) {
69
-		$sublanguage_folder_error = $sub_language_file.' '.get_lang('IsNotWritable');
70
-	}
71
-	if (SubLanguageManager::check_if_exist_language_by_id($_GET['id'])===true) {
72
-		$language_id_exist = true;
73
-	} else {
74
-		$language_id_exist = false;
75
-	}
68
+    if (!file_exists($sub_language_file) || !is_writable($sub_language_file)) {
69
+        $sublanguage_folder_error = $sub_language_file.' '.get_lang('IsNotWritable');
70
+    }
71
+    if (SubLanguageManager::check_if_exist_language_by_id($_GET['id'])===true) {
72
+        $language_id_exist = true;
73
+    } else {
74
+        $language_id_exist = false;
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 84
 if (!is_dir($path_folder) || strlen($all_data_of_language['dokeos_folder'])==0) {
85
-	api_not_allowed(true);
85
+    api_not_allowed(true);
86 86
 }
87 87
 
88 88
 Display :: display_header($language_name);
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
 echo '</div>';
95 95
 
96 96
 if (!empty($_SESSION['msg'])) {
97
-	echo $_SESSION['msg'];
98
-	unset($_SESSION['msg']);
97
+    echo $_SESSION['msg'];
98
+    unset($_SESSION['msg']);
99 99
 } else {
100
-	echo '<br />';
100
+    echo '<br />';
101 101
 }
102 102
 
103 103
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 echo $html;
116 116
 echo '<br /><br /><br />';
117 117
 if (!empty($sublanguage_folder_error)) {
118
-	Display::display_warning_message($sublanguage_folder_error);
118
+    Display::display_warning_message($sublanguage_folder_error);
119 119
 }
120 120
 echo '<div id="div_message_information_id">&nbsp;</div>';
121 121
 
@@ -130,182 +130,182 @@  discard block
 block discarded – undo
130 130
  *
131 131
  */
132 132
 function search_language_term(
133
-	$term,
134
-	$search_in_variable = true,
135
-	$search_in_english = true,
136
-	$search_in_parent = true,
137
-	$search_in_sub_language = true
133
+    $term,
134
+    $search_in_variable = true,
135
+    $search_in_english = true,
136
+    $search_in_parent = true,
137
+    $search_in_sub_language = true
138 138
 ) {
139
-	//These the $_REQUEST['id'] and the $_REQUEST['sub_language_id'] variables are process in global.inc.php (LOAD LANGUAGE FILES SECTION)
140
-	/*
139
+    //These the $_REQUEST['id'] and the $_REQUEST['sub_language_id'] variables are process in global.inc.php (LOAD LANGUAGE FILES SECTION)
140
+    /*
141 141
 		These 4 arrays are set in global.inc.php with the condition that will be load from sub_language.php or sub_language_ajax.inc.php
142 142
 		$english_language_array
143 143
 		$parent_language_array
144 144
 		$sub_language_array
145 145
 		$language_files_to_load
146 146
 	*/
147
-	global $language_files_to_load, $sub_language_array, $english_language_array, $parent_language_array;
148
-	$language_files_to_load_keys = array_flip($language_files_to_load);
149
-	$array_to_search = $parent_language_array;
150
-	$list_info = array();
151
-	$term='/'.Security::remove_XSS(trim($_REQUEST['txt_search_word'])).'/i';
152
-	//@todo optimize this foreach
153
-	foreach ($language_files_to_load as $lang_file) {
154
-		//searching in parent language of the sub language
155
-		if ($search_in_parent) {
156
-			$variables = $parent_language_array[$lang_file];
157
-			foreach ($variables as $parent_name_variable =>$parent_variable_value) {
158
-				//arrays are avoided
159
-				if (is_array($parent_variable_value)) {
160
-					continue;
161
-				}
162
-				$founded = false;
163
-				// searching the item in the parent tool
164
-				if (preg_match($term,$parent_variable_value)!==0) {
165
-					$founded = true;
166
-				}
167
-				if ($founded) {
168
-					//loading variable from the english array
169
-					$sub_language_name_variable = $sub_language_array[$lang_file][$parent_name_variable];
170
-					//loading variable from the english array
171
-					$english_name_variable = $english_language_array[$lang_file][$parent_name_variable];
147
+    global $language_files_to_load, $sub_language_array, $english_language_array, $parent_language_array;
148
+    $language_files_to_load_keys = array_flip($language_files_to_load);
149
+    $array_to_search = $parent_language_array;
150
+    $list_info = array();
151
+    $term='/'.Security::remove_XSS(trim($_REQUEST['txt_search_word'])).'/i';
152
+    //@todo optimize this foreach
153
+    foreach ($language_files_to_load as $lang_file) {
154
+        //searching in parent language of the sub language
155
+        if ($search_in_parent) {
156
+            $variables = $parent_language_array[$lang_file];
157
+            foreach ($variables as $parent_name_variable =>$parent_variable_value) {
158
+                //arrays are avoided
159
+                if (is_array($parent_variable_value)) {
160
+                    continue;
161
+                }
162
+                $founded = false;
163
+                // searching the item in the parent tool
164
+                if (preg_match($term,$parent_variable_value)!==0) {
165
+                    $founded = true;
166
+                }
167
+                if ($founded) {
168
+                    //loading variable from the english array
169
+                    $sub_language_name_variable = $sub_language_array[$lang_file][$parent_name_variable];
170
+                    //loading variable from the english array
171
+                    $english_name_variable = $english_language_array[$lang_file][$parent_name_variable];
172 172
 
173
-					//config buttons
174
-					/*if (strlen($english_name_variable)>1500) {
173
+                    //config buttons
174
+                    /*if (strlen($english_name_variable)>1500) {
175 175
 						$size =20;
176 176
 					} else {
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
-					$list_info[] = array(
184
-						$lang_file . '.inc.php',
185
-						$parent_name_variable,
186
-						$english_name_variable,
187
-						$parent_variable_value,
188
-						$obj_text,
189
-						$obj_button
190
-					);
191
-				}
192
-			}
193
-		}
183
+                    $list_info[] = array(
184
+                        $lang_file . '.inc.php',
185
+                        $parent_name_variable,
186
+                        $english_name_variable,
187
+                        $parent_variable_value,
188
+                        $obj_text,
189
+                        $obj_button
190
+                    );
191
+                }
192
+            }
193
+        }
194 194
 
195
-		//search in english
196
-		if ($search_in_english || $search_in_variable) {
197
-			$variables = $english_language_array[$lang_file];
198
-			foreach ($variables as $name_variable =>$variable_value) {
199
-				if (is_array($variable_value)) {
200
-					continue;
201
-				}
195
+        //search in english
196
+        if ($search_in_english || $search_in_variable) {
197
+            $variables = $english_language_array[$lang_file];
198
+            foreach ($variables as $name_variable =>$variable_value) {
199
+                if (is_array($variable_value)) {
200
+                    continue;
201
+                }
202 202
 
203
-				if (is_array($variable_value))
204
-					echo $lang_file;
205
-				$founded = false;
206
-				if ($search_in_english && $search_in_variable) {
207
-					// searching the item in the parent tool
208
-					if (preg_match($term,$variable_value)!==0 || preg_match($term,$name_variable)!==0 ) {
209
-						$founded = true;
210
-					}
211
-				} else {
212
-					if ($search_in_english) {
213
-						if (preg_match($term,$variable_value)!==0) {
214
-							$founded = true;
215
-						}
216
-					} else {
217
-						if (preg_match($term,$name_variable)!==0) {
218
-							$founded = true;
219
-						}
220
-					}
221
-				}
203
+                if (is_array($variable_value))
204
+                    echo $lang_file;
205
+                $founded = false;
206
+                if ($search_in_english && $search_in_variable) {
207
+                    // searching the item in the parent tool
208
+                    if (preg_match($term,$variable_value)!==0 || preg_match($term,$name_variable)!==0 ) {
209
+                        $founded = true;
210
+                    }
211
+                } else {
212
+                    if ($search_in_english) {
213
+                        if (preg_match($term,$variable_value)!==0) {
214
+                            $founded = true;
215
+                        }
216
+                    } else {
217
+                        if (preg_match($term,$name_variable)!==0) {
218
+                            $founded = true;
219
+                        }
220
+                    }
221
+                }
222 222
 
223
-				if ($founded) {
224
-					//loading variable from the english array
225
-					$sub_language_name_variable = null;
226
-					if (isset($sub_language_array[$lang_file][$name_variable])) {
227
-						$sub_language_name_variable = $sub_language_array[$lang_file][$name_variable];
228
-					}
229
-					$parent_variable_value = null;
230
-					if (isset($parent_language_array[$lang_file][$name_variable])) {
231
-						$parent_variable_value = $parent_language_array[$lang_file][$name_variable];
232
-					}
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.'" >'.
235
-						$sub_language_name_variable.'
223
+                if ($founded) {
224
+                    //loading variable from the english array
225
+                    $sub_language_name_variable = null;
226
+                    if (isset($sub_language_array[$lang_file][$name_variable])) {
227
+                        $sub_language_name_variable = $sub_language_array[$lang_file][$name_variable];
228
+                    }
229
+                    $parent_variable_value = null;
230
+                    if (isset($parent_language_array[$lang_file][$name_variable])) {
231
+                        $parent_variable_value = $parent_language_array[$lang_file][$name_variable];
232
+                    }
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.'" >'.
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
-					//loading variable from the english array
240
-					$english_name_variable = $english_language_array[$lang_file][$name_variable];
239
+                    //loading variable from the english array
240
+                    $english_name_variable = $english_language_array[$lang_file][$name_variable];
241 241
 
242
-					$list_info[] = array(
243
-						$lang_file . '.inc.php',
244
-						$name_variable,
245
-						$english_name_variable,
246
-						$parent_variable_value,
247
-						$obj_text,
248
-						$obj_button
249
-					);
250
-				}
251
-			}
252
-		}
242
+                    $list_info[] = array(
243
+                        $lang_file . '.inc.php',
244
+                        $name_variable,
245
+                        $english_name_variable,
246
+                        $parent_variable_value,
247
+                        $obj_text,
248
+                        $obj_button
249
+                    );
250
+                }
251
+            }
252
+        }
253 253
 
254
-		// Search in sub language
255
-		if ($search_in_sub_language) {
256
-			$variables = $sub_language_array[$lang_file];
257
-			foreach ($variables as $name_variable =>$variable_value) {
258
-				if (is_array($parent_variable_value)) {
259
-					continue;
260
-				}
254
+        // Search in sub language
255
+        if ($search_in_sub_language) {
256
+            $variables = $sub_language_array[$lang_file];
257
+            foreach ($variables as $name_variable =>$variable_value) {
258
+                if (is_array($parent_variable_value)) {
259
+                    continue;
260
+                }
261 261
 
262
-				$founded = false;
263
-				// searching the item in the parent tool
264
-				if (preg_match($term,$variable_value)!==0) {
265
-					$founded = true;
266
-				}
267
-				if ($founded) {
268
-					//loading variable from the english array
269
-					$sub_language_name_variable = $sub_language_array[$lang_file][$name_variable];
270
-					$parent_variable_value = $parent_language_array[$lang_file][$name_variable];
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>';
262
+                $founded = false;
263
+                // searching the item in the parent tool
264
+                if (preg_match($term,$variable_value)!==0) {
265
+                    $founded = true;
266
+                }
267
+                if ($founded) {
268
+                    //loading variable from the english array
269
+                    $sub_language_name_variable = $sub_language_array[$lang_file][$name_variable];
270
+                    $parent_variable_value = $parent_language_array[$lang_file][$name_variable];
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>';
274 274
 
275
-					//loading variable from the english array
276
-					$english_name_variable = $english_language_array[$lang_file][$name_variable];
277
-					$list_info[]=array($lang_file.'.inc.php',
278
-						$name_variable,
279
-						$english_name_variable,
280
-						$parent_variable_value,$obj_text,$obj_button);
281
-				}
282
-			}
283
-		}
284
-	}
275
+                    //loading variable from the english array
276
+                    $english_name_variable = $english_language_array[$lang_file][$name_variable];
277
+                    $list_info[]=array($lang_file.'.inc.php',
278
+                        $name_variable,
279
+                        $english_name_variable,
280
+                        $parent_variable_value,$obj_text,$obj_button);
281
+                }
282
+            }
283
+        }
284
+    }
285 285
 
286
-	$list_info = array_unique_dimensional($list_info);
287
-	return $list_info;
286
+    $list_info = array_unique_dimensional($list_info);
287
+    return $list_info;
288 288
 }
289 289
 
290 290
 // Allow see data in sort table
291 291
 $list_info = array();
292 292
 if (isset($_REQUEST['txt_search_word'])) {
293
-	//@todo fix to accept a char with 1 char
294
-	if (strlen(trim($_REQUEST['txt_search_word']))>2) {
295
-		$list_info = search_language_term(
296
-			$_REQUEST['txt_search_word'],
297
-			true,
298
-			true,
299
-			true,
300
-			true
301
-		);
302
-	}
293
+    //@todo fix to accept a char with 1 char
294
+    if (strlen(trim($_REQUEST['txt_search_word']))>2) {
295
+        $list_info = search_language_term(
296
+            $_REQUEST['txt_search_word'],
297
+            true,
298
+            true,
299
+            true,
300
+            true
301
+        );
302
+    }
303 303
 }
304 304
 
305 305
 $parameters = array(
306
-	'id' => intval($_GET['id']),
307
-	'sub_language_id' => intval($_GET['sub_language_id']),
308
-	'txt_search_word' => $txt_search_word
306
+    'id' => intval($_GET['id']),
307
+    'sub_language_id' => intval($_GET['sub_language_id']),
308
+    'txt_search_word' => $txt_search_word
309 309
 );
310 310
 $table = new SortableTableFromArrayConfig($list_info, 1,20,'data_info');
311 311
 $table->set_additional_parameters($parameters);
Please login to merge, or discard this 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.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -200,8 +200,9 @@
 block discarded – undo
200 200
 					continue;
201 201
 				}
202 202
 
203
-				if (is_array($variable_value))
204
-					echo $lang_file;
203
+				if (is_array($variable_value)) {
204
+									echo $lang_file;
205
+				}
205 206
 				$founded = false;
206 207
 				if ($search_in_english && $search_in_variable) {
207 208
 					// searching the item in the parent tool
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 2 patches
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -149,27 +149,27 @@  discard block
 block discarded – undo
149 149
 $form = new FormValidator('user_add');
150 150
 $form->addElement('header', '', $tool_name);
151 151
 if (api_is_western_name_order()) {
152
-	// Firstname
153
-	$form->addElement('text', 'firstname', get_lang('FirstName'));
154
-	$form->applyFilter('firstname', 'html_filter');
155
-	$form->applyFilter('firstname', 'trim');
156
-	$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
157
-	// Lastname
158
-	$form->addElement('text', 'lastname', get_lang('LastName'));
159
-	$form->applyFilter('lastname', 'html_filter');
160
-	$form->applyFilter('lastname', 'trim');
161
-	$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
152
+    // Firstname
153
+    $form->addElement('text', 'firstname', get_lang('FirstName'));
154
+    $form->applyFilter('firstname', 'html_filter');
155
+    $form->applyFilter('firstname', 'trim');
156
+    $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
157
+    // Lastname
158
+    $form->addElement('text', 'lastname', get_lang('LastName'));
159
+    $form->applyFilter('lastname', 'html_filter');
160
+    $form->applyFilter('lastname', 'trim');
161
+    $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
162 162
 } else {
163
-	// Lastname
164
-	$form->addElement('text', 'lastname', get_lang('LastName'));
165
-	$form->applyFilter('lastname', 'html_filter');
166
-	$form->applyFilter('lastname', 'trim');
167
-	$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
168
-	// Firstname
169
-	$form->addElement('text', 'firstname', get_lang('FirstName'));
170
-	$form->applyFilter('firstname', 'html_filter');
171
-	$form->applyFilter('firstname', 'trim');
172
-	$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
163
+    // Lastname
164
+    $form->addElement('text', 'lastname', get_lang('LastName'));
165
+    $form->applyFilter('lastname', 'html_filter');
166
+    $form->applyFilter('lastname', 'trim');
167
+    $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
168
+    // Firstname
169
+    $form->addElement('text', 'firstname', get_lang('FirstName'));
170
+    $form->applyFilter('firstname', 'html_filter');
171
+    $form->applyFilter('firstname', 'trim');
172
+    $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
173 173
 }
174 174
 // Official code
175 175
 $form->addElement('text', 'official_code', get_lang('OfficialCode'), array('size' => '40'));
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 $auth_sources = 0; //make available wider as we need it in case of form reset (see below)
225 225
 $nb_ext_auth_source_added = 0;
226 226
 if (isset($extAuthSource) && count($extAuthSource) > 0) {
227
-	$auth_sources = array();
227
+    $auth_sources = array();
228 228
     foreach ($extAuthSource as $key => $info) {
229 229
         // @todo : make uniform external authentification configuration (ex : cas and external_login ldap)
230 230
         // Special case for CAS. CAS is activated from Chamilo > Administration > Configuration > CAS
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
             $nb_ext_auth_source_added++;
236 236
         }
237 237
     }
238
-	if ($nb_ext_auth_source_added > 0) {
239
-    	$group[] = $form->createElement('radio', 'password_auto', null, get_lang('ExternalAuthentication').' ', 2);
240
-    	$group[] = $form->createElement('select', 'auth_source', null, $auth_sources);
241
-    	$group[] = $form->createElement('static', '', '', '<br />');
238
+    if ($nb_ext_auth_source_added > 0) {
239
+        $group[] = $form->createElement('radio', 'password_auto', null, get_lang('ExternalAuthentication').' ', 2);
240
+        $group[] = $form->createElement('select', 'auth_source', null, $auth_sources);
241
+        $group[] = $form->createElement('static', '', '', '<br />');
242 242
     }
243 243
 }
244 244
 
@@ -307,12 +307,12 @@  discard block
 block discarded – undo
307 307
 $form->addElement('html', '<div id="drh_list" style="display:'.$display.';">');
308 308
 
309 309
 if (isset($drh_list) && is_array($drh_list)) {
310
-	foreach ($drh_list as $drh) {
310
+    foreach ($drh_list as $drh) {
311 311
         $drh_select->addOption(
312 312
             api_get_person_name($drh['firstname'], $drh['lastname']),
313 313
             $drh['user_id']
314 314
         );
315
-	}
315
+    }
316 316
 }
317 317
 $form->addElement('html', '</div>');
318 318
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 
387 387
 // Validate form
388 388
 if ($form->validate()) {
389
-	$check = Security::check_token('post');
389
+    $check = Security::check_token('post');
390 390
     if ($check) {
391 391
         $user = $form->exportValues();
392 392
         $lastname = $user['lastname'];
@@ -402,15 +402,15 @@  discard block
 block discarded – undo
402 402
         $send_mail = intval($user['mail']['send_mail']);
403 403
         $hr_dept_id = isset($user['hr_dept_id']) ? intval($user['hr_dept_id']) : 0;
404 404
 
405
-		if (isset($extAuthSource) && count($extAuthSource) > 0 &&
405
+        if (isset($extAuthSource) && count($extAuthSource) > 0 &&
406 406
             $user['password']['password_auto'] == '2'
407 407
         ) {
408
-			$auth_source = $user['password']['auth_source'];
409
-			$password = 'PLACEHOLDER';
410
-		} else {
411
-			$auth_source = PLATFORM_AUTH_SOURCE;
412
-			$password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
413
-		}
408
+            $auth_source = $user['password']['auth_source'];
409
+            $password = 'PLACEHOLDER';
410
+        } else {
411
+            $auth_source = PLATFORM_AUTH_SOURCE;
412
+            $password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
413
+        }
414 414
 
415 415
         if ($user['radio_expiration_date'] == '1') {
416 416
             $expiration_date = $user['expiration_date'];
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
             $expiration_date = null;
419 419
         }
420 420
 
421
-		$active = intval($user['active']);
421
+        $active = intval($user['active']);
422 422
 
423 423
         if (api_get_setting('login_is_email') == 'true') {
424 424
             $username = $email;
@@ -449,21 +449,21 @@  discard block
 block discarded – undo
449 449
             $extra,
450 450
             null,
451 451
             $send_mail,
452
-			$platform_admin
452
+            $platform_admin
453 453
         );
454 454
 
455
-		Security::clear_token();
456
-		$tok = Security::get_token();
457
-		if ($user_id === false) {
458
-			//If any error ocurred during user creation, print it (api_failureList
459
-			// stores values as separate words, so rework it
460
-			$message = '';
461
-			$message_bits = explode(' ',api_get_last_failure());
462
-			foreach ($message_bits as $bit) {
463
-				$message .= ucfirst($bit);
464
-			}
465
-		} else {
466
- 			if (!empty($picture['name'])) {
455
+        Security::clear_token();
456
+        $tok = Security::get_token();
457
+        if ($user_id === false) {
458
+            //If any error ocurred during user creation, print it (api_failureList
459
+            // stores values as separate words, so rework it
460
+            $message = '';
461
+            $message_bits = explode(' ',api_get_last_failure());
462
+            foreach ($message_bits as $bit) {
463
+                $message .= ucfirst($bit);
464
+            }
465
+        } else {
466
+                if (!empty($picture['name'])) {
467 467
                 $picture_uri = UserManager::update_user_picture(
468 468
                     $user_id,
469 469
                     $_FILES['picture']['name'],
@@ -489,35 +489,35 @@  discard block
 block discarded – undo
489 489
                     null,
490 490
                     $language
491 491
                 );
492
-			}
492
+            }
493 493
 
494 494
             $extraFieldValues = new ExtraFieldValue('user');
495 495
             $user['item_id'] = $user_id;
496 496
             $extraFieldValues->saveFieldValues($user);
497 497
 
498
-			$message = get_lang('UserAdded');
499
-		}
500
-		if (isset($user['submit_plus'])) {
501
-			//we want to add more. Prepare report message and redirect to the same page (to clean the form)
502
-			header('Location: user_add.php?message='.urlencode($message).'&sec_token='.$tok);
503
-			exit ();
504
-		} else {
505
-			$tok = Security::get_token();
506
-			header('Location: user_list.php?action=show_message&message='.urlencode($message).'&sec_token='.$tok);
507
-			exit ();
508
-		}
509
-	}
498
+            $message = get_lang('UserAdded');
499
+        }
500
+        if (isset($user['submit_plus'])) {
501
+            //we want to add more. Prepare report message and redirect to the same page (to clean the form)
502
+            header('Location: user_add.php?message='.urlencode($message).'&sec_token='.$tok);
503
+            exit ();
504
+        } else {
505
+            $tok = Security::get_token();
506
+            header('Location: user_list.php?action=show_message&message='.urlencode($message).'&sec_token='.$tok);
507
+            exit ();
508
+        }
509
+    }
510 510
 } else {
511
-	if (isset($_POST['submit'])) {
512
-		Security::clear_token();
513
-	}
514
-	$token = Security::get_token();
515
-	$form->addElement('hidden', 'sec_token');
516
-	$form->setConstants(array('sec_token' => $token));
511
+    if (isset($_POST['submit'])) {
512
+        Security::clear_token();
513
+    }
514
+    $token = Security::get_token();
515
+    $form->addElement('hidden', 'sec_token');
516
+    $form->setConstants(array('sec_token' => $token));
517 517
 }
518 518
 
519 519
 if (!empty($message)){
520
-	$message = Display::return_message(stripslashes($message));
520
+    $message = Display::return_message(stripslashes($message));
521 521
 }
522 522
 $content = $form->returnForm();
523 523
 
Please login to merge, or discard this 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.
main/admin/access_url_edit.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,21 +36,21 @@  discard block
 block discarded – undo
36 36
             if (substr($url, strlen($url) - 1, strlen($url)) == '/') {
37 37
                 UrlManager::update($url_id, $url, $description, $active);
38 38
             } else {
39
-                UrlManager::update($url_id, $url . '/', $description, $active);
39
+                UrlManager::update($url_id, $url.'/', $description, $active);
40 40
             }
41 41
             // URL Images
42
-            $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/';
42
+            $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
43 43
             $image_fields = array("url_image_1", "url_image_2", "url_image_3");
44 44
             foreach ($image_fields as $image_field) {
45 45
                 if ($_FILES[$image_field]['error'] == 0) {
46 46
                     // Hardcoded: only PNG files allowed
47 47
                     if (end(explode('.', $_FILES[$image_field]['name'])) == 'png') {
48
-                        if (file_exists($url_images_dir . $url_id . '_' . $image_field . '.png')) {
48
+                        if (file_exists($url_images_dir.$url_id.'_'.$image_field.'.png')) {
49 49
                             // if the file exists, we have to remove it before move_uploaded_file
50
-                            unlink($url_images_dir . $url_id . '_' . $image_field . '.png');
50
+                            unlink($url_images_dir.$url_id.'_'.$image_field.'.png');
51 51
                         }
52 52
                         move_uploaded_file(
53
-                            $_FILES[$image_field]['tmp_name'], $url_images_dir . $url_id . '_' . $image_field . '.png'
53
+                            $_FILES[$image_field]['tmp_name'], $url_images_dir.$url_id.'_'.$image_field.'.png'
54 54
                         );
55 55
                     }
56 56
                     // else fail silently
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                     UrlManager::add($url, $description, $active);
68 68
                 } else {
69 69
                     //create
70
-                    UrlManager::add($url . '/', $description, $active);
70
+                    UrlManager::add($url.'/', $description, $active);
71 71
                 }
72 72
                 $message = get_lang('URLAdded');
73 73
                 $url_to_go = 'access_urls.php';
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
             // URL Images
79 79
             $url .= (substr($url, strlen($url) - 1, strlen($url)) == '/') ? '' : '/';
80 80
             $url_id = UrlManager::get_url_id($url);
81
-            $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/';
81
+            $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
82 82
             $image_fields = array("url_image_1", "url_image_2", "url_image_3");
83 83
             foreach ($image_fields as $image_field) {
84 84
                 if ($_FILES[$image_field]['error'] == 0) {
85 85
                     // Hardcoded: only PNG files allowed
86 86
                     if (end(explode('.', $_FILES[$image_field]['name'])) == 'png') {
87
-                        move_uploaded_file($_FILES[$image_field]['tmp_name'], $url_images_dir . $url_id . '_' . $image_field . '.png');
87
+                        move_uploaded_file($_FILES[$image_field]['tmp_name'], $url_images_dir.$url_id.'_'.$image_field.'.png');
88 88
                     }
89 89
                     // else fail silently
90 90
                 }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         }
94 94
         Security::clear_token();
95 95
         $tok = Security::get_token();
96
-        header('Location: ' . $url_to_go . '?action=show_message&message=' . urlencode($message) . '&sec_token=' . $tok);
96
+        header('Location: '.$url_to_go.'?action=show_message&message='.urlencode($message).'&sec_token='.$tok);
97 97
         exit();
98 98
     }
99 99
 } else {
Please login to merge, or discard this patch.
main/admin/add_sessions_to_usergroup.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     if (!empty($needle) && !empty($type)) {
127 127
         if ($type == 'single') {
128 128
             // search users where username or firstname or lastname begins likes $needle
129
-          /*  $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user
129
+            /*  $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user
130 130
                     WHERE (username LIKE "'.$needle.'%"
131 131
                     OR firstname LIKE "'.$needle.'%"
132 132
                 OR lastname LIKE "'.$needle.'%") AND user.user_id<>"'.$user_anonymous.'"   AND user.status<>'.DRH.''.
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
       <option value = "%">--</option>
232 232
       <?php
233 233
         echo Display :: get_alphabet_options();
234
-      ?>
234
+        ?>
235 235
      </select>
236 236
 <?php echo '<br />'; ?>
237 237
 </td>
@@ -242,31 +242,31 @@  discard block
 block discarded – undo
242 242
   <td align="center">
243 243
   <div id="content_source">
244 244
       <?php
245
-      if (!($add_type=='multiple')) {
245
+        if (!($add_type=='multiple')) {
246 246
         ?>
247 247
         <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
248 248
         <div id="ajax_list_users_single"></div>
249 249
         <?php
250
-      } else {
251
-      ?>
250
+        } else {
251
+        ?>
252 252
       <div id="ajax_list_multiple">
253 253
         <?php echo Display::select('elements_not_in_name',$elements_not_in, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?>
254 254
       </div>
255 255
     <?php
256
-      }
257
-     ?>
256
+        }
257
+        ?>
258 258
   </div>
259 259
   </td>
260 260
   <td width="10%" valign="middle" align="center">
261 261
   <?php
262
-  if ($ajax_search) {
263
-  ?>
262
+    if ($ajax_search) {
263
+    ?>
264 264
     <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('elements_in'))" >
265 265
         <em class="fa fa-arrow-left"></em>
266 266
     </button>
267 267
   <?php
268
-  } else {
269
-  ?>
268
+    } else {
269
+    ?>
270 270
     <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))">
271 271
         <em class="fa fa-arrow-right"></em>
272 272
     </button>
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
         <em class="fa fa-arrow-left"></em>
276 276
     </button>
277 277
     <?php
278
-  }
279
-  ?>
278
+    }
279
+    ?>
280 280
     <br /><br /><br /><br /><br /><br />
281 281
   </td>
282 282
   <td align="center">
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 *   @package chamilo.admin
5 5
 */
6 6
 // resetting the course id
7
-$cidReset=true;
7
+$cidReset = true;
8 8
 
9 9
 // including some necessary files
10 10
 require_once '../inc/global.inc.php';
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 api_protect_admin_script(true);
22 22
 
23 23
 // setting breadcrumbs
24
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
25
-$interbreadcrumb[]=array('url' => 'usergroups.php','name' => get_lang('Classes'));
24
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
25
+$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes'));
26 26
 
27 27
 // Database Table Definitions
28 28
 
29 29
 // setting the name of the tool
30
-$tool_name=get_lang('SubscribeClassToSessions');
30
+$tool_name = get_lang('SubscribeClassToSessions');
31 31
 
32 32
 $add_type = 'multiple';
33
-if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
33
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
34 34
     $add_type = Security::remove_XSS($_REQUEST['add_type']);
35 35
 }
36 36
 
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
 function display_advanced_search () {
66 66
         if ($("#advancedSearch").css("display") == "none") {
67 67
                 $("#advancedSearch").css("display","block");
68
-                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
68
+                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_hide.gif', get_lang('Hide'), array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
69 69
         } else {
70 70
                 $("#advancedSearch").css("display","none");
71
-                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
71
+                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif', get_lang('Show'), array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
72 72
         }
73 73
 }
74 74
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 $form_sent  = 0;
84 84
 $errorMsg   = '';
85
-$sessions=array();
85
+$sessions = array();
86 86
 $usergroup = new UserGroup();
87 87
 $id = intval($_GET['id']);
88 88
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
 $session_list       = SessionManager::get_sessions_list(array(), array('name'));
104 104
 
105 105
 //api_display_tool_title($tool_name.' ('.$session_info['name'].')');
106
-$elements_not_in = $elements_in= array();
106
+$elements_not_in = $elements_in = array();
107 107
 
108 108
 if (!empty($session_list)) {
109
-    foreach($session_list as $session) {
109
+    foreach ($session_list as $session) {
110 110
         if (in_array($session['id'], $session_list_in)) {
111 111
             $elements_in[$session['id']] = $session['name'];
112 112
         } else {
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 //checking for extra field with filter on
121 121
 
122
-function search_sessions($needle,$type) {
122
+function search_sessions($needle, $type) {
123 123
     global $elements_in;
124 124
     $xajax_response = new xajaxResponse();
125 125
     $return = '';
@@ -141,18 +141,18 @@  discard block
 block discarded – undo
141 141
                 array('s.name' => array('operator' => 'LIKE', 'value' => "$needle%"))
142 142
             );
143 143
         }
144
-        $i=0;
145
-        if ($type=='single') {
144
+        $i = 0;
145
+        if ($type == 'single') {
146 146
         } else {
147 147
             $return .= '<select id="elements_not_in" name="elements_not_in_name[]" multiple="multiple" size="15" style="width:360px;">';
148 148
 
149
-            foreach ($session_list as $row ) {
149
+            foreach ($session_list as $row) {
150 150
                 if (!in_array($row['id'], array_keys($elements_in))) {
151 151
                     $return .= '<option value="'.$row['id'].'">'.$row['name'].'</option>';
152 152
                 }
153 153
             }
154 154
             $return .= '</select>';
155
-            $xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return));
155
+            $xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return));
156 156
         }
157 157
     }
158 158
 
@@ -171,19 +171,19 @@  discard block
 block discarded – undo
171 171
 }
172 172
 
173 173
 echo '<div class="actions">';
174
-echo '<a href="usergroups.php">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
175
-echo '<a href="javascript://" class="advanced_parameters" style="margin-top: 8px" onclick="display_advanced_search();"><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'</span></a>';
174
+echo '<a href="usergroups.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
175
+echo '<a href="javascript://" class="advanced_parameters" style="margin-top: 8px" onclick="display_advanced_search();"><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif', get_lang('Show'), array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'</span></a>';
176 176
 echo '</div>';
177
-echo '<div id="advancedSearch" style="display: none">'. get_lang('SearchSessions'); ?> :
177
+echo '<div id="advancedSearch" style="display: none">'.get_lang('SearchSessions'); ?> :
178 178
      <input name="SearchSession" onchange = "xajax_search_sessions(this.value,'searchbox')" onkeyup="this.onchange()">
179 179
      </div>
180
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
180
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
181 181
 <?php
182 182
 echo '<legend>'.$data['name'].': '.$tool_name.'</legend>';
183 183
 
184
-if ($add_type=='multiple') {
184
+if ($add_type == 'multiple') {
185 185
     if (is_array($extra_field_list)) {
186
-        if (is_array($new_field_list) && count($new_field_list)>0 ) {
186
+        if (is_array($new_field_list) && count($new_field_list) > 0) {
187 187
             echo '<h3>'.get_lang('FilterUsers').'</h3>';
188 188
             foreach ($new_field_list as $new_field) {
189 189
                 echo $new_field['name'];
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
                 echo '&nbsp;<select name="'.$varname.'">';
192 192
                 echo '<option value="0">--'.get_lang('Select').'--</option>';
193 193
                 foreach ($new_field['data'] as $option) {
194
-                    $checked='';
194
+                    $checked = '';
195 195
                     if (isset($_POST[$varname])) {
196
-                        if ($_POST[$varname]==$option[1]) {
196
+                        if ($_POST[$varname] == $option[1]) {
197 197
                             $checked = 'selected="true"';
198 198
                         }
199 199
                     }
@@ -207,10 +207,10 @@  discard block
 block discarded – undo
207 207
         }
208 208
     }
209 209
 }
210
-echo Display::input('hidden','id',$id);
211
-echo Display::input('hidden','form_sent','1');
212
-echo Display::input('hidden','add_type',null);
213
-if(!empty($errorMsg)) {
210
+echo Display::input('hidden', 'id', $id);
211
+echo Display::input('hidden', 'form_sent', '1');
212
+echo Display::input('hidden', 'add_type', null);
213
+if (!empty($errorMsg)) {
214 214
     Display::display_normal_message($errorMsg); //main API
215 215
 }
216 216
 ?>
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
   <td align="center"><b><?php echo get_lang('SessionsInGroup') ?> :</b></td>
224 224
 </tr>
225 225
 
226
-<?php if ($add_type=='multiple') { ?>
226
+<?php if ($add_type == 'multiple') { ?>
227 227
 <tr>
228 228
 <td align="center">
229 229
 <?php echo get_lang('FirstLetterSessions'); ?> :
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
   <td align="center">
243 243
   <div id="content_source">
244 244
       <?php
245
-      if (!($add_type=='multiple')) {
245
+      if (!($add_type == 'multiple')) {
246 246
         ?>
247 247
         <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
248 248
         <div id="ajax_list_users_single"></div>
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
       } else {
251 251
       ?>
252 252
       <div id="ajax_list_multiple">
253
-        <?php echo Display::select('elements_not_in_name',$elements_not_in, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?>
253
+        <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_not_in', 'size'=>'15px'), false); ?>
254 254
       </div>
255 255
     <?php
256 256
       }
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
   </td>
282 282
   <td align="center">
283 283
 <?php
284
-    echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_in','size'=>'15px'),false );
284
+    echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_in', 'size'=>'15px'), false);
285 285
     unset($sessionUsersList);
286 286
 ?>
287 287
  </td>
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,10 @@
 block discarded – undo
144 144
 echo '</div>';
145 145
 ?>
146 146
 
147
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
147
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) {
148
+    echo '&add=true' ;
149
+}
150
+?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
148 151
 <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>';
149 152
 
150 153
 if ($add_type=='multiple') {
Please login to merge, or discard this patch.
main/admin/course_create_content.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@
 block discarded – undo
7 7
  * @package chamilo.admin
8 8
  */
9 9
 include ('../inc/global.inc.php');
10
-$this_section=SECTION_PLATFORM_ADMIN;
10
+$this_section = SECTION_PLATFORM_ADMIN;
11 11
 
12 12
 api_protect_admin_script();
13 13
 $tool_name = get_lang('DummyCourseCreator');
14
-$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
14
+$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
15 15
 Display::display_header($tool_name);
16 16
 //api_display_tool_title($tool_name);
17 17
 if (api_get_setting('server_type') != 'test') {
18 18
 	echo get_lang('DummyCourseOnlyOnTestServer');
19
-} elseif( isset($_POST['action'])) {
19
+} elseif (isset($_POST['action'])) {
20 20
 	require_once('../coursecopy/classes/DummyCourseCreator.class.php');
21 21
 	$dcc = new DummyCourseCreator();
22 22
 	$dcc->create_dummy_course($_POST['course_code']);
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,15 +15,15 @@
 block discarded – undo
15 15
 Display::display_header($tool_name);
16 16
 //api_display_tool_title($tool_name);
17 17
 if (api_get_setting('server_type') != 'test') {
18
-	echo get_lang('DummyCourseOnlyOnTestServer');
18
+    echo get_lang('DummyCourseOnlyOnTestServer');
19 19
 } elseif( isset($_POST['action'])) {
20
-	require_once('../coursecopy/classes/DummyCourseCreator.class.php');
21
-	$dcc = new DummyCourseCreator();
22
-	$dcc->create_dummy_course($_POST['course_code']);
23
-	echo get_lang('Done');
20
+    require_once('../coursecopy/classes/DummyCourseCreator.class.php');
21
+    $dcc = new DummyCourseCreator();
22
+    $dcc->create_dummy_course($_POST['course_code']);
23
+    echo get_lang('Done');
24 24
 } else {
25
-	echo get_lang('DummyCourseDescription');
26
-	echo '<form method="post"><input type="hidden" name="course_code" value="'.Security::remove_XSS($_GET['course_code']).'"/><input type="submit" name="action" value="'.get_lang('Ok').'"/></form>';
25
+    echo get_lang('DummyCourseDescription');
26
+    echo '<form method="post"><input type="hidden" name="course_code" value="'.Security::remove_XSS($_GET['course_code']).'"/><input type="submit" name="action" value="'.get_lang('Ok').'"/></form>';
27 27
 }
28 28
 
29 29
 Display::display_footer();
Please login to merge, or discard this patch.