From 5e3ebda0dab8f221c59ce5590ccfa4d27c09216f Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Tue, 21 Jul 2015 21:20:24 +0200 Subject: [PATCH 1/3] [ticket/14043] Add core.get_avatar_after php event PHPBB3-14043 --- phpBB/includes/functions.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4159af5678..533bab8936 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1159,7 +1159,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ /** * This event is used for performing actions directly before marking forums, * topics or posts as read. - * + * * It is also possible to prevent the marking. For that, the $should_markread parameter * should be set to FALSE. * @@ -4806,6 +4806,16 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false) 'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />'; } + /** + * Event to modify HTML tag of avatar + * + * @event core.get_avatar_after + * @var string html The HTML tag of generated avatar + * @since 3.1.6 + */ + $vars = array('html'); + extract($phpbb_dispatcher->trigger_event('core.get_avatar_after', compact($vars))); + return $html; } From c6a654e85939a187c5ea466c92d7332ebb70d9e0 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Wed, 22 Jul 2015 13:55:26 +0200 Subject: [PATCH 2/3] [ticket/14043] Add dispatcher to globals, change @since value PHPBB3-14043 --- phpBB/includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 533bab8936..b31a45276f 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4766,7 +4766,7 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false) { global $user, $config, $cache, $phpbb_root_path, $phpEx; global $request; - global $phpbb_container; + global $phpbb_container, $phpbb_dispatcher; if (!$config['allow_avatar'] && !$ignore_config) { @@ -4811,7 +4811,7 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false) * * @event core.get_avatar_after * @var string html The HTML tag of generated avatar - * @since 3.1.6 + * @since 3.1.6-RC1 */ $vars = array('html'); extract($phpbb_dispatcher->trigger_event('core.get_avatar_after', compact($vars))); From 7cb7ca57c2f7a5f5b70749bc04f50f05046eeb9f Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Sun, 2 Aug 2015 20:27:05 +0200 Subject: [PATCH 3/3] [ticket/14043] Add more parameters to the event PHPBB3-14043 --- phpBB/includes/functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index b31a45276f..47f8161eac 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4810,10 +4810,14 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false) * Event to modify HTML tag of avatar * * @event core.get_avatar_after - * @var string html The HTML tag of generated avatar + * @var array row Row cleaned by \phpbb\avatar\manager::clean_row + * @var string alt Optional language string for alt tag within image, can be a language key or text + * @var bool ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP + * @var array avatar_data The HTML attributes for avatar tag + * @var string html The HTML tag of generated avatar * @since 3.1.6-RC1 */ - $vars = array('html'); + $vars = array('row', 'alt', 'ignore_config', 'avatar_data', 'html'); extract($phpbb_dispatcher->trigger_event('core.get_avatar_after', compact($vars))); return $html;