@@ -36,7 +36,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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)); |
@@ -149,27 +149,27 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -42,8 +42,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
335 | 335 | $form->addGroup($group, 'mail', get_lang('SendMailToNewUser'), ' '); |
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 |
||
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 |
||
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 |
||
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(); |
@@ -36,21 +36,21 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 { |
@@ -7,16 +7,16 @@ |
||
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']); |
@@ -15,15 +15,15 @@ |
||
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(); |
@@ -5,13 +5,13 @@ |
||
5 | 5 | * @package chamilo.admin |
6 | 6 | */ |
7 | 7 | |
8 | -$cidReset=true; |
|
8 | +$cidReset = true; |
|
9 | 9 | require_once '../inc/global.inc.php'; |
10 | 10 | $this_section = SECTION_PLATFORM_ADMIN; |
11 | 11 | |
12 | 12 | api_protect_admin_script(); |
13 | 13 | |
14 | -$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
|
14 | +$interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
15 | 15 | $tool_name = get_lang('Statistics'); |
16 | 16 | Display::display_header($tool_name); |
17 | 17 | Display::display_footer(); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | Display::addFlash(Display::return_message(get_lang('FileDeleted'))); |
60 | 60 | } |
61 | 61 | |
62 | -if (isset($_GET['action']) && $_GET['action'] == 'delete_grading') { |
|
62 | +if (isset($_GET['action']) && $_GET['action'] == 'delete_grading') { |
|
63 | 63 | $id = intval($_GET['id']); |
64 | 64 | api_delete_setting_option($id); |
65 | 65 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
125 | - if (isset($category) && $category== 'search_setting') { |
|
125 | + if (isset($category) && $category == 'search_setting') { |
|
126 | 126 | if (!empty($_REQUEST['search_field'])) { |
127 | 127 | $settings = search_setting($_REQUEST['search_field']); |
128 | 128 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | // Set true for allow_message_tool variable if social tool is actived |
221 | 221 | foreach ($convert_byte_to_mega_list as $item) { |
222 | 222 | if (isset($values[$item])) { |
223 | - $values[$item] = round($values[$item]*1024*1024); |
|
223 | + $values[$item] = round($values[$item] * 1024 * 1024); |
|
224 | 224 | } |
225 | 225 | } |
226 | 226 |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $htmlHeadXtra[] = api_get_jqgrid_js(); |
19 | 19 | |
20 | 20 | // setting breadcrumbs |
21 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
22 | -$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions')); |
|
21 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | +$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions')); |
|
23 | 23 | |
24 | 24 | Display :: display_header(null); |
25 | 25 | |
26 | -$form = new FormValidator('filter_form','GET', api_get_self()); |
|
26 | +$form = new FormValidator('filter_form', 'GET', api_get_self()); |
|
27 | 27 | |
28 | 28 | $career = new Career(); |
29 | 29 | |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | // action links |
55 | 55 | echo '<div class="actions" style="margin-bottom:20px">'; |
56 | 56 | echo '<a href="../admin/index.php">'. |
57 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
57 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
58 | 58 | echo '<a href="careers.php">'. |
59 | - Display::return_icon('career.png',get_lang('Careers'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
59 | + Display::return_icon('career.png', get_lang('Careers'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
60 | 60 | echo '<a href="promotions.php">'. |
61 | - Display::return_icon('promotion.png',get_lang('Promotions'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
61 | + Display::return_icon('promotion.png', get_lang('Promotions'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
62 | 62 | echo '</div>'; |
63 | 63 | |
64 | 64 | $form->display(); |
@@ -119,22 +119,22 @@ discard block |
||
119 | 119 | foreach ($career_array as $career_id => $data) { |
120 | 120 | $career = $data['name']; |
121 | 121 | $promotions = $data['promotions']; |
122 | - $career = Display::url($career, 'careers.php?action=edit&id=' . $career_id); |
|
122 | + $career = Display::url($career, 'careers.php?action=edit&id='.$career_id); |
|
123 | 123 | $career = Display::tag('h4', $career); |
124 | - echo '<tr><td style="background-color:#ECF0F1" colspan="3">' . $career . '</td></tr>'; |
|
124 | + echo '<tr><td style="background-color:#ECF0F1" colspan="3">'.$career.'</td></tr>'; |
|
125 | 125 | if (!empty($promotions)) { |
126 | 126 | foreach ($promotions as $promotion_id => $promotion) { |
127 | 127 | $promotion_name = $promotion['name']; |
128 | - $promotion_url = Display::url($promotion_name, 'promotions.php?action=edit&id=' . $promotion_id); |
|
128 | + $promotion_url = Display::url($promotion_name, 'promotions.php?action=edit&id='.$promotion_id); |
|
129 | 129 | $sessions = $promotion['sessions']; |
130 | 130 | echo '<tr>'; |
131 | 131 | $count = count($sessions); |
132 | 132 | $rowspan = ''; |
133 | 133 | if (!empty($count)) { |
134 | 134 | $count++; |
135 | - $rowspan = 'rowspan="' . $count . '"'; |
|
135 | + $rowspan = 'rowspan="'.$count.'"'; |
|
136 | 136 | } |
137 | - echo '<td ' . $rowspan . '>'; |
|
137 | + echo '<td '.$rowspan.'>'; |
|
138 | 138 | echo Display::tag('h5', $promotion_url); |
139 | 139 | echo '</td>'; |
140 | 140 | echo '</tr>'; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $course_list = $session['courses']; |
145 | 145 | |
146 | 146 | $url = Display::url($session['data']['name'], |
147 | - '../session/resume_session.php?id_session=' . $session['data']['id']); |
|
147 | + '../session/resume_session.php?id_session='.$session['data']['id']); |
|
148 | 148 | echo '<tr>'; |
149 | 149 | //Session name |
150 | 150 | echo Display::tag('td', $url); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | $url = Display::url( |
159 | 159 | $course['title'], |
160 | - api_get_path(WEB_COURSE_PATH) . $course['directory'] . '/index.php?id_session=' . $session['data']['id'] |
|
160 | + api_get_path(WEB_COURSE_PATH).$course['directory'].'/index.php?id_session='.$session['data']['id'] |
|
161 | 161 | ); |
162 | 162 | echo Display::tag('td', $url); |
163 | 163 | echo '</tr>'; |
@@ -15,18 +15,18 @@ discard block |
||
15 | 15 | |
16 | 16 | $tool_name = get_lang('SessionOverview'); |
17 | 17 | |
18 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
19 | -$interbreadcrumb[]=array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
18 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
19 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
20 | 20 | |
21 | 21 | // Database Table Definitions |
22 | -$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
23 | -$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
22 | +$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
23 | +$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
24 | 24 | $table_access_url_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
25 | 25 | $url_id = api_get_current_access_url_id(); |
26 | 26 | |
27 | 27 | $action = $_GET['action']; |
28 | 28 | |
29 | -switch($action) { |
|
29 | +switch ($action) { |
|
30 | 30 | case 'add_user_to_url': |
31 | 31 | $user_id = $_REQUEST['user_id']; |
32 | 32 | $result = UrlManager::add_user_to_url($user_id, $url_id); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | -foreach($session_list as $session_item) { |
|
61 | +foreach ($session_list as $session_item) { |
|
62 | 62 | $session_id = $session_item['id']; |
63 | 63 | $html .= '<h3>'.$session_item['name'].'</h3>'; |
64 | 64 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | $xajax = new xajax(); |
13 | 13 | $xajax->registerFunction( |
14 | - array('search_courses', 'Accessurleditcoursestourl', 'search_courses') |
|
14 | + array('search_courses', 'Accessurleditcoursestourl', 'search_courses') |
|
15 | 15 | ); |
16 | 16 | |
17 | 17 | // setting the section (for the tabs) |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | // Access restrictions |
21 | 21 | api_protect_global_admin_script(); |
22 | 22 | if (!api_get_multiple_access_url()) { |
23 | - header('Location: index.php'); |
|
24 | - exit; |
|
23 | + header('Location: index.php'); |
|
24 | + exit; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | // Database Table Definitions |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | |
37 | 37 | $add_type = 'multiple'; |
38 | 38 | if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') { |
39 | - $add_type = Security::remove_XSS($_REQUEST['add_type']); |
|
39 | + $add_type = Security::remove_XSS($_REQUEST['add_type']); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $access_url_id = 1; |
43 | 43 | if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') { |
44 | - $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']); |
|
44 | + $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | $xajax -> processRequests(); |
@@ -83,21 +83,21 @@ discard block |
||
83 | 83 | $users = $sessions = array(); |
84 | 84 | |
85 | 85 | if (isset($_POST['form_sent']) && $_POST['form_sent']) { |
86 | - $form_sent = $_POST['form_sent']; |
|
87 | - $course_list = $_POST['course_list']; |
|
88 | - |
|
89 | - if (!is_array($course_list)) { |
|
90 | - $course_list = array(); |
|
91 | - } |
|
92 | - |
|
93 | - if ($form_sent == 1) { |
|
94 | - if ($access_url_id==0) { |
|
95 | - header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL')); |
|
96 | - } elseif (is_array($course_list)) { |
|
97 | - UrlManager::update_urls_rel_course($course_list, $access_url_id); |
|
98 | - header('Location: access_urls.php?action=show_message&message='.get_lang('CoursesWereEdited')); |
|
99 | - } |
|
100 | - } |
|
86 | + $form_sent = $_POST['form_sent']; |
|
87 | + $course_list = $_POST['course_list']; |
|
88 | + |
|
89 | + if (!is_array($course_list)) { |
|
90 | + $course_list = array(); |
|
91 | + } |
|
92 | + |
|
93 | + if ($form_sent == 1) { |
|
94 | + if ($access_url_id==0) { |
|
95 | + header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL')); |
|
96 | + } elseif (is_array($course_list)) { |
|
97 | + UrlManager::update_urls_rel_course($course_list, $access_url_id); |
|
98 | + header('Location: access_urls.php?action=show_message&message='.get_lang('CoursesWereEdited')); |
|
99 | + } |
|
100 | + } |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | Display::display_header($tool_name); |
@@ -109,45 +109,45 @@ discard block |
||
109 | 109 | api_display_tool_title($tool_name); |
110 | 110 | |
111 | 111 | if (isset($_GET['action']) && $_GET['action'] == 'show_message') |
112 | - Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
|
112 | + Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
|
113 | 113 | |
114 | 114 | $no_course_list = $course_list = array(); |
115 | 115 | $ajax_search = $add_type == 'unique' ? true : false; |
116 | 116 | |
117 | 117 | if($ajax_search) { |
118 | - $courses = UrlManager::get_url_rel_course_data($access_url_id); |
|
119 | - foreach ($courses as $course) { |
|
120 | - $course_list[$course['c_id']] = $course; |
|
121 | - } |
|
118 | + $courses = UrlManager::get_url_rel_course_data($access_url_id); |
|
119 | + foreach ($courses as $course) { |
|
120 | + $course_list[$course['c_id']] = $course; |
|
121 | + } |
|
122 | 122 | } else { |
123 | - $courses = UrlManager::get_url_rel_course_data(); |
|
123 | + $courses = UrlManager::get_url_rel_course_data(); |
|
124 | 124 | |
125 | - foreach ($courses as $course) { |
|
126 | - if ($course['access_url_id'] == $access_url_id) { |
|
127 | - $course_list[$course['c_id']] = $course; |
|
128 | - } |
|
129 | - } |
|
125 | + foreach ($courses as $course) { |
|
126 | + if ($course['access_url_id'] == $access_url_id) { |
|
127 | + $course_list[$course['c_id']] = $course; |
|
128 | + } |
|
129 | + } |
|
130 | 130 | |
131 | - $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); |
|
132 | - $sql="SELECT id, code, title |
|
131 | + $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); |
|
132 | + $sql="SELECT id, code, title |
|
133 | 133 | FROM $tbl_course u |
134 | 134 | ORDER BY title, code"; |
135 | - $result = Database::query($sql); |
|
136 | - $courses = Database::store_result($result); |
|
137 | - $course_list_leys = array_keys($course_list); |
|
138 | - foreach ($courses as $course) { |
|
139 | - if (!in_array($course['id'], $course_list_leys)) { |
|
140 | - $no_course_list[$course['id']] = $course; |
|
141 | - } |
|
142 | - } |
|
135 | + $result = Database::query($sql); |
|
136 | + $courses = Database::store_result($result); |
|
137 | + $course_list_leys = array_keys($course_list); |
|
138 | + foreach ($courses as $course) { |
|
139 | + if (!in_array($course['id'], $course_list_leys)) { |
|
140 | + $no_course_list[$course['id']] = $course; |
|
141 | + } |
|
142 | + } |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | if($add_type == 'multiple') { |
146 | - $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
147 | - $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
|
146 | + $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
147 | + $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
|
148 | 148 | } else { |
149 | - $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
|
150 | - $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
149 | + $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
|
150 | + $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
151 | 151 | } |
152 | 152 | $url_list = UrlManager::get_url_data(); |
153 | 153 | ?> |
@@ -160,31 +160,31 @@ discard block |
||
160 | 160 | <select name="access_url_id" onchange="javascript:send();"> |
161 | 161 | <option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option> |
162 | 162 | <?php |
163 | - $url_selected=''; |
|
164 | - foreach ($url_list as $url_obj) { |
|
165 | - $checked = ''; |
|
166 | - if (!empty($access_url_id)) { |
|
167 | - if ($url_obj[0]==$access_url_id) { |
|
168 | - $checked = 'selected=true'; |
|
169 | - $url_selected=$url_obj[1]; |
|
170 | - } |
|
171 | - } |
|
172 | - if ($url_obj['active']==1) { |
|
173 | - ?> |
|
163 | + $url_selected=''; |
|
164 | + foreach ($url_list as $url_obj) { |
|
165 | + $checked = ''; |
|
166 | + if (!empty($access_url_id)) { |
|
167 | + if ($url_obj[0]==$access_url_id) { |
|
168 | + $checked = 'selected=true'; |
|
169 | + $url_selected=$url_obj[1]; |
|
170 | + } |
|
171 | + } |
|
172 | + if ($url_obj['active']==1) { |
|
173 | + ?> |
|
174 | 174 | <option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option> |
175 | 175 | <?php |
176 | - } |
|
177 | - } |
|
178 | - ?> |
|
176 | + } |
|
177 | + } |
|
178 | + ?> |
|
179 | 179 | </select> |
180 | 180 | <br /><br /> |
181 | 181 | <input type="hidden" name="form_sent" value="1" /> |
182 | 182 | <input type="hidden" name="add_type" value = "<?php echo $add_type ?>" /> |
183 | 183 | <?php |
184 | - if(!empty($errorMsg)) { |
|
185 | - Display::display_normal_message($errorMsg); //main API |
|
186 | - } |
|
187 | - ?> |
|
184 | + if(!empty($errorMsg)) { |
|
185 | + Display::display_normal_message($errorMsg); //main API |
|
186 | + } |
|
187 | + ?> |
|
188 | 188 | <table border="0" cellpadding="5" cellspacing="0" width="100%"> |
189 | 189 | |
190 | 190 | <!-- Users --> |
@@ -199,38 +199,38 @@ discard block |
||
199 | 199 | <td align="center"> |
200 | 200 | <div id="content_source"> |
201 | 201 | <?php |
202 | - if($ajax_search) { |
|
203 | - ?> |
|
202 | + if($ajax_search) { |
|
203 | + ?> |
|
204 | 204 | <input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" /> |
205 | 205 | <div id="ajax_list_courses"></div> |
206 | 206 | <?php |
207 | - } else { |
|
208 | - ?> |
|
207 | + } else { |
|
208 | + ?> |
|
209 | 209 | <select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;"> |
210 | 210 | <?php |
211 | - foreach($no_course_list as $no_course) { |
|
212 | - ?> |
|
211 | + foreach($no_course_list as $no_course) { |
|
212 | + ?> |
|
213 | 213 | <option value="<?php echo $no_course['id']; ?>"><?php echo $no_course['title'].' ('.$no_course['code'].')'; ?></option> |
214 | 214 | <?php |
215 | - } |
|
216 | - unset($no_course_list); |
|
217 | - ?> |
|
215 | + } |
|
216 | + unset($no_course_list); |
|
217 | + ?> |
|
218 | 218 | </select> |
219 | 219 | <?php |
220 | - } |
|
221 | - ?> |
|
220 | + } |
|
221 | + ?> |
|
222 | 222 | </div> |
223 | 223 | </td> |
224 | 224 | <td width="10%" valign="middle" align="center"> |
225 | 225 | <?php |
226 | - if($ajax_search) { |
|
227 | - ?> |
|
226 | + if($ajax_search) { |
|
227 | + ?> |
|
228 | 228 | <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" > |
229 | 229 | <em class="fa fa-arrow-left"></em> |
230 | 230 | </button> |
231 | 231 | <?php |
232 | - } else { |
|
233 | - ?> |
|
232 | + } else { |
|
233 | + ?> |
|
234 | 234 | <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" > |
235 | 235 | <em class="fa fa-arrow-right"></em> |
236 | 236 | </button> |
@@ -239,21 +239,21 @@ discard block |
||
239 | 239 | <em class="fa fa-arrow-left"></em> |
240 | 240 | </button> |
241 | 241 | <?php |
242 | - } |
|
243 | - ?> |
|
242 | + } |
|
243 | + ?> |
|
244 | 244 | <br /><br /><br /><br /><br /><br /> |
245 | 245 | </td> |
246 | 246 | <td align="center"> |
247 | 247 | <select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;"> |
248 | 248 | <?php |
249 | - foreach($course_list as $course) { |
|
250 | - $courseInfo = api_get_course_info_by_id($course['id']); |
|
251 | - ?> |
|
249 | + foreach($course_list as $course) { |
|
250 | + $courseInfo = api_get_course_info_by_id($course['id']); |
|
251 | + ?> |
|
252 | 252 | <option value="<?php echo $course['id']; ?>"><?php echo $course['title'].' ('.$courseInfo['code'].')'; ?></option> |
253 | 253 | <?php |
254 | - } |
|
255 | - unset($course_list); |
|
256 | - ?> |
|
254 | + } |
|
255 | + unset($course_list); |
|
256 | + ?> |
|
257 | 257 | |
258 | 258 | </select></td> |
259 | 259 | </tr> |
@@ -261,11 +261,11 @@ discard block |
||
261 | 261 | <td colspan="3" align="center"> |
262 | 262 | <br /> |
263 | 263 | <?php |
264 | - if(isset($_GET['add'])) |
|
265 | - echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
|
266 | - else |
|
267 | - echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
|
268 | - ?> |
|
264 | + if(isset($_GET['add'])) |
|
265 | + echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
|
266 | + else |
|
267 | + echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
|
268 | + ?> |
|
269 | 269 | </td> |
270 | 270 | </tr> |
271 | 271 | </table> |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | $interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); |
36 | 36 | |
37 | 37 | $add_type = 'multiple'; |
38 | -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') { |
|
38 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
39 | 39 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
40 | 40 | } |
41 | 41 | |
42 | 42 | $access_url_id = 1; |
43 | -if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') { |
|
43 | +if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') { |
|
44 | 44 | $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']); |
45 | 45 | } |
46 | 46 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | if ($form_sent == 1) { |
94 | - if ($access_url_id==0) { |
|
94 | + if ($access_url_id == 0) { |
|
95 | 95 | header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL')); |
96 | 96 | } elseif (is_array($course_list)) { |
97 | 97 | UrlManager::update_urls_rel_course($course_list, $access_url_id); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | Display::display_header($tool_name); |
104 | 104 | |
105 | 105 | echo '<div class="actions">'; |
106 | -echo Display::url( Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'),''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_courses_to_url.php'); |
|
106 | +echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_courses_to_url.php'); |
|
107 | 107 | echo '</div>'; |
108 | 108 | |
109 | 109 | api_display_tool_title($tool_name); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $no_course_list = $course_list = array(); |
115 | 115 | $ajax_search = $add_type == 'unique' ? true : false; |
116 | 116 | |
117 | -if($ajax_search) { |
|
117 | +if ($ajax_search) { |
|
118 | 118 | $courses = UrlManager::get_url_rel_course_data($access_url_id); |
119 | 119 | foreach ($courses as $course) { |
120 | 120 | $course_list[$course['c_id']] = $course; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); |
132 | - $sql="SELECT id, code, title |
|
132 | + $sql = "SELECT id, code, title |
|
133 | 133 | FROM $tbl_course u |
134 | 134 | ORDER BY title, code"; |
135 | 135 | $result = Database::query($sql); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
145 | -if($add_type == 'multiple') { |
|
145 | +if ($add_type == 'multiple') { |
|
146 | 146 | $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
147 | 147 | $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
148 | 148 | } else { |
@@ -155,23 +155,23 @@ discard block |
||
155 | 155 | <?php echo $link_add_type_unique ?> | <?php echo $link_add_type_multiple ?> |
156 | 156 | </div> |
157 | 157 | <br /><br /> |
158 | - <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?> > |
|
158 | + <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?> > |
|
159 | 159 | <?php echo get_lang('SelectUrl').' : '; ?> |
160 | 160 | <select name="access_url_id" onchange="javascript:send();"> |
161 | 161 | <option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option> |
162 | 162 | <?php |
163 | - $url_selected=''; |
|
163 | + $url_selected = ''; |
|
164 | 164 | foreach ($url_list as $url_obj) { |
165 | 165 | $checked = ''; |
166 | 166 | if (!empty($access_url_id)) { |
167 | - if ($url_obj[0]==$access_url_id) { |
|
167 | + if ($url_obj[0] == $access_url_id) { |
|
168 | 168 | $checked = 'selected=true'; |
169 | - $url_selected=$url_obj[1]; |
|
169 | + $url_selected = $url_obj[1]; |
|
170 | 170 | } |
171 | 171 | } |
172 | - if ($url_obj['active']==1) { |
|
172 | + if ($url_obj['active'] == 1) { |
|
173 | 173 | ?> |
174 | - <option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option> |
|
174 | + <option <?php echo $checked; ?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option> |
|
175 | 175 | <?php |
176 | 176 | } |
177 | 177 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | <input type="hidden" name="form_sent" value="1" /> |
182 | 182 | <input type="hidden" name="add_type" value = "<?php echo $add_type ?>" /> |
183 | 183 | <?php |
184 | - if(!empty($errorMsg)) { |
|
184 | + if (!empty($errorMsg)) { |
|
185 | 185 | Display::display_normal_message($errorMsg); //main API |
186 | 186 | } |
187 | 187 | ?> |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | <td align="center"> |
200 | 200 | <div id="content_source"> |
201 | 201 | <?php |
202 | - if($ajax_search) { |
|
202 | + if ($ajax_search) { |
|
203 | 203 | ?> |
204 | 204 | <input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" /> |
205 | 205 | <div id="ajax_list_courses"></div> |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | ?> |
209 | 209 | <select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;"> |
210 | 210 | <?php |
211 | - foreach($no_course_list as $no_course) { |
|
211 | + foreach ($no_course_list as $no_course) { |
|
212 | 212 | ?> |
213 | 213 | <option value="<?php echo $no_course['id']; ?>"><?php echo $no_course['title'].' ('.$no_course['code'].')'; ?></option> |
214 | 214 | <?php |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | </td> |
224 | 224 | <td width="10%" valign="middle" align="center"> |
225 | 225 | <?php |
226 | - if($ajax_search) { |
|
226 | + if ($ajax_search) { |
|
227 | 227 | ?> |
228 | 228 | <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" > |
229 | 229 | <em class="fa fa-arrow-left"></em> |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | <td align="center"> |
247 | 247 | <select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;"> |
248 | 248 | <?php |
249 | - foreach($course_list as $course) { |
|
249 | + foreach ($course_list as $course) { |
|
250 | 250 | $courseInfo = api_get_course_info_by_id($course['id']); |
251 | 251 | ?> |
252 | 252 | <option value="<?php echo $course['id']; ?>"><?php echo $course['title'].' ('.$courseInfo['code'].')'; ?></option> |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | <td colspan="3" align="center"> |
262 | 262 | <br /> |
263 | 263 | <?php |
264 | - if(isset($_GET['add'])) |
|
264 | + if (isset($_GET['add'])) |
|
265 | 265 | echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
266 | 266 | else |
267 | 267 | echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
@@ -108,8 +108,9 @@ discard block |
||
108 | 108 | |
109 | 109 | api_display_tool_title($tool_name); |
110 | 110 | |
111 | -if (isset($_GET['action']) && $_GET['action'] == 'show_message') |
|
111 | +if (isset($_GET['action']) && $_GET['action'] == 'show_message') { |
|
112 | 112 | Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
113 | +} |
|
113 | 114 | |
114 | 115 | $no_course_list = $course_list = array(); |
115 | 116 | $ajax_search = $add_type == 'unique' ? true : false; |
@@ -261,10 +262,11 @@ discard block |
||
261 | 262 | <td colspan="3" align="center"> |
262 | 263 | <br /> |
263 | 264 | <?php |
264 | - if(isset($_GET['add'])) |
|
265 | - echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
|
266 | - else |
|
267 | - echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
|
265 | + if(isset($_GET['add'])) { |
|
266 | + echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
|
267 | + } else { |
|
268 | + echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
|
269 | + } |
|
268 | 270 | ?> |
269 | 271 | </td> |
270 | 272 | </tr> |