function _toolbar_get_subtree_hash

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

1 call to _toolbar_get_subtree_hash()
_toolbar_subtrees_access in drupal/core/modules/toolbar/toolbar.module
Access callback: Returns if the user has access to the rendered subtree requested by the hash.

File

drupal/core/modules/toolbar/toolbar.module, line 516
Administration toolbar for quick access to top level administration items.

Code

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