From 9bce3c067e11fd85025f29a599806617fe0bce92 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 25 Nov 2006 19:28:06 +0000 Subject: [PATCH] r1327: Finished off the pagination system for the admin section so now the showall users works --- admin/global.php | 66 +++++++++++++++++++++++++++++ admin/user.php | 4 +- docs/changes.txt | 1 + docs/todo.txt | 1 - includes/class_admin_navigation.php | 2 +- 5 files changed, 71 insertions(+), 3 deletions(-) diff --git a/admin/global.php b/admin/global.php index 0d9949b..ff7b44e 100755 --- a/admin/global.php +++ b/admin/global.php @@ -102,6 +102,72 @@ if (!$_COOKIE[COOKIE_PREFIX . 'adminsession']) admin_login(); } +// ################################################################### + +// ################################################################### +/** +* Callback function for the Pagination->BitProcessor() +* +* @param string Base link +* @param bool Do not show this as a link +* @param integer Page number +* @param object Page navigator framework +* +* @return string Processed HTML +*/ +function AdminPageNavigatorBitCallback($baselink, $nolink, $number, $paginator) +{ + if ($nolink) + { + return '' . $number . '' . "\n"; + } + else + { + return '' . $number . '' . "\n"; + } +} + +// ################################################################### +/** +* Callback function for the Pagination->NavigatorProcessor() +* +* @param string Base URL +* @param integer Next page number +* @param integer Previous page number +* @param array Show information +* @param string Individual page bits +* @param object Page navigator framework +* +* @return string Processed HTML +*/ +function AdminPageNavigatorCallback($baselink, $nextpage, $prevpage, $show, $pagebits, $paginator) +{ + global $stylevar; + + $return = ''; + + if ($show['first']) + { + $return .= '' . _('First') . ' ...'; + } + if ($show['prev']) + { + $return .= '' . _('Prev') . ' ...'; + } + + $return .= $pagebits; + + if ($show['next']) + { + $return .= '... ' . _('Next') . ''; + } + if ($show['last']) + { + $return .= '... ' . _('Last') . ''; + } + return '
' . $return . '
'; +} + /*=====================================================================*\ || ################################################################### || # $HeadURL$ diff --git a/admin/user.php b/admin/user.php index 146af46..00a39c6 100644 --- a/admin/user.php +++ b/admin/user.php @@ -362,9 +362,11 @@ if ($_REQUEST['do'] == 'search') if ($_REQUEST['do'] == 'showall') { NavLinks::usersAdd(); - $navigator->set_focus('link', 'users-showall', 'users-pages'); + $navigator->set_focus('link', 'users-showall', 'users'); LoadPaginationFramework(); + $pagination->setBitProcessor('AdminPageNavigatorBitCallback'); + $pagination->setNavigatorProcessor('AdminPageNavigatorCallback'); $admin->page_start(_('Show All Users')); $admin->table_start(); diff --git a/docs/changes.txt b/docs/changes.txt index 6fb9410..6109214 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,6 +1,7 @@ 1.2.0 Beta 1 =============================== - When a user does not have any favorites in his list, show a message instead of an empty screen +- Added the ability to show all the users in a paginated list in the admin section (bug://report/55) 1.1.4 =============================== diff --git a/docs/todo.txt b/docs/todo.txt index ac34cbb..0888240 100755 --- a/docs/todo.txt +++ b/docs/todo.txt @@ -14,7 +14,6 @@ BUGDAR 1.2 - Parse links in bug comments (bug://report/2) - XML export of bug data (bug://report/41) - Importing from other bug systems (bug://report/41) -- A paginated "Show All Users" command in the admin section (bug://report/55) - Workflow interface ############################################################################### diff --git a/includes/class_admin_navigation.php b/includes/class_admin_navigation.php index 0343c78..e2eebcb 100644 --- a/includes/class_admin_navigation.php +++ b/includes/class_admin_navigation.php @@ -355,7 +355,7 @@ class NavLinks global $navigator; $navigator->add_component('section', 'users', 'users', _('Users'), null); - // $navigator->add_component('link', 'users-showall', 'users', _('Show All Users'), 'user.php?do=showall'); + $navigator->add_component('link', 'users-showall', 'users', _('Show All Users'), 'user.php?do=showall'); $navigator->add_component('link', 'users-add', 'users', _('Add New User'), 'user.php?do=add'); } -- 2.22.5