You are here

function theme_webform_mail_components_form in Webform 5.2

Same name and namespace in other branches
  1. 6.2 webform.module \theme_webform_mail_components_form()

Theme the component options for sending e-mails.

1 theme call to theme_webform_mail_components_form()
webform_form in ./webform.module
Implementation of hook_form(). Creates the standard form for editing or creating a webform.

File

./webform.module, line 722

Code

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' => 6,
        'data' => t('No components yet in this webform.'),
      ),
    );
  }
  $form['#children'] = theme('table', $header, $rows);
  return drupal_render($form);
}