You are here

function authcache_panels_panels_pane_content_alter in Authenticated User Page Caching (Authcache) 7.2

Implements hook_panels_pane_content_alter().

File

modules/authcache_panels/authcache_panels.module, line 50
Authcache support for Panels.

Code

function authcache_panels_panels_pane_content_alter($content, $pane, $args, $context, $renderer, $display) {
  if ($content && authcache_page_is_cacheable() && authcache_panels_pane_fragment_enabled($pane)) {
    $config = _authcache_panels_pane_get_options($pane);
    $fragment = array(
      '#theme' => 'authcache_p13n_fragment',
      '#fragment' => authcache_panels_pane_fragment_id($pane),
      '#clients' => $config['clients'],
      '#fallback' => $config['fallback'],
    );
    if (!is_array($content->content)) {
      $markup = !empty($content->content) ? $content->content : '';
      $content->content = array(
        '#markup' => $markup,
      );
    }
    authcache_p13n_attach($content->content, $fragment);
  }
}