aboutsummaryrefslogtreecommitdiff
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-12-18 00:33:01 +0100
committerJoas Schilling <nickvergessen@gmx.de>2013-12-18 18:39:01 +0100
commitedd183b53a5941711befb66f85efb8756dec431d (patch)
treec38aaf9c5fbd34545a1d969721102aef76725274 /phpBB
parent[ticket/11849] Update some ACP modules with new pagination (diff)
downloadphpbb-edd183b53a5941711befb66f85efb8756dec431d.tar.gz
phpbb-edd183b53a5941711befb66f85efb8756dec431d.tar.bz2
phpbb-edd183b53a5941711befb66f85efb8756dec431d.zip
[ticket/11849] Update more MCP calls to pagination class
PHPBB3-11849
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php5
-rw-r--r--phpBB/includes/mcp/mcp_queue.php5
-rw-r--r--phpBB/includes/mcp/mcp_reports.php5
-rw-r--r--phpBB/includes/mcp/mcp_topic.php12
-rw-r--r--phpBB/includes/mcp/mcp_warn.php7
5 files changed, 17 insertions, 17 deletions
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index f0452b37a5..d0801a2b47 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -39,6 +39,7 @@ class mcp_pm_reports
include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
$start = request_var('start', 0);
+ $pagination = $phpbb_container->get('pagination');
$this->page_title = 'MCP_PM_REPORTS';
@@ -297,7 +298,7 @@ class mcp_pm_reports
}
$base_url = $this->u_action . "&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir";
- phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
// Now display the page
$template->assign_vars(array(
@@ -308,7 +309,7 @@ class mcp_pm_reports
'S_MCP_ACTION' => $this->u_action,
'S_CLOSED' => ($mode == 'pm_reports_closed') ? true : false,
- 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total, $config['topics_per_page'], $start),
+ 'PAGE_NUMBER' => $pagination->on_page($base_url, $total, $config['topics_per_page'], $start),
'TOTAL' => $total,
'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),
)
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index db461d07fa..d0b41fce43 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -337,6 +337,7 @@ class mcp_queue
$topic_id = $request->variable('t', 0);
$forum_info = array();
+ $pagination = $phpbb_container->get('pagination');
if ($topic_id)
{
@@ -532,7 +533,7 @@ class mcp_queue
unset($rowset, $forum_names);
$base_url = $this->u_action . "&amp;f=$forum_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir";
- phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
// Now display the page
$template->assign_vars(array(
@@ -546,7 +547,7 @@ class mcp_queue
'S_TOPICS' => $is_topics,
'S_RESTORE' => $is_restore,
- 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total, $config['topics_per_page'], $start),
+ 'PAGE_NUMBER' => $pagination->on_page($base_url, $total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $user->lang(((!$is_topics) ? 'VIEW_TOPIC_POSTS' : 'VIEW_FORUM_TOPICS'), (int) $total),
));
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 8db5bb9727..02892964f1 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -315,6 +315,7 @@ class mcp_reports
$forum_list[] = 0;
$forum_data = array();
+ $pagination = $phpbb_container->get('pagination');
$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
foreach ($forum_list_reports as $row)
@@ -410,7 +411,7 @@ class mcp_reports
}
$base_url = $this->u_action . "&amp;f=$forum_id&amp;t=$topic_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir";
- phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
// Now display the page
$template->assign_vars(array(
@@ -422,7 +423,7 @@ class mcp_reports
'S_FORUM_OPTIONS' => $forum_options,
'S_CLOSED' => ($mode == 'reports_closed') ? true : false,
- 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total, $config['topics_per_page'], $start),
+ 'PAGE_NUMBER' => $pagination->on_page($base_url, $total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total,
'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index a2aa03c583..a4c561a3bf 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -26,6 +26,7 @@ function mcp_topic_view($id, $mode, $action)
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
$user->add_lang('viewtopic');
+ $pagination = $phpbb_container->get('pagination');
$topic_id = request_var('t', 0);
$topic_info = get_topic_data(array($topic_id), false, true);
@@ -129,12 +130,7 @@ function mcp_topic_view($id, $mode, $action)
{
$start = 0;
}
-
- // Make sure $start is set to the last page if it exceeds the amount
- if ($start < 0 || $start >= $total)
- {
- $start = ($start < 0) ? 0 : floor(($total - 1) / $posts_per_page) * $posts_per_page;
- }
+ $start = $pagination->validate_start($start, $posts_per_page, $total);
$sql = 'SELECT u.username, u.username_clean, u.user_colour, p.*
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
@@ -304,7 +300,7 @@ function mcp_topic_view($id, $mode, $action)
$base_url = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;t={$topic_info['topic_id']}&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir");
if ($posts_per_page)
{
- phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total, $posts_per_page, $start);
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $posts_per_page, $start);
}
$template->assign_vars(array(
@@ -347,7 +343,7 @@ function mcp_topic_view($id, $mode, $action)
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start=$start") . '">', '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$topic_info['forum_id']}&amp;start=$start") . '">', '</a>'),
- 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total, $posts_per_page, $start),
+ 'PAGE_NUMBER' => $pagination->on_page($base_url, $total, $posts_per_page, $start),
'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total),
));
}
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index 3ffd75ac78..e39bddec5b 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -134,10 +134,11 @@ class mcp_warn
*/
function mcp_warn_list_view($action)
{
- global $phpEx, $phpbb_root_path, $config;
+ global $phpEx, $phpbb_root_path, $config, $phpbb_container;
global $template, $db, $user, $auth;
$user->add_lang('memberlist');
+ $pagination = $phpbb_container->get('pagination');
$start = request_var('start', 0);
$st = request_var('st', 0);
@@ -176,7 +177,7 @@ class mcp_warn
}
$base_url = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd");
- phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $user_count, $config['topics_per_page'], $start);
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $user_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'U_POST_ACTION' => $this->u_action,
@@ -185,7 +186,7 @@ class mcp_warn
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
- 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $user_count, $config['topics_per_page'], $start),
+ 'PAGE_NUMBER' => $pagination->on_page($base_url, $user_count, $config['topics_per_page'], $start),
'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $user_count),
));
}