You are here

function nice_menus_admin_settings in Nice Menus 7.2

Same name and namespace in other branches
  1. 5 nice_menus.module \nice_menus_admin_settings()
  2. 6.2 nice_menus.admin.inc \nice_menus_admin_settings()
  3. 6 nice_menus.admin.inc \nice_menus_admin_settings()
  4. 7.3 nice_menus.admin.inc \nice_menus_admin_settings()

Settings form as implemented by hook_menu.

1 string reference to 'nice_menus_admin_settings'
nice_menus_menu in ./nice_menus.module
Implements hook_menu().

File

./nice_menus.admin.inc, line 11
Functionality for Nice Menus administration.

Code

function nice_menus_admin_settings($form, &$form_state) {

  // Number of Nice Menus blocks.
  $form['nice_menus_number'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of Nice Menus blocks'),
    '#description' => t('The total number of independent Nice menus blocks you want. Enter a number between 0 and 99. If you set this to 0, you will have no blocks created but you can still use the Nice menus theme functions directly in your theme.'),
    '#default_value' => variable_get('nice_menus_number', 2),
    '#size' => 2,
    '#title_display' => 'invisible',
    '#maxlength' => 2,
  );

  // Disable default css(css/nice_menus_default.css).
  $form['nice_menud_disable_default_css'] = array(
    '#type' => 'checkbox',
    '#title' => t('Disable default css'),
    '#description' => t('This will disable loaded the css/nice_menus_default.css.'),
    '#default_value' => variable_get('nice_menud_disable_default_css', FALSE),
  );

  // Use JavaScript configuration setting.
  $form['nice_menus_js'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use JavaScript'),
    '#description' => t('This will add Superfish jQuery to Nice menus. This is required for Nice menus to work properly in Internet Explorer.'),
    '#default_value' => variable_get('nice_menus_js', TRUE),
  );
  $form['nice_menus_sf_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Advanced: Superfish options'),
    '#description' => t('You can change the default Superfish options by filling out the desired values here. These only take effect if the Use JavaScript box above is checked.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );

  // Mouse delay textfield for the time before the menus is closed.
  $form['nice_menus_sf_options']['nice_menus_sf_delay'] = array(
    '#type' => 'textfield',
    '#title' => t('Mouse delay'),
    '#description' => t('The delay in milliseconds that the mouse can remain outside a submenu without it closing.'),
    '#default_value' => variable_get('nice_menus_sf_delay', 800),
    '#size' => 5,
  );

  // Display speed of the animation for the menu to open/close.
  $form['nice_menus_sf_options']['nice_menus_sf_speed'] = array(
    '#type' => 'select',
    '#title' => t('Animation speed'),
    '#description' => t('Speed of the menu open/close animation.'),
    '#options' => array(
      'slow' => t('slow'),
      'normal' => t('normal'),
      'fast' => t('fast'),
    ),
    '#default_value' => variable_get('nice_menus_sf_speed', 'normal'),
  );

  // Custom validation to make sure the user is entering numbers.
  $form['#validate'][] = 'nice_menus_settings_validate';
  return system_settings_form($form);
}