You are here

function template_preprocess_authcache_p13n_assembly in Authenticated User Page Caching (Authcache) 7.2

Preprocess a placeholder for a personalized assembly.

Related topics

File

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

Code

function template_preprocess_authcache_p13n_assembly(&$variables) {
  $assembly = $variables['assembly'];
  $param = $variables['param'];
  $clients = $variables['clients'];
  $client = authcache_p13n_client_get_preferred('assembly', $assembly, $clients);
  if ($client && strlen($assembly)) {
    _authcache_p13n_array_unique_recursive($param);
    $url = authcache_p13n_request_get_callback('asm/' . $assembly, $param);
  }
  if (!empty($url)) {
    $variables['theme_hook_suggestions'][] = 'authcache_p13n_assembly__' . $client;
    $variables['theme_hook_suggestions'][] = 'authcache_p13n_assembly__' . $client . '__' . preg_replace('/_{2,}/', '_', preg_replace('/[^0-9a-z]/i', '_', $assembly));
    $variables['client'] = $client;
    $variables['url'] = $url;
    $variables['class'] = drupal_html_class('authcache-p13n-asm-' . $assembly);
  }
}