You are here

function template_preprocess_authcache_p13n_partial in Authenticated User Page Caching (Authcache) 7.2

Preprocess a placeholder for a part of an assembly.

Related topics

File

modules/authcache_p13n/authcache_p13n.module, line 310
Provides methods for serving personalized content fragments.

Code

function template_preprocess_authcache_p13n_partial(&$variables) {
  $partial = $variables['partial'];
  $assembly = $variables['assembly'];
  $param = $variables['param'];
  $clients = $variables['clients'];
  $client = authcache_p13n_client_get_preferred('assembly', $assembly, $clients);
  if ($client && strlen($partial) && strlen($assembly)) {
    $exists = authcache_p13n_request_exists('asm/' . $assembly);
  }
  if (!empty($exists)) {
    $variables['theme_hook_suggestions'][] = 'authcache_p13n_partial__' . $client;
    $variables['theme_hook_suggestions'][] = 'authcache_p13n_partial__' . $client . '__' . preg_replace('/_{2,}/', '_', preg_replace('/[^0-9a-z]/i', '_', $assembly));
    $variables['client'] = $client;
    $variables['class'] = drupal_html_class('authcache-p13n-asm-' . $assembly);
    authcache_p13n_add_partial($assembly, $partial, $param);
  }
}