You are here

function theme_notifications_admin_table_form in Notifications 7

Theme administration form/fieldset as table

2 theme calls to theme_notifications_admin_table_form()
notifications_admin_events_form in ./notifications.admin.inc
Event configuration administration
notifications_scheduler_admin_form in notifications_scheduler/notifications_scheduler.admin.inc
Event configuration administration

File

./notifications.admin.inc, line 350

Code

function theme_notifications_admin_table_form($variables) {
  $form = $variables['form'];
  $default = language_default();
  $header = $form['#header'];

  // Build table rows using header indexes for the fields
  $rows = array();
  foreach (element_children($form) as $index) {
    $row = array();
    foreach (array_keys($header) as $field) {
      $row[] = drupal_render($form[$index][$field]);
    }
    $rows[] = $row;
  }
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'empty' => $form['#empty'],
  ));
  $output .= drupal_render_children($form);
  return $output;
}