You are here

function selectmenu_admin_form in jQuery UI selectmenu 7

Same name and namespace in other branches
  1. 7.2 selectmenu.admin.inc \selectmenu_admin_form()

Admin form

1 string reference to 'selectmenu_admin_form'
selectmenu_menu in ./selectmenu.module
Implements hook_menu().

File

./selectmenu.admin.inc, line 6

Code

function selectmenu_admin_form($form_state) {
  $form = array();
  $form['selectmenu_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable jQuery UI seletmenu'),
    '#default_value' => variable_get('selectmenu_enabled', TRUE),
    '#description' => t('Use this option to toggle jQuery UI selectmenu on and off globally.'),
  );
  $form['selectmenu_css_whitelist'] = array(
    '#type' => 'textarea',
    '#title' => t('Whitelist: CSS selectors to include'),
    '#description' => t('Enter the CSS selectors of the select fields to apply jQuery Selectmenu to. This option SUPERCEDES all other rules on this page.'),
    '#rows' => 3,
    '#cols' => 40,
    '#default_value' => variable_get('selectmenu_css_whitelist', '#example-div .something span select'),
  );
  $form['selectmenu_form_id_exceptions'] = array(
    '#type' => 'textarea',
    '#title' => t('Blacklist: form CSS IDs to ignore'),
    '#description' => t('Enter the CSS IDs of the forms to not enable jQuery UI selectmenu on. One per line. Do not include the hash symbol, ie: "my-form-id" and not "#my-form-id"'),
    '#rows' => 3,
    '#cols' => 40,
    '#default_value' => variable_get('selectmenu_form_id_exceptions', ''),
  );
  $form['selectmenu_ignore_system_settings_forms'] = array(
    '#type' => 'checkbox',
    '#title' => t('Ignore system settings forms'),
    '#description' => t('Do not use jQuery UI selectmenu for Drupal system settings form.'),
    '#default_value' => variable_get('selectmenu_ignore_system_settings_forms', TRUE),
  );
  $form['selectmenu_ignore_overlay_forms'] = array(
    '#type' => 'checkbox',
    '#title' => t('Ignore forms inside Overlay'),
    '#description' => t('Do not use jQuery UI selectmenu for forms that are inside of the Drupal 7 Overlay.'),
    '#default_value' => variable_get('selectmenu_ignore_overlay_forms', TRUE),
  );
  $form['selectmenu_ignore_node_add_forms'] = array(
    '#type' => 'checkbox',
    '#title' => t('Ignore node add forms'),
    '#description' => t('Do not use jQuery UI selectmenu for Drupal node add forms.'),
    '#default_value' => variable_get('selectmenu_ignore_node_add_forms', TRUE),
  );
  $form['selectmenu_disable_for_admin_theme'] = array(
    '#type' => 'checkbox',
    '#title' => t('Disable selectmenu for admin theme'),
    '#description' => t('Do not use jQuery UI selectmenu for any page that is using the admin theme set in Appearance settings. Only check this box if the site theme is different from the admin theme. Otherwise selectmenu will be disabled throughout the site.'),
    '#default_value' => variable_get('selectmenu_disable_for_admin_theme', FALSE),
  );

  // Script options fieldset.
  $selectmenu_script_options = variable_get('selectmenu_script_options', array());
  $form['selectmenu_script_options'] = array(
    '#type' => 'fieldset',
    '#tree' => TRUE,
    '#title' => t('jQuery UI Selectmenu script options'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['selectmenu_script_options']['width'] = array(
    '#type' => 'textfield',
    '#size' => 10,
    '#field_suffix' => 'px',
    '#default_value' => empty($selectmenu_script_options['width']) ? '' : $selectmenu_script_options['width'],
    '#title' => t('width'),
  );
  $form['selectmenu_script_options']['maxHeight'] = array(
    '#type' => 'textfield',
    '#size' => 10,
    '#field_suffix' => 'px',
    '#default_value' => empty($selectmenu_script_options['maxHeight']) ? '' : $selectmenu_script_options['maxHeight'],
    '#title' => t('maxHeight'),
  );
  return system_settings_form($form);
}