You are here

function authcache_views_views_post_render in Authenticated User Page Caching (Authcache) 7.2

Implements hook_views_post_render().

File

modules/authcache_views/authcache_views.module, line 105
Authcache support for views module.

Code

function authcache_views_views_post_render(&$view, &$output, &$cache) {
  if (authcache_page_is_cacheable()) {
    $config = _authcache_views_view_get_options($view, $view->current_display);
    if (!empty($config['status'])) {
      $fragment_id = "views/{$view->name}/{$view->current_display}";
      $fragment = array(
        '#theme' => 'authcache_p13n_fragment',
        '#fragment' => $fragment_id,
        '#clients' => $config['clients'],
        '#fallback' => $config['fallback'],
      );
      $element = array(
        '#markup' => $output,
      );
      authcache_p13n_attach($element, $fragment);
      $output = render($element);
    }
  }
}