function theme_notifications_table_form in Notifications 6.3
Same name and namespace in other branches
- 6.4 notifications.pages.inc \theme_notifications_table_form()
- 6 notifications.admin.inc \theme_notifications_table_form()
- 6.2 notifications.admin.inc \theme_notifications_table_form()
- 7 notifications.pages.inc \theme_notifications_table_form()
Generic table formatting for forms
File
- ./
notifications.admin.inc, line 529
Code
function theme_notifications_table_form($form) {
$output = '';
// Get table information from special form properties
$index = !empty($form['#table_index']) ? $form['#table_index'] : $form['#table_fields'][0];
$header = !empty($form['#table_header']) ? $form['#table_header'] : array();
foreach (element_children($form[$index]) as $key) {
$row = array();
foreach ($form['#table_fields'] as $field) {
$row[] = drupal_render($form[$field][$key]);
}
$rows[] = $row;
}
if ($rows) {
$output .= theme('table', $header, $rows);
}
else {
$output .= '<p>' . t('No elements') . '</p>';
}
$output .= drupal_render($form);
return $output;
}