[ticket/14395] Move call to phpbb_add_quickmod_option

Moved the call to function phpbb_add_quickmod_option to being under the core
event core.viewtopic_assign_template_vars_before so as to enable the
modification of elements in the  BEFORE they are assigned to the
template, so that removed elements don't show up in a non-functional state.
Allows the user to perform additional permissions checks on the items within the
array.

PHPBB3-14395
This commit is contained in:
LaxSlash 2016-01-07 15:36:10 -05:00
parent a7058d968f
commit 8e8fac17ff

View file

@ -588,14 +588,6 @@ $quickmod_array = array(
'topic_logs' => array('VIEW_TOPIC_LOGS', $auth->acl_get('m_', $forum_id)), 'topic_logs' => array('VIEW_TOPIC_LOGS', $auth->acl_get('m_', $forum_id)),
); );
foreach ($quickmod_array as $option => $qm_ary)
{
if (!empty($qm_ary[1]))
{
phpbb_add_quickmod_option($s_quickmod_action, $option, $qm_ary[0]);
}
}
// Navigation links // Navigation links
generate_forum_nav($topic_data); generate_forum_nav($topic_data);
@ -667,6 +659,14 @@ $vars = array(
); );
extract($phpbb_dispatcher->trigger_event('core.viewtopic_assign_template_vars_before', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.viewtopic_assign_template_vars_before', compact($vars)));
foreach ($quickmod_array as $option => $qm_ary)
{
if (!empty($qm_ary[1]))
{
phpbb_add_quickmod_option($s_quickmod_action, $option, $qm_ary[0]);
}
}
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_posts, $config['posts_per_page'], $start); $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_posts, $config['posts_per_page'], $start);
// Send vars to template // Send vars to template