admin_menu_cache_get

Versions
6
admin_menu_cache_get($cid)

Retrieve a client-side cache hash from cache.

The hash cache is consulted more than once per request; we therefore cache the results statically to avoid multiple database requests.

This should only be used for client-side cache hashes. Use cache_menu for administration menu content.

Parameters

$cid The cache ID of the data to retrieve.

▾ 2 functions call admin_menu_cache_get()

admin_menu_init in contrib-6/admin_menu/admin_menu.module
Implements hook_init().
admin_menu_output in contrib-6/admin_menu/admin_menu.module
Build the administration menu output.

Code

contrib-6/admin_menu/admin_menu.module, line 375

<?php
function admin_menu_cache_get($cid) {
  static $cache = array();

  if (!variable_get('admin_menu_cache_client', TRUE)) {
    return FALSE;
  }
  if (!array_key_exists($cid, $cache)) {
    $cache[$cid] = cache_get($cid, 'cache_admin_menu');
    if ($cache[$cid] && isset($cache[$cid]->data)) {
      $cache[$cid] = $cache[$cid]->data;
    }
  }

  return $cache[$cid];
}
?>

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options