You are here

function theme_pardot_admin_scoring in Pardot Integration 7

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

Theme callback for pardot_admin_scoring.

See also

pardot_admin_scoring()

File

./pardot.admin-scoring.inc, line 86
Admin scoring form.

Code

function theme_pardot_admin_scoring($variables) {
  $form = $variables['form'];
  if (isset($form['scores'])) {
    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/config/services/pardot/scoring/' . $score->scoring_id . '/edit');
      $ops[] = l(t('Delete'), 'admin/config/services/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', array(
    'header' => $headers,
    'rows' => $rows,
  ));
  $output .= drupal_render_children($form);
  return $output;
}