You are here

function theme_webform_admin_settings in Webform 7.4

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

Theme the output of the webform_admin_settings() form.

File

includes/webform.admin.inc, line 300
Administration pages provided by Webform module.

Code

function theme_webform_admin_settings($variables) {
  $form = $variables['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'];
    $form['components'][$key]['#title'] = NULL;
    $form['components'][$key]['#description'] = NULL;
    $row[] = array(
      'data' => drupal_render($form['components'][$key]),
      'align' => 'center',
    );
    $rows[] = $row;
  }
  $header = array(
    t('Name'),
    t('Description'),
    array(
      'data' => t('Enabled'),
      'class' => array(
        'checkbox',
      ),
    ),
  );

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