admin_menu_form_alter

Versions
5
admin_menu_form_alter($form_id, &$form)

Implementation of hook_form_alter().

Extends Devel module with Administration Menu developer settings.

Code

contributions/admin_menu/admin_menu.module, line 371

<?php
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.'),
    );
  }
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.