[ticket/12392] Include $profile_fields in core.memberlist_view_profile

PHPBB3-12392
This commit is contained in:
PayBas 2014-04-12 12:38:35 +02:00
parent 1dd02b0a91
commit 48cc7961d4

View file

@ -584,25 +584,31 @@ switch ($mode)
unset($module); unset($module);
} }
// Custom Profile Fields
$profile_fields = array();
if ($config['load_cpf_viewprofile'])
{
$cp = $phpbb_container->get('profilefields.manager');
$profile_fields = $cp->grab_profile_fields_data($user_id);
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields[$user_id]) : array();
}
/** /**
* Modify user data before we display the profile * Modify user data before we display the profile
* *
* @event core.memberlist_view_profile * @event core.memberlist_view_profile
* @var array member Array with user's data * @var array member Array with user's data
* @var bool user_notes_enabled Is the mcp user notes module * @var bool user_notes_enabled Is the mcp user notes module enabled?
* enabled? * @var bool warn_user_enabled Is the mcp warnings module enabled?
* @var bool warn_user_enabled Is the mcp warnings module * @var bool zebra_enabled Is the ucp zebra module enabled?
* enabled? * @var bool friends_enabled Is the ucp friends module enabled?
* @var bool zebra_enabled Is the ucp zebra module * @var bool foes_enabled Is the ucp foes module enabled?
* enabled?
* @var bool friends_enabled Is the ucp friends module
* enabled?
* @var bool foes_enabled Is the ucp foes module
* enabled?
* @var bool friend Is the user friend? * @var bool friend Is the user friend?
* @var bool foe Is the user foe? * @var bool foe Is the user foe?
* @var array profile_fields Array with user's profile field data
* @since 3.1.0-a1 * @since 3.1.0-a1
* @changed 3.1.0-b2 Added friend and foe status * @changed 3.1.0-b2 Added friend and foe status
* @changed 3.1.0-b3 Added profile fields data
*/ */
$vars = array( $vars = array(
'member', 'member',
@ -613,20 +619,12 @@ switch ($mode)
'foes_enabled', 'foes_enabled',
'friend', 'friend',
'foe', 'foe',
'profile_fields',
); );
extract($phpbb_dispatcher->trigger_event('core.memberlist_view_profile', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.memberlist_view_profile', compact($vars)));
$template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled)); $template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled));
// Custom Profile Fields
$profile_fields = array();
if ($config['load_cpf_viewprofile'])
{
$cp = $phpbb_container->get('profilefields.manager');
$profile_fields = $cp->grab_profile_fields_data($user_id);
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields[$user_id]) : array();
}
// If the user has m_approve permission or a_user permission, then list then display unapproved posts // If the user has m_approve permission or a_user permission, then list then display unapproved posts
if ($auth->acl_getf_global('m_approve') || $auth->acl_get('a_user')) if ($auth->acl_getf_global('m_approve') || $auth->acl_get('a_user'))
{ {