function theme_webform_submission_resend in Webform 6.3
Same name and namespace in other branches
- 7.4 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
$form: The form array.
Return value
Formatted HTML form, ready for display.
File
- includes/webform.submissions.inc, line 507 
- This file is loaded when handling submissions, either submitting new, editing, or viewing. It also contains all CRUD functions for submissions.
Code
function theme_webform_submission_resend($form) {
  $header = array(
    '',
    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', $header, $rows, array(
    'id' => 'webform-emails',
  ));
  $output .= drupal_render($form);
  return $output;
}