diff options
Diffstat (limited to 'includes/theme.inc')
-rw-r--r-- | includes/theme.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 63af79711..635b2b0bb 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1706,6 +1706,8 @@ function theme_submenu($variables) { * within a table. For example, one may easily group three columns and * apply same background style to all. * - sticky: Use a "sticky" table header. + * - empty: The message to display in an extra row if table does not have any + * rows. * * @return * An HTML string representing the table. @@ -1717,6 +1719,7 @@ function theme_table($variables) { $caption = $variables['caption']; $colgroups = $variables['colgroups']; $sticky = $variables['sticky']; + $empty = $variables['empty']; // Add sticky headers, if applicable. if (count($header) && $sticky) { @@ -1784,6 +1787,11 @@ function theme_table($variables) { $ts = array(); } + // Add the 'empty' row message if available. + if (!count($rows) && $empty) { + $rows[] = array(array('data' => $empty, 'colspan' => count($header), 'class' => array('empty', 'message'))); + } + // Format the table rows: if (count($rows)) { $output .= "<tbody>\n"; |