You are here

function gotwo_admin_settings in Go - url redirects 5

Implementation of hook_settings

1 string reference to 'gotwo_admin_settings'
gotwo_menu in ./gotwo.module
Implementation of hook_menu

File

./gotwo.module, line 346
Module that provides easy to use redirection links. A redirection link would be like: http://examples.org/go/a_label http://examples.org/go/123546 http://examples.org/go/or/like/this

Code

function gotwo_admin_settings() {
  $form['gotwo_numeric'] = array(
    '#type' => 'checkbox',
    '#title' => t('Numerical urls'),
    '#description' => t('Use numbers instead of a more friendlier url. "go/1234" instead of "go/some/location".'),
    '#default_value' => variable_get('gotwo_numeric', false),
  );
  $form['gotwo_max_length'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum length of target labels'),
    '#description' => t('Target labels are the parts after the "go/" part of the shown url. The absolute maximum is 128.'),
    '#default_value' => min(variable_get('gotwo_max_length', 128), 128),
    '#size' => 10,
  );
  $form['gotwo_disclaimer_boolean'] = array(
    '#type' => 'checkbox',
    '#title' => t('Disclaimer'),
    '#description' => t('Check to add a disclaimer before redirecting to the Gotwo links'),
    '#default_value' => variable_get('gotwo_disclaimer_boolean', false),
  );
  $gotwo_time = array(
    0 => 0,
    1 => 1,
    2 => 2,
    3 => 3,
    4 => 4,
    5 => 5,
    10 => 10,
    15 => 15,
    30 => 30,
    45 => 45,
    60 => 60,
  );
  $form['gotwo_disclaimer_time'] = array(
    '#type' => 'select',
    '#title' => t('# of seconds until refresh'),
    '#options' => $gotwo_time,
    '#description' => t('Number of seconds until the page will be redirected to the requested URL, 0 means no refresh'),
    '#default_value' => variable_get('gotwo_disclaimer_time', 0),
  );
  $form['gotwo_disclaimer_text'] = array(
    '#type' => 'textarea',
    '#title' => t('Disclaimer Text'),
    '#description' => t('The disclaimer that will be presented to the user before they are redirected<br><strong>Variables available:</strong><br> %url = url to be redirected to <br>%seconds = # of seconds until page redirects'),
    '#default_value' => variable_get('gotwo_disclaimer_text', ''),
  );
  return system_settings_form($form);
}