[ticket/14234] Replace more references with variables

PHPBB3-14234
This commit is contained in:
Marc Alexander 2015-10-12 18:50:14 +02:00
parent f90b16df0d
commit f3e2bd9273
2 changed files with 19 additions and 8 deletions

View file

@ -1210,6 +1210,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
); );
} }
$update_count_ary = $update_count;
/** /**
* Use this event to modify the attachment template data. * Use this event to modify the attachment template data.
* *
@ -1223,8 +1224,9 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
* @var array extensions Array with attachment extensions data * @var array extensions Array with attachment extensions data
* @var mixed forum_id The forum id the attachments are displayed in (false if in private message) * @var mixed forum_id The forum id the attachments are displayed in (false if in private message)
* @var bool preview Flag indicating if we are in post preview mode * @var bool preview Flag indicating if we are in post preview mode
* @var array update_count Array with attachment ids to update download count * @var array update_count_ary Array with attachment ids to update download count
* @since 3.1.0-RC5 * @since 3.1.0-RC5
* @change 3.1.7-RC1 Replaced update_count with update_count_ary
*/ */
$vars = array( $vars = array(
'attachment', 'attachment',
@ -1234,9 +1236,11 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
'extensions', 'extensions',
'forum_id', 'forum_id',
'preview', 'preview',
'update_count', 'update_count_ary',
); );
extract($phpbb_dispatcher->trigger_event('core.parse_attachments_modify_template_data', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.parse_attachments_modify_template_data', compact($vars)));
$update_count = $update_count_ary;
unset($update_count_ary);
$template->assign_block_vars('_file', $block_array); $template->assign_block_vars('_file', $block_array);

View file

@ -438,15 +438,14 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
* *
* @event core.display_forums_modify_category_template_vars * @event core.display_forums_modify_category_template_vars
* @var array cat_row Template data of the 'category' * @var array cat_row Template data of the 'category'
* @var bool catless The flag indicating whether the 'category' has a parent category
* @var bool last_catless The flag indicating whether the last forum had a parent category * @var bool last_catless The flag indicating whether the last forum had a parent category
* @var array root_data Array with the root forum data * @var array root_data Array with the root forum data
* @var array row The data of the 'category' * @var array row The data of the 'category'
* @since 3.1.0-RC4 * @since 3.1.0-RC4
* @change 3.1.7-RC1 Removed undefined catless variable
*/ */
$vars = array( $vars = array(
'cat_row', 'cat_row',
'catless',
'last_catless', 'last_catless',
'root_data', 'root_data',
'row', 'row',
@ -811,25 +810,29 @@ function generate_forum_nav(&$forum_data)
'S_ENABLE_FEEDS_FORUM' => ($config['feed_forum'] && $forum_data['forum_type'] == FORUM_POST && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false, 'S_ENABLE_FEEDS_FORUM' => ($config['feed_forum'] && $forum_data['forum_type'] == FORUM_POST && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false,
); );
$forum_data_ary = $forum_data;
/** /**
* Event to modify the navlinks text * Event to modify the navlinks text
* *
* @event core.generate_forum_nav * @event core.generate_forum_nav
* @var array forum_data Array with the forum data * @var array forum_data_ary Array with the forum data
* @var array forum_template_data Array with generic forum template data * @var array forum_template_data Array with generic forum template data
* @var string microdata_attr The microdata attribute * @var string microdata_attr The microdata attribute
* @var array navlinks_parents Array with the forum parents navlinks data * @var array navlinks_parents Array with the forum parents navlinks data
* @var array navlinks Array with the forum navlinks data * @var array navlinks Array with the forum navlinks data
* @since 3.1.5-RC1 * @since 3.1.5-RC1
* @change 3.2.0-a1 Replaced forum_data with forum_data_ary
*/ */
$vars = array( $vars = array(
'forum_data', 'forum_data_ary',
'forum_template_data', 'forum_template_data',
'microdata_attr', 'microdata_attr',
'navlinks_parents', 'navlinks_parents',
'navlinks', 'navlinks',
); );
extract($phpbb_dispatcher->trigger_event('core.generate_forum_nav', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.generate_forum_nav', compact($vars)));
$forum_data = $forum_data_ary;
unset($forum_data_ary);
$template->assign_block_vars_array('navlinks', $navlinks_parents); $template->assign_block_vars_array('navlinks', $navlinks_parents);
$template->assign_block_vars('navlinks', $navlinks); $template->assign_block_vars('navlinks', $navlinks);
@ -1237,17 +1240,21 @@ function display_user_activity(&$userdata)
} }
} }
$userdata_ary = $userdata;
/** /**
* Alter list of forums and topics to display as active * Alter list of forums and topics to display as active
* *
* @event core.display_user_activity_modify_actives * @event core.display_user_activity_modify_actives
* @var array userdata User's data * @var array userdata_ary User's data
* @var array active_f_row List of active forums * @var array active_f_row List of active forums
* @var array active_t_row List of active posts * @var array active_t_row List of active posts
* @since 3.1.0-RC3 * @since 3.1.0-RC3
* @change 3.1.7-RC1 Replaced userdata with userdata_ary
*/ */
$vars = array('userdata', 'active_f_row', 'active_t_row'); $vars = array('userdata_ary', 'active_f_row', 'active_t_row');
extract($phpbb_dispatcher->trigger_event('core.display_user_activity_modify_actives', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.display_user_activity_modify_actives', compact($vars)));
$userdata = $userdata_ary;
unset($userdata_ary);
$userdata['active_t_row'] = $active_t_row; $userdata['active_t_row'] = $active_t_row;
$userdata['active_f_row'] = $active_f_row; $userdata['active_f_row'] = $active_f_row;