You are here

function dfp_adtest_form in Doubleclick for Publishers (DFP) 7

Same name and namespace in other branches
  1. 8 src/View/dfp.adtest.inc \dfp_adtest_form()
  2. 7.2 dfp.adtest.inc \dfp_adtest_form()

Build a form for display at the top of the adtest page allowing users to set the adunit pattern for all dfp tags on that page.

1 string reference to 'dfp_adtest_form'
dfp_adtest_page in ./dfp.adtest.inc
Page callback for the DFP test page. It displays all tags on the site.

File

./dfp.adtest.inc, line 48
Creates a test page for DFP ads.

Code

function dfp_adtest_form($form, &$form_state) {
  form_load_include($form_state, 'inc', 'dfp', 'dfp.adtest');
  $form['#method'] = 'get';
  $form['adunit_override'] = array(
    '#type' => 'textfield',
    '#title' => t('Ad Unit Override'),
    '#default_value' => isset($_GET['adunit_override']) ? $_GET['adunit_override'] : '',
    '#description' => t('Override the Ad Unit value for all the ad tags below. Use the tokens below to define how the ad unit should display. Example: [dfp_tag:network_id]/test/[dfp_tag:slot]'),
  );
  $form['tokens'] = array(
    '#theme' => 'token_tree',
    '#token_types' => array(
      'dfp_tag',
      'node',
      'term',
      'user',
    ),
    '#global_types' => TRUE,
    '#click_insert' => TRUE,
    '#dialog' => TRUE,
    '#weight' => 100,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Override'),
  );
  return $form;
}