You are here

function nice_menus_variable_info in Nice Menus 7.3

Same name and namespace in other branches
  1. 7.2 nice_menus.variable.inc \nice_menus_variable_info()

Implements hook_variable_info().

File

./nice_menus.variable.inc, line 11
Definition of Nice Menus variables for Variable API module.

Code

function nice_menus_variable_info($options) {

  // Nice Menus defaults settings.
  $defaults = array(
    'group' => 'nice_menus',
    'localize' => TRUE,
    'multidomain' => TRUE,
  );

  // Number of Nice Menus blocks.
  $variables['nice_menus_number'] = array(
    'type' => 'string',
    'title' => t('Number of Nice Menus blocks', array(), $options),
    'default' => variable_get('nice_menus_number', 2),
    'element' => array(
      '#size' => 2,
      '#title_display' => 'invisible',
      '#maxlength' => 2,
    ),
    '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.'),
    // Validate callback to ensure the value submitted is lower than 100.
    'validate callback' => 'nice_menus_validate_nice_menus_number',
  ) + $defaults;

  // Use JavaScript configuration setting.
  $variables['nice_menus_js'] = array(
    'type' => 'boolean',
    'title' => t('Use JavaScript'),
    'default' => variable_get('nice_menus_js', TRUE),
    'description' => t('This will add Superfish jQuery to Nice menus. This is required for Nice menus to work properly in Internet Explorer.'),
  ) + $defaults;

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

  // Display speed of the animation for the menu to open/close.
  $variables['nice_menus_sf_speed'] = array(
    'type' => 'select',
    'title' => t('Animation speed'),
    'default' => variable_get('nice_menus_sf_speed', 'normal'),
    'description' => t('Speed of the menu open/close animation.'),
    'options' => array(
      'slow' => t('slow'),
      'normal' => t('normal'),
      'fast' => t('fast'),
    ),
    'element' => array(
      '#type' => 'select',
    ),
  ) + $defaults;
  return $variables;
}