You are here

function theme_pardot_admin_scoring in Pardot Integration 6

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

File

./pardot.admin-scoring.inc, line 59

Code

function theme_pardot_admin_scoring($form) {

  //
  foreach (element_children($form['scores']) as $id) {
    $score = $form['scores'][$id]['#score'];
    $row = array();
    $row[] = drupal_render($form['scores'][$id]['path']);
    $row[] = drupal_render($form['scores'][$id]['score']);
    $ops = array();
    $ops[] = l(t('Edit'), 'admin/settings/pardot/scoring/' . $score->scoring_id . '/edit');
    $ops[] = l(t('Delete'), 'admin/settings/pardot/scoring/' . $score->scoring_id . '/delete');
    $row[] = implode(' | ', $ops);
    $rows[] = $row;
  }
  $rows[] = array(
    drupal_render($form['new']['path']),
    drupal_render($form['new']['score']),
    drupal_render($form['add']),
  );
  $headers = array(
    t('Path'),
    t('Score'),
    t('Operations'),
  );
  $output = theme('table', $headers, $rows);
  $output .= drupal_render($form);
  return $output;
}