[ticket/12153] Assign PAGE_NUMBER in pagination.generate_template_pagination()

PHPBB3-12153
This commit is contained in:
Cesar G 2014-02-02 12:49:04 -08:00
parent d50b8df364
commit 06e9959648

View file

@ -76,14 +76,11 @@ class pagination
public function generate_template_pagination($base_url, $block_var_name, $start_name, $num_items, $per_page, $start = 1, $reverse_count = false, $ignore_on_page = false)
{
$total_pages = ceil($num_items / $per_page);
if ($total_pages == 1 || !$num_items)
{
return;
}
$on_page = $this->get_on_page($per_page, $start);
$u_previous_page = $u_next_page = '';
if ($total_pages > 1)
{
if ($reverse_count)
{
$start_page = ($total_pages > 5) ? $total_pages - 4 : 1;
@ -178,6 +175,7 @@ class pagination
'S_IS_ELLIPSIS' => false,
));
}
}
// If the block_var_name is a nested block, we will use the last (most
// inner) block as a prefix for the template variables. If the last block
@ -203,6 +201,7 @@ class pagination
'U_' . $tpl_prefix . 'NEXT_PAGE' => ($on_page != $total_pages) ? $u_next_page : '',
$tpl_prefix . 'TOTAL_PAGES' => $total_pages,
$tpl_prefix . 'CURRENT_PAGE' => $on_page,
$tpl_prefix . 'PAGE_NUMBER' => $this->on_page($base_url, $num_items, $per_page, $start),
);
if ($tpl_block_name)