You are here

function advanced_menu_blocks_form_alter in Advanced Menu 7

Implementation of hook_form_alter().

File

blocks/advanced_menu_blocks.module, line 70
Provides block customization settings for menus.

Code

function advanced_menu_blocks_form_alter(&$form, $form_state, $form_id) {
  $menu = $form;
  switch ($form_id) {
    case 'menu_edit_menu':
      if (user_access('administer advanced menu blocks')) {
        $form['submit']['#weight'] = 2;
        $form['blocks'] = array(
          '#type' => 'checkboxes',
          '#title' => t('Block Visibility'),
          '#default_value' => _advanced_menu_blocks_disabled($form['menu_name']['#default_value']),
          '#options' => array(
            '1' => 'Disable the block for this menu.',
          ),
          '#description' => t('Menus which have their block disabled will not be shown on the Blocks Administration page and will not be displayed.'),
          '#weight' => 1,
        );
        $form['#submit'][] = 'advanced_menu_blocks_form_submit';
      }
      break;
  }
}