Contributions API

theme_webform_mail_components_form

Definition

theme_webform_mail_components_form($form)
contributions/webform/webform.module, line 794

Description

Theme the component options for sending e-mails.

Code

<?php
function theme_webform_mail_components_form($form) {
  drupal_add_css(drupal_get_path('module', 'webform') .'/webform.css');
  $node = $form['#node'];
  $header = array(
    array('data' => t('To'), 'class' => 'webform-checkbox'),
    t('Name'),
    t('Type'),
  );
  $rows = array();
  foreach (element_children($form['email_components']) as $cid) {
    $title = $form['email_components'][$cid]['#title'];
    unset($form['email_components'][$cid]['#title']);
    $rows[] = array(
      array('data' => drupal_render($form['email_components'][$cid]), 'class' => 'webform-checkbox'),
      $title,
      $node->webform['components'][$cid]['type'],
    );
  }
  if (empty($rows)) {
    $rows[] = array(array('colspan' => 5, 'data' => t('No components yet in this webform.')));
  }

  $form['#children'] = theme('table', $header, $rows);
  return drupal_render($form);
}
?>