You are here

function _navbar_get_subtree_hash in Navbar 7

Returns the hash of the per-user rendered navbar subtrees.

1 call to _navbar_get_subtree_hash()
_navbar_subtrees_access in ./navbar.module
Access callback: Returns if the user has access to the rendered subtree requested by the hash.

File

./navbar.module, line 1097
Administration navbar for quick access to top level administration items.

Code

function _navbar_get_subtree_hash() {
  global $user;
  $cid = $user->uid . ':' . language(LANGUAGE_TYPE_INTERFACE)->langcode;
  if ($cache = cache('navbar')
    ->get($cid)) {
    $hash = $cache->data;
  }
  else {
    $subtrees = navbar_get_rendered_subtrees();
    $hash = drupal_hash_base64(serialize($subtrees));
    cache('navbar')
      ->set($cid, $hash);
  }
  return $hash;
}