diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 6c43b69..87ce2f8 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -719,19 +719,18 @@ function template_preprocess_forum_list(&$variables) { function template_preprocess_forum_topic_list(&$variables) { global $forum_topic_list_header; - $header = ''; + $variables['table'] = array( + '#theme' => 'table', + '#attributes' => array('id' => 'forum-topic-' . $variables['tid']), + '#header' => array(), + '#rows' => array(), + ); + if (!empty($forum_topic_list_header)) { - // Create the tablesorting header. - $ts = tablesort_init($forum_topic_list_header); - foreach ($forum_topic_list_header as $cell) { - $cell = tablesort_header($cell, $forum_topic_list_header, $ts); - $header .= _theme_table_cell($cell, TRUE); - } + $variables['table']['#header'] = $forum_topic_list_header; } - $variables['header'] = $header; if (!empty($variables['topics'])) { - $row = 0; foreach ($variables['topics'] as $id => $topic) { $variables['topics'][$id]->icon = array( '#theme' => 'forum_icon', @@ -741,8 +740,6 @@ function template_preprocess_forum_topic_list(&$variables) { '#sticky' => $topic->isSticky(), '#first_new' => $topic->first_new, ); - $variables['topics'][$id]->zebra = $row % 2 == 0 ? 'odd' : 'even'; - $row++; // We keep the actual tid in forum table, if it's different from the // current tid then it means the topic appears in two forums, one of @@ -771,20 +768,50 @@ function template_preprocess_forum_topic_list(&$variables) { $variables['topics'][$id]->new_text = ''; $variables['topics'][$id]->new_url = ''; + if ($topic->new_replies) { $variables['topics'][$id]->new_text = format_plural($topic->new_replies, '1 new post in topic %title', '@count new posts in topic %title', array('%title' => $variables['topics'][$id]->label())); $variables['topics'][$id]->new_url = url('node/' . $topic->id(), array('query' => comment_new_page_count($topic->comment_count, $topic->new_replies, $topic), 'fragment' => 'new')); } + } + // Build table rows from topics. + foreach ($variables['topics'] as $topic) { + $row = array(); + $row[] = array( + 'data' => array( + $topic->icon, + array( + '#markup' => '
- {{ topic.icon }}
-
-
-
- {{ topic.title_link }}
-
-
- {{ topic.submitted }}
-
- |
- {% if topic.moved %}
- {{ topic.message }} | - {% else %} -
- {{ topic.comment_count }}
- {% if topic.new_replies %}
- - {{ topic.new_text }} - {% endif %} - |
- {{ topic.last_reply }} | - {% endif %} -