You are here

function pardot_admin_campaign in Pardot Integration 6

Same name and namespace in other branches
  1. 7.2 pardot.admin-campaign.inc \pardot_admin_campaign()
  2. 7 pardot.admin-campaign.inc \pardot_admin_campaign()

Form callback for managing and viewing campaign entries.

1 string reference to 'pardot_admin_campaign'
pardot_menu in ./pardot.module
Implementation of hook_menu().

File

./pardot.admin-campaign.inc, line 6

Code

function pardot_admin_campaign() {
  $form = array();
  $campaigns = db_query('SELECT * FROM {pardot_campaign}');
  while ($campaign = db_fetch_object($campaigns)) {
    $form['campaigns'][$campaign->campaign_id] = array(
      '#campaign' => $campaign,
      'campaign_id' => array(
        '#value' => $campaign->campaign_id,
      ),
      'name' => array(
        '#value' => $campaign->name,
      ),
      'paths' => array(
        '#value' => $campaign->paths,
      ),
    );
  }
  $form['new'] = array(
    'campaign_id' => array(
      '#prefix' => '<div class="add-new-placeholder">' . t('Campaign ID') . '</div>',
      '#type' => 'textfield',
      '#size' => 10,
      '#description' => t('Numeric campaign code(piCId) from tracking code preview in Pardot administration interface.'),
    ),
    'name' => array(
      '#prefix' => '<div class="add-new-placeholder">' . t('Campaign name') . '</div>',
      '#type' => 'textfield',
      '#size' => 25,
      '#description' => t('A short descriptive name for administration purposes. Can be the same as the campaign name in Pardot but not required.'),
    ),
    'paths' => array(
      '#prefix' => '<div class="add-new-placeholder">' . t('Add new path') . '</div>',
      '#type' => 'textarea',
      '#wysiwyg' => FALSE,
      '#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are blog for the blog page and blog/* for every personal blog. <front> is the front page."),
    ),
  );
  $form['add'] = array(
    '#prefix' => '<div class="add-new-placeholder">&nbsp;</div>',
    '#type' => 'submit',
    '#value' => t('Add'),
  );
  return $form;
}