You are here

function theme_pardot_webform_components_form in Pardot Integration 7

Same name and namespace in other branches
  1. 6 pardot.admin.inc \theme_pardot_webform_components_form()
  2. 7.2 pardot_webform/pardot_webform.admin.inc \theme_pardot_webform_components_form()

Theme callback for pardot_webform_components_form().

File

./pardot.admin.inc, line 205
Admin forms.

Code

function theme_pardot_webform_components_form($form) {
  $form = $form['form'];
  $rows = array();
  $output = '';
  $header = array(
    t('Name'),
    t('Type'),
    t('Pardot key'),
  );
  foreach (element_children($form['components']) as $k) {
    $row = array();

    // Name.
    $row[] = $form['#node']->webform['components'][$k]['name'];

    // Type.
    $row[] = $form['#node']->webform['components'][$k]['type'];

    // Pardot key.
    unset($form['components'][$k]['key']['#title']);
    $row[] = drupal_render($form['components'][$k]['key']);
    $rows[] = $row;
  }
  $output .= drupal_render($form['details']);
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  $output .= drupal_render_children($form);
  return $output;
}