You are here

function theme_authcache_p13n_partial__authcache_ajax in Authenticated User Page Caching (Authcache) 7.2

Theme function for single elements of assemblies.

File

modules/authcache_ajax/authcache_ajax.module, line 114
Inject personalized fragments into cached pages using Ajax calls.

Code

function theme_authcache_p13n_partial__authcache_ajax($variables) {
  $assembly = $variables['assembly'];
  $partial = $variables['partial'];
  $param = $variables['param'];
  $class = $variables['class'];
  $attrs = $variables['attributes'];
  if ($assembly && $partial && $param && $class) {
    drupal_add_js(drupal_get_path('module', 'authcache_p13n') . '/authcache_p13n.js');
    drupal_add_js(drupal_get_path('module', 'authcache_ajax') . '/authcache_ajax.js');
    $attrs['class'][] = $class;
    $attrs['data-p13n-frag'] = $partial;
    $attrs['data-p13n-param'] = $param;
    return '<span ' . drupal_attributes($attrs) . '></span>';
  }
}