You are here

function admin_menu_form_alter in Administration menu 5.2

Same name and namespace in other branches
  1. 8.3 admin_menu.module \admin_menu_form_alter()
  2. 5.3 admin_menu.inc \admin_menu_form_alter()
  3. 5 admin_menu.module \admin_menu_form_alter()
  4. 7.3 admin_menu.module \admin_menu_form_alter()

Implementation of hook_form_alter().

Extends Devel module with Administration Menu developer settings.

File

./admin_menu.module, line 413
Renders a menu tree for administrative purposes as dropdown menu at the top of the window.

Code

function admin_menu_form_alter($form_id, &$form) {
  if ($form_id == 'devel_admin_settings') {

    // Shift system_settings_form buttons.
    $weight = $form['buttons']['#weight'];
    $form['buttons']['#weight'] = $weight + 1;
    $form['admin_menu'] = array(
      '#type' => 'fieldset',
      '#title' => t('Administration Menu settings'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $display_options = array(
      'mid',
      'weight',
      'pid',
    );
    $display_options = array(
      0 => t('None'),
      'mid' => t('Id'),
      'weight' => t('Weight'),
      'pid' => t('Parent id'),
    );
    $form['admin_menu']['admin_menu_display'] = array(
      '#type' => 'radios',
      '#title' => t('Display extra information for menu items in Drupal Administration Menu'),
      '#default_value' => variable_get('admin_menu_display', 0),
      '#options' => $display_options,
      '#description' => t('If enabled, the chosen information will appear next to each menu item link.'),
    );
    $form['admin_menu']['admin_menu_show_all'] = array(
      '#type' => 'checkbox',
      '#title' => t('Display all menu items'),
      '#default_value' => variable_get('admin_menu_show_all', 0),
      '#description' => t('Enable this option to disable user access checks for menu items, i.e. every menu item in the visible menu tree will be displayed to every user regardless of access permissions.'),
    );
  }
}