aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-09-11 16:58:34 +0200
committerTristan Darricau <github@nicofuma.fr>2014-09-11 16:58:34 +0200
commit7d6ceb81c1891ad1cfe518b7f2f0cc62968ad21e (patch)
tree8c36c8610b9ee6b9965e3ad5a4cbdeffe526749d
parent5804e435893786bd2af2a917742da5f15659ee36 (diff)
parent0aa7d3ef752306f294e4276a942c31a6e1f9bde3 (diff)
downloadforums-7d6ceb81c1891ad1cfe518b7f2f0cc62968ad21e.tar
forums-7d6ceb81c1891ad1cfe518b7f2f0cc62968ad21e.tar.gz
forums-7d6ceb81c1891ad1cfe518b7f2f0cc62968ad21e.tar.bz2
forums-7d6ceb81c1891ad1cfe518b7f2f0cc62968ad21e.tar.xz
forums-7d6ceb81c1891ad1cfe518b7f2f0cc62968ad21e.zip
Merge pull request #2901 from rxu/ticket/13005
[ticket/13005] Add event to display_forums() to modify category template data * rxu/ticket/13005: [ticket/13005] Add event to display_forums() to modify category template data
-rw-r--r--phpBB/includes/functions_display.php30
1 files changed, 27 insertions, 3 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 78137d075b..85d9496061 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -379,10 +379,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$last_catless = true;
foreach ($forum_rows as $row)
{
- // Empty category
+ // Category
if ($row['parent_id'] == $root_data['forum_id'] && $row['forum_type'] == FORUM_CAT)
{
- $template->assign_block_vars('forumrow', array(
+ $cat_row = array(
'S_IS_CAT' => true,
'FORUM_ID' => $row['forum_id'],
'FORUM_NAME' => $row['forum_name'],
@@ -391,9 +391,33 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'FORUM_FOLDER_IMG_SRC' => '',
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '',
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
- 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']))
+ 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
);
+ /**
+ * Modify the template data block of the 'category'
+ *
+ * This event is triggered once per 'category'
+ *
+ * @event core.display_forums_modify_category_template_vars
+ * @var array cat_row Template data of the 'category'
+ * @var bool catless The flag indicating whether the 'category' has a parent category
+ * @var bool last_catless The flag indicating whether the last forum had a parent category
+ * @var array root_data Array with the root forum data
+ * @var array row The data of the 'category'
+ * @since 3.1.0-RC4
+ */
+ $vars = array(
+ 'cat_row',
+ 'catless',
+ 'last_catless',
+ 'root_data',
+ 'row',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_category_template_vars', compact($vars)));
+
+ $template->assign_block_vars('forumrow', $cat_row);
+
continue;
}