You are here

function name_admin_settings_form in Name Field 7

Same name and namespace in other branches
  1. 6 name.admin.inc \name_admin_settings_form()

Form builder function for module settings.

1 string reference to 'name_admin_settings_form'
name_menu in ./name.module
Implements hook_menu().

File

./name.admin.inc, line 136
General administration functions.

Code

function name_admin_settings_form($form, &$form_state) {
  $settings = name_settings();
  $form['#validate'][] = 'name_admin_settings_form_validate';
  $form['name_settings'] = array(
    '#tree' => TRUE,
  );
  $form['name_settings']['default_format'] = array(
    '#type' => 'textfield',
    '#title' => t('Default format'),
    '#default_value' => $settings['default_format'],
    '#description' => t('See help on drupal.org for more info.'),
    '#required' => TRUE,
  );
  $form['name_settings']['sep1'] = array(
    '#type' => 'textfield',
    '#title' => t('Separator 1 replacement token'),
    '#default_value' => $settings['sep1'],
  );
  $form['name_settings']['sep2'] = array(
    '#type' => 'textfield',
    '#title' => t('Separator 2 replacement token'),
    '#default_value' => $settings['sep2'],
  );
  $form['name_settings']['sep3'] = array(
    '#type' => 'textfield',
    '#title' => t('Separator 3 replacement token'),
    '#default_value' => $settings['sep3'],
  );

  // As the fieldset does not have the #input flag, this is not saved.
  $form['name_format_help'] = _name_get_name_format_help_form();
  return system_settings_form($form);
}