You are here

function nice_menus_form_alter in Nice Menus 6.2

Same name and namespace in other branches
  1. 5 nice_menus.module \nice_menus_form_alter()
  2. 6 nice_menus.module \nice_menus_form_alter()
  3. 7.3 nice_menus.module \nice_menus_form_alter()
  4. 7.2 nice_menus.module \nice_menus_form_alter()

Implements hook_form_alter().

File

./nice_menus.module, line 31
Module to enable CSS dropdown and flyout menus.

Code

function nice_menus_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {
    case 'system_theme_settings':

      // This is a global setting, so only insert the field
      // on the global settings page.
      if (arg(4) && arg(4) != 'global') {
        return;
      }

      // Have to add a custom submit handler since this form doesn't use
      // the standard system submit handler.
      $form['#submit'][] = 'nice_menus_system_theme_settings_submit';

      // Add global theme setting for a custom CSS file.
      $form['nice_menus_custom_css'] = array(
        '#type' => 'textfield',
        '#title' => t('Path to custom Nice menus CSS file'),
        '#description' => t('To override the default Nice menus CSS layout, enter the path to your custom CSS file.  It should be a relative path from the root of your Drupal install (e.g. sites/all/themes/example/mymenu.css).'),
        '#default_value' => variable_get('nice_menus_custom_css', ''),
        // Field appears below submit buttons without this -- yucky.
        '#weight' => 0,
      );
      break;
  }
}