Last active
December 11, 2015 20:39
-
-
Save jbubriski/4656989 to your computer and use it in GitHub Desktop.
Theming an admin form for the webforms module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment