function theme_webform_submission_resend in Webform 7.4
Same name and namespace in other branches
- 6.3 includes/webform.submissions.inc \theme_webform_submission_resend()
- 7.3 includes/webform.submissions.inc \theme_webform_submission_resend()
Theme the node components form. Use a table to organize the components.
Parameters
array $variables: Array with key "form" containing the form array.
Return value
string Formatted HTML form, ready for display.
Throws
Exception
File
- includes/
webform.submissions.inc, line 647 - Submission handling functions.
Code
function theme_webform_submission_resend(array $variables) {
$form = $variables['form'];
$header = array(
t('Send'),
t('E-mail to'),
t('Subject'),
);
$rows = array();
if (!empty($form['emails'])) {
foreach (element_children($form['emails']) as $eid) {
// Add each component to a table row.
$rows[] = array(
drupal_render($form['resend'][$eid]),
drupal_render($form['emails'][$eid]['email']),
drupal_render($form['emails'][$eid]['subject']),
);
}
}
else {
$rows[] = array(
array(
'data' => t('This webform is currently not setup to send emails.'),
'colspan' => 3,
),
);
}
$output = '';
$output .= theme('table', array(
'header' => $header,
'rows' => $rows,
'sticky' => FALSE,
'attributes' => array(
'id' => 'webform-emails',
),
));
$output .= drupal_render_children($form);
return $output;
}