You are here

function authcache_p13n_attach in Authenticated User Page Caching (Authcache) 7.2

Attach fragment or setting to the target render element.

Related topics

13 calls to authcache_p13n_attach()
AuthcacheP13nTestMarkup::testRenderElement in modules/authcache_p13n/tests/authcache_p13n.markup.test
Cover authcache_p13n_attach().
authcache_block_page_alter in modules/authcache_block/authcache_block.module
Implements hook_page_alter().
authcache_comment_comment_view_alter in modules/authcache_comment/authcache_comment.module
Implements hook_comment_view_alter().
authcache_field_field_attach_view_alter in modules/authcache_field/authcache_field.module
Implements hook_field_attach_view_alter().
authcache_flag_entity_view_alter in modules/authcache_flag/authcache_flag.module
Implements hook_flag_view_alter().

... See full list

File

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

Code

function authcache_p13n_attach(&$target, $element) {
  if (!empty($element['#setting'])) {

    // Attach a setting.
    $target['#attached']['authcache_p13n_add_setting'][] = array(
      $element,
    );
  }
  else {

    // Attach post render callback and replacement element.
    $target['#post_render'][] = 'authcache_p13n_element_post_render';
    $target['#authcache_p13n_element'] = $element;
  }
}