You are here

function theme_pardot_admin_campaign in Pardot Integration 6

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

File

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

Code

function theme_pardot_admin_campaign($form) {
  foreach (element_children($form['campaigns']) as $id) {
    $row = array();
    $row[] = drupal_render($form['campaigns'][$id]['campaign_id']);
    $row[] = drupal_render($form['campaigns'][$id]['name']);
    $row[] = '<pre>' . drupal_render($form['campaigns'][$id]['paths']) . '</pre>';
    $ops = array();
    $ops[] = l(t('Edit'), 'admin/settings/pardot/campaign/' . $form['campaigns'][$id]['#campaign']->campaign_id . '/edit');
    $ops[] = l(t('Delete'), 'admin/settings/pardot/campaign/' . $form['campaigns'][$id]['#campaign']->campaign_id . '/delete');
    $row[] = implode(' | ', $ops);
    $rows[] = $row;
  }
  $rows[] = array(
    drupal_render($form['new']['campaign_id']),
    drupal_render($form['new']['name']),
    drupal_render($form['new']['paths']),
    drupal_render($form['add']),
  );
  $headers = array(
    t('Campaign ID'),
    t('Name'),
    t('Path'),
    t('Operations'),
  );
  $output = theme('table', $headers, $rows);
  $output .= drupal_render($form);
  return $output;
}