summaryrefslogtreecommitdiff
path: root/includes/theme.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/theme.inc')
-rw-r--r--includes/theme.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index e90fb36f1..06fe4b709 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -712,10 +712,13 @@ function theme_submenu($links) {
* An array of HTML attributes to apply to the table tag.
* @param $caption
* A localized string to use for the <caption> tag.
+ * @param $id
+ * A unique id used to identify the table. Use this in the case where
+ * multiple tables appear on one page.
* @return
* An HTML string representing the table.
*/
-function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
+function theme_table($header, $rows, $attributes = array(), $caption = NULL, $id = '') {
$output = '<table'. drupal_attributes($attributes) .">\n";
if (isset($caption)) {
@@ -724,7 +727,7 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
// Format the table header:
if (count($header)) {
- $ts = tablesort_init($header);
+ $ts = tablesort_init($header, $id);
$output .= ' <thead><tr>';
foreach ($header as $cell) {
$cell = tablesort_header($cell, $header, $ts);