function jquerymobile_admin_settings in jQuery Mobile module 7.2
Form builder; Configure user settings for this site.
See also
1 string reference to 'jquerymobile_admin_settings'
- jquerymobile_menu in ./
jquerymobile.module - Implements hook_menu().
File
- ./
jquerymobile.admin.inc, line 14 - Admin settings for the jquerymobile module.
Code
function jquerymobile_admin_settings() {
/* GLOBAL SETTINGS */
$form['jquerymobile'] = array(
'#type' => 'fieldset',
'#title' => t('Global Settings'),
'#collapsible' => FALSE,
'#access' => user_access('manage jquerymobile theme settings'),
);
$form['jquerymobile']['jquerymobile_mobile_themes'] = array(
'#type' => 'checkboxes',
'#title' => t('Mobile Theme'),
'#options' => _jquerymobile_get_theme_list(),
'#default_value' => variable_get('jquerymobile_mobile_themes', array()),
'#description' => t('Select which theme will use these settings.'),
'#multiple' => TRUE,
'#size' => min(5, count(variable_get('jquerymobile_mobile_themes', array()))),
);
/* FILE SETTINGS */
$form['jquerymobile']['file_settings'] = array(
'#type' => 'fieldset',
'#title' => t('File Settings'),
'#collapsible' => FALSE,
'#access' => user_access('manage jquerymobile files settings'),
);
$form['jquerymobile']['file_settings']['jquerymobile_minify'] = array(
'#type' => 'checkbox',
'#title' => t('Use minified versions (recommended for production).'),
'#options' => array(
FALSE,
TRUE,
),
'#default_value' => variable_get('jquerymobile_minify', FALSE),
);
$form['jquerymobile']['file_settings']['jquerymobile_server_type'] = array(
'#type' => 'radios',
'#title' => t('Where are the framework files located?'),
'#options' => array(
'local' => t('Local (sites/all/libraries)'),
'hosted' => t('Hosted (http://code.jquery.com)'),
'other' => t('Other'),
),
'#default_value' => variable_get('jquerymobile_server_type', 'local'),
);
$form['jquerymobile']['file_settings']['jquerymobile_jquerymobile_version'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('jquerymobile_jquerymobile_version', '1.0.1'),
'#title' => t('jQuery Mobile Version'),
'#description' => t('Enter the version of the jQuery library to use. <i>ex: jquerymobile-1.0.1 = 1.0.1</i><br /><b>Default: </b>1.0.1'),
);
$form['jquerymobile']['file_settings']['jquerymobile_jquery_version'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('jquerymobile_jquery_version', '1.6.4'),
'#title' => t('jQuery Version'),
'#description' => t('Enter the version of the jQuery library to use. <i>ex: jquery-1.6.4 = 1.6.4</i><br /><b>Default: </b>1.6.4'),
);
$form['jquerymobile']['file_settings']['jquerymobile_jquery_files_path'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('jquerymobile_jquery_files_path', NULL),
'#title' => t('Other jQuery Mobile File Location'),
'#description' => t('Enter the location where the jquery files are hosted (no trailing slashes).'),
'#states' => array(
'visible' => array(
':input[name="jquerymobile_server_type"]' => array(
'value' => 'other',
),
),
),
);
$form['jquerymobile']['file_settings']['jquerymobile_jqm_files_path'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('jquerymobile_jqm_files_path', NULL),
'#title' => t('Other jQuery File Location'),
'#description' => t('Enter the location where the jquerymobile files are hosted (no trailing slashes).'),
'#states' => array(
'visible' => array(
':input[name="jquerymobile_server_type"]' => array(
'value' => 'other',
),
),
),
);
$form['jquerymobile']['file_settings']['jquerymobile_library_path'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('jquerymobile_library_path', 'sites/all/libraries'),
'#title' => t('Local File Location'),
'#description' => t('Enter the location where the jquery and jquerymobile files are hosted (no trailing slashes).'),
'#states' => array(
'visible' => array(
':input[name="jquerymobile_server_type"]' => array(
'value' => 'local',
),
),
),
);
$form['#submit'][] = 'jquerymobile_admin_settings_submit';
return system_settings_form($form);
}