You are here

function authcache_menu_preprocess_toolbar in Authenticated User Page Caching (Authcache) 7.2

Implements hook_preprocess_toolbar().

File

modules/authcache_menu/authcache_menu.module, line 78
Authcache support for menu, tabs and local actions.

Code

function authcache_menu_preprocess_toolbar(&$variables) {
  foreach (element_children($variables['toolbar']['toolbar_drawer']) as $key) {
    if (isset($variables['toolbar']['toolbar_drawer'][$key]['shortcuts']) && function_exists('shortcut_set_switch_access') && shortcut_set_switch_access() && !authcache_element_is_cacheable($variables['toolbar']['toolbar_drawer'][$key]['shortcuts'])) {
      authcache_p13n_attach($variables['toolbar']['toolbar_drawer'][$key]['shortcuts'], array(
        '#theme' => 'authcache_p13n_fragment',
        '#fragment' => 'menu-toolbar-shortcuts',
        '#fallback' => 'cancel',
      ));
      authcache_element_set_cacheable($variables['toolbar']['toolbar_drawer'][$key]['shortcuts']);
    }
  }
}