You are here

function theme_webform_admin_settings in Webform 5

Same name and namespace in other branches
  1. 5.2 webform.module \theme_webform_admin_settings()
  2. 6.3 includes/webform.admin.inc \theme_webform_admin_settings()
  3. 6.2 webform.module \theme_webform_admin_settings()
  4. 7.4 includes/webform.admin.inc \theme_webform_admin_settings()
  5. 7.3 includes/webform.admin.inc \theme_webform_admin_settings()

File

./webform.module, line 383

Code

function theme_webform_admin_settings($form) {

  // Format the components into a table.
  foreach (element_children($form['components']) as $key) {
    $row = array();
    $row[] = $form['components'][$key]['#title'];
    $row[] = $form['components'][$key]['#description'];
    unset($form['components'][$key]['#title']);
    unset($form['components'][$key]['#description']);
    $row[] = array(
      'data' => drupal_render($form['components'][$key]),
      'align' => 'center',
    );
    $rows[] = $row;
  }
  $header = array(
    t('Name'),
    t('Description'),
    t('Enabled'),
  );

  // Create the table inside the form.
  $form['components']['table'] = array(
    '#value' => theme('table', $header, $rows),
  );
  $output = drupal_render($form);
  return $output;
}