mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-17 16:58:51 +00:00
Merge pull request #4352 from marc1706/ticket/14626
[ticket/14626] Event core.make_jumpbox_modify_tpl_ary
This commit is contained in:
commit
8d3716ab91
1 changed files with 24 additions and 5 deletions
|
@ -150,7 +150,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
|
||||||
*/
|
*/
|
||||||
function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false)
|
function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false)
|
||||||
{
|
{
|
||||||
global $config, $auth, $template, $user, $db, $phpbb_path_helper;
|
global $config, $auth, $template, $user, $db, $phpbb_path_helper, $phpbb_dispatcher;
|
||||||
|
|
||||||
// We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality)
|
// We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality)
|
||||||
if (!$config['load_jumpbox'] && $force_display === false)
|
if (!$config['load_jumpbox'] && $force_display === false)
|
||||||
|
@ -205,20 +205,21 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tpl_ary = array();
|
||||||
if (!$display_jumpbox)
|
if (!$display_jumpbox)
|
||||||
{
|
{
|
||||||
$template->assign_block_vars('jumpbox_forums', array(
|
$tpl_ary[] = array(
|
||||||
'FORUM_ID' => ($select_all) ? 0 : -1,
|
'FORUM_ID' => ($select_all) ? 0 : -1,
|
||||||
'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'],
|
'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'],
|
||||||
'S_FORUM_COUNT' => $iteration,
|
'S_FORUM_COUNT' => $iteration,
|
||||||
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)),
|
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)),
|
||||||
));
|
);
|
||||||
|
|
||||||
$iteration++;
|
$iteration++;
|
||||||
$display_jumpbox = true;
|
$display_jumpbox = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('jumpbox_forums', array(
|
$tpl_ary[] = array(
|
||||||
'FORUM_ID' => $row['forum_id'],
|
'FORUM_ID' => $row['forum_id'],
|
||||||
'FORUM_NAME' => $row['forum_name'],
|
'FORUM_NAME' => $row['forum_name'],
|
||||||
'SELECTED' => ($row['forum_id'] == $forum_id) ? ' selected="selected"' : '',
|
'SELECTED' => ($row['forum_id'] == $forum_id) ? ' selected="selected"' : '',
|
||||||
|
@ -227,7 +228,25 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
|
||||||
'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
|
'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
|
||||||
'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false,
|
'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false,
|
||||||
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])),
|
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])),
|
||||||
));
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify the jumpbox before it is assigned to the template
|
||||||
|
*
|
||||||
|
* @event core.make_jumpbox_modify_tpl_ary
|
||||||
|
* @var array row The data of the forum
|
||||||
|
* @var array tpl_ary Template data of the forum
|
||||||
|
* @since 3.1.10-RC1
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'row',
|
||||||
|
'tpl_ary',
|
||||||
|
);
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.make_jumpbox_modify_tpl_ary', compact($vars)));
|
||||||
|
|
||||||
|
$template->assign_block_vars_array('jumpbox_forums', $tpl_ary);
|
||||||
|
|
||||||
|
unset($tpl_ary);
|
||||||
|
|
||||||
for ($i = 0; $i < $padding; $i++)
|
for ($i = 0; $i < $padding; $i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue