You are here

function dfp_context_reaction_sizes::execute in Doubleclick for Publishers (DFP) 7.2

Same name and namespace in other branches
  1. 7 plugins/contexts/dfp_context_reaction_sizes.inc \dfp_context_reaction_sizes::execute()

override all tags based on context.

File

plugins/contexts/dfp_context_reaction_sizes.inc, line 41
Context reaction plugin for DFP ads.

Class

dfp_context_reaction_sizes
Expose DFP tags as context reactions.

Code

function execute(&$tag) {

  // Check each currently set context to see if the DART tag specified by
  // machinename should be overridden or not.
  foreach ($this
    ->get_contexts() as $context_name => $context) {
    $new_size = isset($context->reactions['dfp_adsize'][$tag->machinename . '_size']) ? $context->reactions['dfp_adsize'][$tag->machinename . '_size'] : '';
    $tag->size = !empty($new_size) ? $new_size : $tag->size;
  }
}