You are here

function admin_menu_js_info in Administration menu 7.3

Implements hook_js_info().

File

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

Code

function admin_menu_js_info() {

  // Build dependency list.
  $module_data = system_rebuild_module_data();
  $dependencies = array(
    'devel',
    'filter',
    'user',
  );

  // Ensure the "on behalf of" hooks are available too.
  module_load_include('inc', 'admin_menu', 'admin_menu.map');
  foreach (module_implements('admin_menu_map') as $module) {
    $dependencies[] = $module;
    if (isset($module_data[$module]->requires)) {
      $dependencies += array_keys($module_data[$module]->requires);
    }
  }
  $callbacks['cache'] = array(
    // Admin menu is based on user/role variations and permissions.
    'bootstrap' => DRUPAL_BOOTSTRAP_SESSION,
    'access callback' => 'admin_menu_js_callback_cache_access',
    'delivery callback' => 'admin_menu_js_callback_cache_deliver',
    'dependencies' => array_unique($dependencies),
    'includes' => array(
      'common',
      'path',
      'theme',
      'unicode',
    ),
    // For client side caching to work, the request must be GET.
    'methods' => array(
      'GET',
    ),
    // Do not check for a token via the JS module because both authenticated
    // and anonymous users (potentially) need to be supported.
    // @see admin_menu_js_callback_cache_access()
    'token' => FALSE,
  );
  return $callbacks;
}