From cf0170d5e38117cf256d45a6c0164ea76b3887bc Mon Sep 17 00:00:00 2001 From: javiexin Date: Sat, 18 Jul 2015 18:29:25 +0200 Subject: [ticket/14037] Allows adapting memberlist profile fields headline Adds an event to allow modifying the profile fields headline in line with modifications to profile fields data. PHPBB3-14037 --- phpBB/phpbb/profilefields/manager.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'phpBB/phpbb/profilefields') diff --git a/phpBB/phpbb/profilefields/manager.php b/phpBB/phpbb/profilefields/manager.php index 4ad3214ae4..822b81e0ad 100644 --- a/phpBB/phpbb/profilefields/manager.php +++ b/phpBB/phpbb/profilefields/manager.php @@ -276,12 +276,30 @@ class manager $profile_field = $this->type_collection[$field_data['field_type']]; $tpl_fields[] = array( + 'PROFILE_FIELD_IDENT' => $field_ident, 'PROFILE_FIELD_TYPE' => $field_data['field_type'], 'PROFILE_FIELD_NAME' => $profile_field->get_field_name($field_data['lang_name']), 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($field_data['lang_explain']), ); } + $profile_cache = $this->profile_cache; + /** + * Event to modify template headlines of the generated profile fields + * + * @event core.generate_profile_fields_template_headlines + * @var string restrict_option Restrict the published fields to a certain profile field option + * @var array tpl_fields Array with template data fields + * @var array profile_cache A copy of the profile cache to make additional checks + * @since 3.1.6-RC1 + */ + $vars = array( + 'restrict_option', + 'tpl_fields', + 'profile_cache', + ); + extract($this->dispatcher->trigger_event('core.generate_profile_fields_template_headlines', compact($vars))); + return $tpl_fields; } -- cgit v1.2.1 From 897b9f333bf2ee05d8c4e371d2b324d255fbfd5e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 20 Aug 2015 10:14:07 +0200 Subject: [ticket/14037] Minor coding style improvements to event PHPBB3-14037 --- phpBB/phpbb/profilefields/manager.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/phpbb/profilefields') diff --git a/phpBB/phpbb/profilefields/manager.php b/phpBB/phpbb/profilefields/manager.php index 822b81e0ad..ea4b24af56 100644 --- a/phpBB/phpbb/profilefields/manager.php +++ b/phpBB/phpbb/profilefields/manager.php @@ -284,6 +284,7 @@ class manager } $profile_cache = $this->profile_cache; + /** * Event to modify template headlines of the generated profile fields * @@ -299,6 +300,7 @@ class manager 'profile_cache', ); extract($this->dispatcher->trigger_event('core.generate_profile_fields_template_headlines', compact($vars))); + unset($profile_cache); return $tpl_fields; } -- cgit v1.2.1