You are here

function jump_menu_form_block_admin_configure_alter in Better Jump Menus 8

Same name and namespace in other branches
  1. 7 jump_menu.module \jump_menu_form_block_admin_configure_alter()

Implements hook_form_FORM_ID_alter(). Add custom options to block editing forms.

File

./jump_menu.module, line 332
Make use of the CTools jump menu and grabs from an existing menu. See: modules/ctools/includes/jump-menu.inc NOTE: Menu items must be checked as "expanded" for traversing to work.

Code

function jump_menu_form_block_admin_configure_alter(&$form, &$form_state, $form_id) {
  if ($form['module']['#value'] == 'jump_menu') {
    $delta = $form['delta']['#value'];

    // Determine the default value for this block.
    $settings = variable_get('jump_menu_block_settings_show_current', array());
    $default = isset($settings[$delta]) ? $settings[$delta] : JUMP_MENU_DEFAULT_BLOCK_SETTINGS_SHOW_CURRENT;

    // Add jump menu fieldset with options.
    $form['jump_menu_options'] = array(
      '#type' => 'details',
      '#title' => t('Jump Menu'),
      '#weight' => 1,
      'jump_menu_show_current' => array(
        '#type' => 'checkbox',
        '#title' => t('Display Curent Location'),
        '#description' => t('Set the jump menu to the currently active page location.'),
        '#default_value' => $default,
      ),
    );

    // Attach a submit handler to save our preferences.
    $form['#submit'][] = 'jump_menu_block_settings_submit';
  }
}