You are here

function admin_menu_init in Administration menu 7.3

Same name and namespace in other branches
  1. 6.3 admin_menu.module \admin_menu_init()
  2. 6 admin_menu.module \admin_menu_init()

Implements hook_init().

File

./admin_menu.module, line 11
Render an administrative menu as a dropdown menu at the top of the window.

Code

function admin_menu_init() {
  $hide = FALSE;
  $current_path = current_path();
  $custom_paths = variable_get('admin_menu_exclude_paths', '');
  if ($custom_paths != '') {
    $custom_paths = explode(PHP_EOL, $custom_paths);
    foreach ($custom_paths as $path) {
      $path = trim($path);
      if (drupal_match_path($current_path, $path . '/*') || drupal_match_path($current_path, $path) || drupal_match_path(drupal_get_path_alias($current_path), $path)) {
        $hide = TRUE;
        break;
      }
    }
  }
  if ($hide) {
    module_invoke('admin_menu', 'suppress');
  }
}