You are here

function authcache_user_attach_property in Authenticated User Page Caching (Authcache) 7.2

Attach setting loader for currently logged in user to the given element.

3 calls to authcache_user_attach_property()
authcache_comment_form_comment_form_alter in modules/authcache_comment/authcache_comment.module
Implements hook_form_FORM_ID_alter().
authcache_user_form_alter in modules/authcache_user/authcache_user.module
Implements hook_form_alter().
authcache_user_preprocess_toolbar in modules/authcache_user/authcache_user.module
Implements hook_preprocess_toolbar().

File

modules/authcache_user/authcache_user.module, line 73
Provide profile data of logged in user as personalized setting.

Code

function authcache_user_attach_property(&$target, $property_name) {
  authcache_p13n_attach($target, array(
    '#setting' => 'user',
    '#attached' => array(
      'js' => array(
        drupal_get_path('module', 'authcache_user') . '/authcache_user.js',
      ),
    ),
  ));
  $target['#attributes']['class'][] = 'authcache-user';
  $target['#attributes']['data-p13n-user-prop'] = $property_name;
}