function mobile_switch_advanced_settings_form in Mobile Switch 6
Same name and namespace in other branches
- 7.2 includes/mobile_switch.admin.inc \mobile_switch_advanced_settings_form()
- 7 includes/mobile_switch.admin.inc \mobile_switch_advanced_settings_form()
Form constructor for the Advanced settings form.
1 string reference to 'mobile_switch_advanced_settings_form'
- mobile_switch_menu in ./
mobile_switch.module - Implementation of hook_menu().
File
- includes/
mobile_switch.admin.inc, line 58 - Administrative page callbacks for the Mobile Switch module.
Code
function mobile_switch_advanced_settings_form() {
if (variable_get('browscap_version', 0) == 0) {
return mobile_switch_browscap_message();
}
if (variable_get('mobile_switch_mobile_theme', 'none') === 'none') {
return mobile_switch_theme_message();
}
$module_path = drupal_get_path('module', 'mobile_switch');
drupal_add_js($module_path . '/js/mobile_switch.admin.js', 'module', 'footer');
$form['preventing'] = array(
'#type' => 'fieldset',
'#title' => t('Preventing'),
'#description' => t('Prevention of mobile devices. This allows to bypass mobile devices the automatic switching to the mobile theme.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#weight' => -5,
);
$form['preventing']['mobile_switch_prevent_devices'] = array(
'#type' => 'select',
'#title' => t('Use preventing'),
'#options' => array(
FALSE => t('No'),
TRUE => t('Yes'),
),
'#default_value' => variable_get('mobile_switch_prevent_devices', 0),
);
$description['mobile_switch_prevent_devices_strings'] = t("Configure user agent string parts. Use letters, single white spaces or underscores - no other characters! Do not use the '*' wildcard character! Enter one string per line. Example string parts: <pre>htc_flyer\niPad\nSony Tablet S\nXOOM</pre> The string detection is case insensitive.");
$description['mobile_switch_prevent_devices_strings'] .= ' ' . t('Get a user agent string: In the !development-settings under <em>Developer modus</em> -> <em>Advanced developer modus settings</em> use the <em>Display user agent</em> option.', array(
'!development-settings' => l(t('Development settings'), 'admin/settings/mobile-switch/development'),
));
$form['preventing']['mobile_switch_prevent_devices_strings'] = array(
'#type' => 'textarea',
'#title' => t('Mobile devices identification for preventing'),
'#description' => $description['mobile_switch_prevent_devices_strings'],
'#default_value' => variable_get('mobile_switch_prevent_devices_strings', ''),
'#required' => FALSE,
'#element_validate' => array(
'_mobile_switch_prevent_devices_strings_validate',
),
);
$form['#submit'][] = 'mobile_switch_settings_form_submit';
return system_settings_form($form);
}