You are here

function _user_import_edit_template_fields in User Import 6.2

Same name and namespace in other branches
  1. 8 supported/user_import.inc \_user_import_edit_template_fields()
  2. 5.2 supported/user_import.inc \_user_import_edit_template_fields()
  3. 5 supported/user_import.inc \_user_import_edit_template_fields()
  4. 6.4 supported/user_import.inc \_user_import_edit_template_fields()
  5. 7.3 supported/user_import.inc \_user_import_edit_template_fields()
  6. 7 supported/user_import.inc \_user_import_edit_template_fields()
  7. 7.2 supported/user_import.inc \_user_import_edit_template_fields()
1 call to _user_import_edit_template_fields()
user_import_user_import_form_fieldset in supported/user_import.inc
Implementation of hook_user_import_form_fieldsets(). Add fieldsets to an import settings form.

File

supported/user_import.inc, line 179

Code

function _user_import_edit_template_fields(&$form, $import) {

  // settings template update controls
  if (empty($import['name'])) {

    // new settings template save controls
    $form['save'] = array(
      '#type' => 'fieldset',
      '#title' => t('Save Settings'),
      '#description' => t('Save settings for re-use on other imports.'),
      '#weight' => 90,
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
    );
    $form['save']['name'] = array(
      '#type' => 'textfield',
      '#title' => t('Settings Name'),
      '#size' => 26,
      '#maxlength' => 25,
      '#description' => t('Name to identify these settings by.'),
    );
    $form['save'][] = array(
      '#type' => 'submit',
      '#value' => t('Save'),
      '#validate' => array(
        'user_import_template_has_name_validate',
        'user_import_template_unique_name_validate',
        'user_import_edit_form_validate',
      ),
      '#submit' => array(
        'user_import_template_new_submit',
      ),
    );
  }
  else {
    $form['save'] = array(
      '#type' => 'fieldset',
      '#title' => t('Saved Settings'),
      '#description' => t("If changes have neen made to the settings since they where last saved you can update the saved template, or save them as a new template."),
      '#weight' => 90,
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $form['#current_template'] = $import['name'];
    $form['save']['update'] = array(
      '#type' => 'fieldset',
      '#title' => t('Update'),
      '#description' => t("Update '%name' settings template", array(
        '%name' => $import['name'],
      )),
    );
    $form['save']['update']['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Update'),
      '#validate' => array(
        'user_import_edit_form_validate',
      ),
      '#submit' => array(
        'user_import_template_update_submit',
      ),
    );
    $form['save']['new'] = array(
      '#type' => 'fieldset',
      '#title' => t('Create New'),
      '#description' => t("Save as new settings template"),
    );
    $form['save']['new']['name'] = array(
      '#type' => 'textfield',
      '#title' => t('Save As New'),
      '#size' => 30,
      '#maxlength' => 25,
      '#description' => t('Name to identify these settings by.'),
    );
    $form['save']['new'][] = array(
      '#type' => 'submit',
      '#value' => t('Save As New'),
      '#validate' => array(
        'user_import_template_has_name_validate',
        'user_import_template_unique_name_validate',
        'user_import_edit_form_validate',
      ),
      '#submit' => array(
        'user_import_template_new_submit',
      ),
    );
  }
  return;
}