commit 08d0ced9cd183f2ddb03c69e6d2202c8bcfd0965 Author: Joel Pittet Date: Fri Oct 11 21:25:07 2013 -0700 remove forum-topic-list template diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 4f7a199..7a1e6a7 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -82,10 +82,6 @@ function forum_theme() { 'template' => 'forum-list', 'variables' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), ), - 'forum_topic_list' => array( - 'template' => 'forum-topic-list', - 'variables' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), - ), 'forum_icon' => array( 'template' => 'forum-icon', 'variables' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0, 'first_new' => FALSE), @@ -651,12 +647,9 @@ function template_preprocess_forums(&$variables) { } if ($variables['term'] && empty($variables['term']->forum_container->value)) { - $variables['topics'] = array( - '#theme' => 'forum_topic_list', - '#tid' => $variables['tid'], - '#topics' => $variables['topics'], - '#sortby' => $variables['sortby'], - '#forum_per_page' => $variables['forum_per_page'], + $variables['topics'] = _forum_topic_list($variables); + $variables['topics_pager'] = array( + '#theme' => 'pager', ); } else { @@ -724,9 +717,7 @@ function template_preprocess_forum_list(&$variables) { } /** - * Prepares variables for forum topic list templates. - * - * Default template: forum-topic-list.html.twig. + * Helper to build the forum topic list table. * * @param array $variables * An array containing the following elements: @@ -734,10 +725,10 @@ function template_preprocess_forum_list(&$variables) { * - topics: An array of all the topics in the current forum. * - forum_per_page: The maximum number of topics to display per page. */ -function template_preprocess_forum_topic_list(&$variables) { +function _forum_topic_list($variables) { global $forum_topic_list_header; - $variables['table'] = array( + $table = array( '#theme' => 'table', '#attributes' => array('id' => 'forum-topic-' . $variables['tid']), '#header' => array(), @@ -745,7 +736,7 @@ function template_preprocess_forum_topic_list(&$variables) { ); if (!empty($forum_topic_list_header)) { - $variables['table']['#header'] = $forum_topic_list_header; + $table['#header'] = $forum_topic_list_header; } if (!empty($variables['topics'])) { @@ -827,13 +818,11 @@ function template_preprocess_forum_topic_list(&$variables) { 'class' => array('last-reply'), ); } - $variables['table']['#rows'][] = $row; + $table['#rows'][] = $row; } } - $variables['pager'] = array( - '#theme' => 'pager', - ); + return $table; } /** diff --git a/core/modules/forum/templates/forum-topic-list.html.twig b/core/modules/forum/templates/forum-topic-list.html.twig deleted file mode 100644 index 8204daf..0000000 --- a/core/modules/forum/templates/forum-topic-list.html.twig +++ /dev/null @@ -1,16 +0,0 @@ -{# -/** - * @file - * Default theme implementation to display a list of forum topics. - * - * Available variables: - * - table: The topic list table. - * - pager: The pager to display beneath the table. - * - * @see template_preprocess_forum_topic_list() - * - * @ingroup themeable - */ -#} -{{ table }} -{{ pager }} diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index abda14e..f3d719f 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -1434,9 +1434,6 @@ function hook_theme($existing, $type, $theme, $path) { 'forum_list' => array( 'variables' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), ), - 'forum_topic_list' => array( - 'variables' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), - ), 'forum_icon' => array( 'variables' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), ),