From 69407cae7bc50af526db86a3be3718d68f57d2bc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 16 Mar 2012 11:21:12 +0100 Subject: [PATCH] [feature/events] Adding ledge display_custom_bbcodes_row Used by phpBB Gallery PHPBB3-9550 --- phpBB/includes/functions_display.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index b320d35e09..604197b2eb 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -850,7 +850,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold */ function display_custom_bbcodes() { - global $db, $template, $user; + global $db, $template, $user, $phpbb_dispatcher; // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing) $num_predefined_bbcodes = 22; @@ -870,13 +870,20 @@ function display_custom_bbcodes() $row['bbcode_helpline'] = $user->lang[strtoupper($row['bbcode_helpline'])]; } - $template->assign_block_vars('custom_tags', array( + $custom_tags = array( 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", 'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2), 'BBCODE_TAG' => $row['bbcode_tag'], 'BBCODE_HELPLINE' => $row['bbcode_helpline'], 'A_BBCODE_HELPLINE' => str_replace(array('&', '"', "'", '<', '>'), array('&', '"', "\'", '<', '>'), $row['bbcode_helpline']), - )); + ); + + $vars = array('custom_tags', 'row'); + $event = new phpbb_event_data(compact($vars)); + $phpbb_dispatcher->dispatch('core.display_custom_bbcodes_row', $event); + extract($event->get_data_filtered($vars)); + + $template->assign_block_vars('custom_tags', $custom_tags); $i++; }