From 94592679c012e0ea2c95a399bed5eb5a811a5eba Mon Sep 17 00:00:00 2001 From: bettina Date: Thu, 28 Jun 2001 20:10:52 +0000 Subject: [PATCH] update showing number of items --- admin/categories.php | 25 ++----------------------- preferences/categories.php | 29 +++-------------------------- 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/admin/categories.php b/admin/categories.php index 77c7d62482..44dff1003a 100644 --- a/admin/categories.php +++ b/admin/categories.php @@ -12,7 +12,7 @@ /* $Id$ */ $phpgw_info['flags'] = array('currentapp' => 'admin', - 'enable_nextmatchs_class' => True); + 'enable_nextmatchs_class' => True); include('../header.inc.php'); @@ -39,15 +39,6 @@ if (! $start) { $start = 0; } - if($phpgw_info['user']['preferences']['common']['maxmatchs'] && $phpgw_info['user']['preferences']['common']['maxmatchs'] > 0) - { - $limit = $phpgw_info['user']['preferences']['common']['maxmatchs']; - } - else - { - $limit = 15; - } - $c = CreateObject('phpgwapi.categories'); $c->app_name = 'phpgw'; $categories = $c->return_array('all',$start,True,$query,$sort,$order,True); @@ -59,19 +50,7 @@ $t->set_var('left',$left); $t->set_var('right',$right); - if (($start + $limit) > $c->total_records) - { - $lang_showing = lang('showing x - x of x',($start + 1),$c->total_records,$c->total_records); - } - elseif ($c->total_records > $limit) - { - $lang_showing=lang('showing x - x of x',($start + 1),($start + $limit),$c->total_records); - } - else - { - $lang_showing=lang('showing x',$c->total_records); - } - $t->set_var('lang_showing',$lang_showing); + $t->set_var('lang_showing',$phpgw->nextmatchs->show_hits($c->total_records,$start)); // ------------------------------ end nextmatch ------------------------------------------ diff --git a/preferences/categories.php b/preferences/categories.php index 4306e0b790..7b0e3c5feb 100644 --- a/preferences/categories.php +++ b/preferences/categories.php @@ -9,13 +9,10 @@ * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \***************************************************************************/ - /* $Id$ */ - $phpgw_info['flags'] = array( - 'currentapp' => $cats_app, - 'enable_nextmatchs_class' => True - ); + $phpgw_info['flags'] = array('currentapp' => $cats_app, + 'enable_nextmatchs_class' => True); if (! $appheader) { @@ -60,15 +57,6 @@ if (! $start) { $start = 0; } - if($phpgw_info['user']['preferences']['common']['maxmatchs'] && $phpgw_info['user']['preferences']['common']['maxmatchs'] > 0) - { - $limit = $phpgw_info['user']['preferences']['common']['maxmatchs']; - } - else - { - $limit = 15; - } - $c = CreateObject('phpgwapi.categories'); $c->app_name = $cats_app; @@ -90,18 +78,7 @@ $t->set_var('left',$left); $t->set_var('right',$right); - if (($start + $limit) > $c->total_records) - { - $t->set_var('lang_showing',lang('showing x - x of x',($start + 1),$c->total_records,$c->total_records)); - } - elseif ($c->total_records > $limit) - { - $t->set_var('lang_showing',lang('showing x - x of x',($start + 1),($start + $limit),$c->total_records)); - } - else - { - $t->set_var('lang_showing',lang('showing x',$c->total_records)); - } + $t->set_var('lang_showing',$phpgw->nextmatchs->show_hits($c->total_records,$start)); // ------------------------------ end nextmatch ------------------------------------------