You are here

function dfp_context_reaction_sizes::options_form 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::options_form()

Allow admins to choose what DFP adunit to override.

Overrides context_reaction::options_form

File

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

Class

dfp_context_reaction_sizes
Expose DFP tags as context reactions.

Code

function options_form($context) {
  $form = array(
    '#theme' => 'dfp_size_settings',
  );

  // Get existing values for this form.
  $values = $this
    ->fetch_from_context($context);

  // Get a list of all DART tags.
  $tags = dfp_tag_load_all();
  foreach ($tags as $tag) {
    $form[$tag->machinename . '_size'] = array(
      '#type' => 'textfield',
      '#title' => check_plain($tag->slot),
      '#title_display' => 'invisible',
      '#description' => t('Example: 300x600,300x250'),
      '#default_value' => isset($values[$tag->machinename . '_size']) ? $values[$tag->machinename . '_size'] : '',
    );
  }
  return $form;
}