You are here

function authcache_preprocess in Authenticated User Page Caching (Authcache) 7

Same name and namespace in other branches
  1. 6 authcache.module \authcache_preprocess()
  2. 7.2 authcache.module \authcache_preprocess()

Process all template variables

File

./authcache.module, line 522
Authenticated User Page Caching (and anonymous users, too!)

Code

function authcache_preprocess(&$variables, $hook) {
  global $_authcache_is_cacheable;

  // Define variables for templates files
  $variables['authcache_is_cacheable'] = $_authcache_is_cacheable;

  //&& is_object($variables['user']) is a temporary fix for issue reports here http://drupal.org/node/966152 #61 - may well be removed in release version
  if (isset($variables['user']) && is_object($variables['user']) && $variables['user']->uid) {
    $variables['user_name'] = $_authcache_is_cacheable === true ? '<span class="authcache-user"></span>' : $variables['user']->name;
    $variables['user_link'] = $_authcache_is_cacheable === true ? '<a href="" class="authcache-user-link">!username</a>' : l($variables['user']->name, "user", array(
      'alias' => TRUE,
    ));
  }
}