function gotwo_admin_settings_form in Go - url redirects 6
Same name and namespace in other branches
- 7 gotwo.admin.inc \gotwo_admin_settings_form()
Implementation of hook_settings().
1 string reference to 'gotwo_admin_settings_form'
- gotwo_menu in ./
gotwo.module - Implementation of hook_menu().
File
- ./
gotwo.admin.inc, line 11 - Administrative page callbacks for the gotwo module.
Code
function gotwo_admin_settings_form() {
$form['gotwo_filter_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Global filter configuration'),
);
$form['gotwo_filter_settings']['gotwo_numeric'] = array(
'#type' => 'checkbox',
'#title' => t('Numerical url'),
'#description' => t('Use numbers instead of a human readable URL. Use "go/1234" instead of "go/some/location".'),
'#default_value' => variable_get('gotwo_numeric', FALSE),
);
$form['gotwo_filter_settings']['gotwo_separator'] = array(
'#type' => 'select',
'#title' => t('URL separator'),
'#description' => t('All spaces in titles can be replaced with an underscore or hyphen. If set to "-", an title of "Lorem ipsum dolor" becomes an URL of "Lorem-ipsum-dolor".'),
'#default_value' => variable_get('gotwo_separator', '-'),
'#options' => array(
'-' => t('Hyphen (-)'),
'_' => t('Underscore (_)'),
),
);
$form['gotwo_filter_settings']['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['disclaimer'] = array(
'#type' => 'fieldset',
'#title' => t('Disclaimer settings'),
);
$form['disclaimer']['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),
);
$form['disclaimer']['gotwo_disclaimer_title'] = array(
'#type' => 'textfield',
'#title' => t('Disclaimer page title'),
'#description' => t('The page title that is shown on the disclaimer page.'),
'#default_value' => variable_get('gotwo_disclaimer_title', 'Disclaimer'),
);
$form['disclaimer']['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', ''),
);
$form['disclaimer']['gotwo_disclaimer_time'] = array(
'#type' => 'select',
'#title' => t('Disclaimer timeout'),
'#options' => drupal_map_assoc(array(
0,
1,
2,
3,
4,
5,
10,
15,
30,
45,
60,
)),
'#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),
);
return system_settings_form($form);
}