class dfp_context_reaction_tags in Doubleclick for Publishers (DFP) 7
Same name and namespace in other branches
- 7.2 plugins/contexts/dfp_context_reaction_tags.inc \dfp_context_reaction_tags
Expose DFP tags as context reactions.
Hierarchy
- class \context_reaction
- class \dfp_context_reaction_tags
Expanded class hierarchy of dfp_context_reaction_tags
2 string references to 'dfp_context_reaction_tags'
- dfp_context_plugins in ./
dfp.module - Implements hook_context_plugins().
- dfp_context_registry in ./
dfp.module - Implements hook_context_registry().
File
- plugins/
contexts/ dfp_context_reaction_tags.inc, line 11 - Context reaction plugin for DFP ads.
View source
class dfp_context_reaction_tags extends context_reaction {
/**
* Allow admins to choose what DFP tags to hide.
*/
function options_form($context) {
// Get existing values for this form.
$values = $this
->fetch_from_context($context);
// Get a list of all DART tags.
$options = array();
$tags = dfp_tag_load_all();
foreach ($tags as $tag) {
$options[$tag->machinename] = $tag->slot;
}
$form = array(
'#title' => t('Hide these DFP tags'),
'#description' => t('The following DFP tags will not be displayed.'),
'#type' => 'checkboxes',
'#options' => $options,
'#default_value' => isset($values) ? $values : array(),
);
return $form;
}
/**
* Disable any tags that should be disabled based on context.
*/
function execute(&$tag) {
// Check each currently set context to see if the DART tag specified by
// machinename should be displayed or not.
foreach ($this
->get_contexts() as $context_name => $context) {
if (isset($context->reactions['dfp_tags']) && in_array($tag->machinename, $context->reactions['dfp_tags'], TRUE)) {
$tag->disabled = TRUE;
break;
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
context_reaction:: |
property | |||
context_reaction:: |
property | |||
context_reaction:: |
property | |||
context_reaction:: |
function | Retrieve options from the context provided. | 1 | |
context_reaction:: |
function | Retrieve active contexts that have values for this reaction. | ||
context_reaction:: |
function | Options form submit handler. | 3 | |
context_reaction:: |
function | Settings form. Provide variable settings for your reaction. | 2 | |
context_reaction:: |
function | Clone our references when we're being cloned. | ||
context_reaction:: |
function | Constructor. Do not override. | ||
dfp_context_reaction_tags:: |
function | Disable any tags that should be disabled based on context. | ||
dfp_context_reaction_tags:: |
function |
Allow admins to choose what DFP tags to hide. Overrides context_reaction:: |