You are here

function rename_admin_paths_settings in Rename Admin Paths 7.2

Same name and namespace in other branches
  1. 7 rename_admin_paths.module \rename_admin_paths_settings()

Settings form().

1 string reference to 'rename_admin_paths_settings'
rename_admin_paths_menu in ./rename_admin_paths.module
Implements hook_menu().

File

./rename_admin_paths.module, line 191
Allows users to rename admin paths

Code

function rename_admin_paths_settings() {
  $form = array();
  $form['rename_admin_path'] = array(
    '#type' => 'fieldset',
    '#title' => t('Rename admin path'),
  );
  $form['rename_admin_path']['rename_admin_path'] = array(
    '#type' => 'checkbox',
    '#title' => t('Rename admin path'),
    '#default_value' => variable_get('rename_admin_path', NULL),
    '#description' => t('If checked, "admin" will be replaced by the following term in admin path.'),
  );
  $form['rename_admin_path']['rename_admin_path_value'] = array(
    '#type' => 'textfield',
    '#title' => t('Replace "admin" in admin path by'),
    '#default_value' => variable_get('rename_admin_path_value', 'backend'),
    '#description' => t('This value will replace "admin" in admin path.'),
    '#element_validate' => array(
      'rename_admin_paths_form_validate_path_field',
    ),
  );
  $form['rename_user_path'] = array(
    '#type' => 'fieldset',
    '#title' => t('Rename user path'),
  );
  $form['rename_user_path']['rename_user_path'] = array(
    '#type' => 'checkbox',
    '#title' => t('Rename user path'),
    '#default_value' => variable_get('rename_user_path', NULL),
    '#description' => t('If checked, "user" will be replaced by the following term in user path.'),
    '#element_validate' => array(
      'rename_admin_paths_form_validate_path_field',
    ),
  );
  $form['rename_user_path']['rename_user_path_value'] = array(
    '#type' => 'textfield',
    '#title' => t('Replace "user" in user path by'),
    '#default_value' => variable_get('rename_user_path_value', 'member'),
    '#description' => t('This value will replace "user" in user path.'),
    '#element_validate' => array(
      'rename_admin_paths_form_validate_path_field',
    ),
  );
  $form['#submit'][] = 'rename_admin_paths_settings_submit';
  return system_settings_form($form);
}