Minor - cleaning code

skala
Julio Montoya 16 years ago
parent 8c4926062d
commit 3f34a0edab
  1. 17
      main/admin/user_add.php

@ -1,18 +1,17 @@
<?php <?php
/* For licensing terms, see /dokeos_license.txt */ /* For licensing terms, see /license.txt */
/** /**
============================================================================== ==============================================================================
* @package dokeos.admin * @package chamilo.admin
============================================================================== ==============================================================================
*/ */
// Language files that should be included // Language files that should be included
$language_file = array('admin', 'registration'); $language_file = array('admin', 'registration');
$cidReset = true; $cidReset = true;
// Including necessary libraries. // Including necessary libraries.
require '../inc/global.inc.php'; require_once '../inc/global.inc.php';
$libpath = api_get_path(LIBRARY_PATH); $libpath = api_get_path(LIBRARY_PATH);
require_once $libpath.'fileManage.lib.php'; require_once $libpath.'fileManage.lib.php';
require_once $libpath.'fileUpload.lib.php'; require_once $libpath.'fileUpload.lib.php';
@ -300,10 +299,6 @@ $defaults = array_merge($defaults, $extra_data);
$form->setDefaults($defaults); $form->setDefaults($defaults);
// Submit button // Submit button
/*
$form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="add"');
$form->addElement('style_submit_button', 'submit_plus', get_lang('Add').'+', 'class="add"');
*/
$select_level = array (); $select_level = array ();
$html_results_enabled[] = FormValidator :: createElement ('style_submit_button', 'submit_plus', get_lang('Add').'+', 'class="add"'); $html_results_enabled[] = FormValidator :: createElement ('style_submit_button', 'submit_plus', get_lang('Add').'+', 'class="add"');
$html_results_enabled[] = FormValidator :: createElement ('style_submit_button', 'submit', get_lang('Add'), 'class="add"'); $html_results_enabled[] = FormValidator :: createElement ('style_submit_button', 'submit', get_lang('Add'), 'class="add"');
@ -317,9 +312,7 @@ if( $form->validate()) {
$picture_element = & $form->getElement('picture'); $picture_element = & $form->getElement('picture');
$picture = $picture_element->getValue(); $picture = $picture_element->getValue();
$picture_uri = ''; $picture_uri = '';
$lastname = $user['lastname']; $lastname = $user['lastname'];
$firstname = $user['firstname']; $firstname = $user['firstname'];
$official_code = $user['official_code']; $official_code = $user['official_code'];
@ -387,7 +380,7 @@ if( $form->validate()) {
if (isset($user['submit_plus'])) { if (isset($user['submit_plus'])) {
//we want to add more. Prepare report message and redirect to the same page (to clean the form) //we want to add more. Prepare report message and redirect to the same page (to clean the form)
$tok = Security::get_token(); $tok = Security::get_token();
header('Location: user_add.php?message='.urlencode(get_lang('UserAdded')).'&sec_token='.$tok); header('Location: user_add.php?message='.urlencode(get_lang('UserAdded')).'&sec_token='.$tok);
exit (); exit ();
} else { } else {
$tok = Security::get_token(); $tok = Security::get_token();
@ -413,4 +406,4 @@ if(!empty($message)){
$form->display(); $form->display();
// Footer // Footer
Display::display_footer(); Display::display_footer();
Loading…
Cancel
Save