function gotwo_admin_settings_form in Go - url redirects 7
Same name and namespace in other branches
- 6 gotwo.admin.inc \gotwo_admin_settings_form()
Implements hook_settings().
1 string reference to 'gotwo_admin_settings_form'
- gotwo_menu in ./
gotwo.module - Implements hook_menu().
File
- ./
gotwo.admin.inc, line 11 - Administrative page callbacks for the gotwo module.
Code
function gotwo_admin_settings_form($form, &$form_state) {
$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),
);
$transliterate_dependencies = '<div class="admin-dependencies">';
$transliterate_dependencies .= t('Depends on: !dependencies', array(
'!dependencies' => module_exists('transliteration') ? t('@module (<span class="admin-enabled">enabled</span>)', array(
'@module' => 'Transliteration',
)) : t('@module (<span class="admin-disabled">disabled</span>)', array(
'@module' => 'Transliteration',
)),
));
$transliterate_dependencies .= '</div>';
$form['gotwo_filter_settings']['gotwo_transliteration'] = array(
'#type' => 'checkbox',
'#title' => t('Transliterate URLs'),
'#description' => t('Enables <a href="!url">transliteration</a> of URLs. Generally spoken, it takes Unicode text and tries to represent it in US-ASCII characters (universally displayable, unaccented characters) by attempting to transliterate the pronunciation expressed by the text in some other writing system to Roman letters.', array(
'!url' => 'http://drupal.org/project/transliteration',
)) . $transliterate_dependencies,
'#default_value' => variable_get('gotwo_transliteration', TRUE),
'#disabled' => module_exists('transliteration') ? FALSE : TRUE,
);
$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' => variable_get('gotwo_max_length', 128),
'#element_validate' => array(
'_gotwo_element_max_length_validate',
),
'#size' => 10,
);
$form['disclaimer'] = array(
'#type' => 'fieldset',
'#title' => t('Disclaimer settings'),
);
$form['disclaimer']['gotwo_disclaimer_boolean'] = array(
'#type' => 'checkbox',
'#title' => t('Add 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 = Number 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),
'#field_suffix' => t('seconds'),
);
return system_settings_form($form);
}