You are here

function popup_menu_form_alter in Popup 8

Same name and namespace in other branches
  1. 7 modules/popup_menu/popup_menu.module \popup_menu_form_alter()
  2. 7.x modules/popup_menu/popup_menu.module \popup_menu_form_alter()

Implementation of hook_form_alter Adds UI settings to block configuration

File

modules/popup_menu/popup_menu.module, line 78

Code

function popup_menu_form_alter(&$form, $form_state, $form_id) {

  //  dpm($form);
  if ($form_id == 'block_admin_configure' && $form['module']['#value'] == 'popup_menu') {
    $form['display_title'] = array(
      '#type' => 'item',
      '#title' => 'Display settings',
      '#weight' => 1,
    );
    $form['regions'] = array(
      '#type' => 'vertical_tabs',
      '#weight' => 2,
      '#attached' => array(
        'js' => array(
          'modules/block/block.js',
        ),
      ),
      'regions' => $form['regions'],
      'popup' => array(
        '#type' => 'fieldset',
        '#title' => t('Popup settings'),
        '#collapsible' => 0,
        '#group' => 'Display',
        'popup-format' => $form['settings']['popup-format'],
        'popup-override-title' => $form['settings']['popup-override-title'],
      ),
    );
    $form['settings']['#weight'] = 0;
    $form['visibility_title']['#weight'] = 3;
    $form['visibility']['#weight'] = 4;
    $form['submit']['#weight'] = 10;
    unset($form['settings']['popup-format']);
    unset($form['settings']['popup-override-title']);
  }
}