You are here

function path_redirect_settings_form in Path redirect 6

Form builder; administrative settings for the module.

See also

system_settings_form()

1 string reference to 'path_redirect_settings_form'
path_redirect_menu in ./path_redirect.module
Implements hook_menu().

File

./path_redirect.admin.inc, line 496
Administrative page callbacks for the path_redirect module.

Code

function path_redirect_settings_form() {
  $form['path_redirect_redirect_warning'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display a warning message to users when they are redirected.'),
    '#default_value' => variable_get('path_redirect_redirect_warning', 0),
  );
  $form['path_redirect_allow_bypass'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow users to bypass redirects by adding %code to the URL.', array(
      '%code' => variable_get('clean_url', 0) ? '?redirect=no' : '&redirect=no',
    )),
    '#default_value' => variable_get('path_redirect_allow_bypass', 0),
  );
  $form['path_redirect_auto_redirect'] = array(
    '#type' => 'checkbox',
    '#title' => t('Automatically create redirects when URL aliases are changed.'),
    '#default_value' => variable_get('path_redirect_auto_redirect', 1),
    '#access' => module_exists('path'),
  );
  $form['path_redirect_purge_inactive'] = array(
    '#type' => 'select',
    '#title' => t('Discard redirects that have not been accessed for'),
    '#default_value' => variable_get('path_redirect_purge_inactive', 0),
    '#options' => array(
      0 => t('Never (do not discard)'),
    ) + drupal_map_assoc(array(
      604800,
      1209600,
      2419200,
      4838400,
      7257600,
      9676800,
      31536000,
    ), 'format_interval'),
  );
  $form['path_redirect_default_status'] = array(
    '#type' => 'select',
    '#title' => t('Default redirect status'),
    '#description' => t('You can find more information about HTTP redirect status codes at <a href="@status-codes">@status-codes</a>.', array(
      '@status-codes' => 'http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection',
    )),
    '#default_value' => variable_get('path_redirect_default_status', 301),
    '#options' => path_redirect_status_code_options(),
  );
  return system_settings_form($form);
}