From 15f2a238e7920d143e5518b57a08a3685cab32a0 Mon Sep 17 00:00:00 2001 From: bettina Date: Thu, 28 Jun 2001 20:02:56 +0000 Subject: [PATCH] added new function to format the number of items --- phpgwapi/inc/class.nextmatchs.inc.php | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/phpgwapi/inc/class.nextmatchs.inc.php b/phpgwapi/inc/class.nextmatchs.inc.php index 3ec823305a..9dce987782 100644 --- a/phpgwapi/inc/class.nextmatchs.inc.php +++ b/phpgwapi/inc/class.nextmatchs.inc.php @@ -439,5 +439,36 @@ . "qfield=$qfield&start=$start" . $extra) . '">' . $text . ''; } + function show_hits($total_records = '',$start) + { + global $phpgw_info, $start; + + if ($phpgw_info['user']['preferences']['common']['maxmatchs'] && $phpgw_info['user']['preferences']['common']['maxmatchs'] > 0) + { + $limit = $phpgw_info['user']['preferences']['common']['maxmatchs']; + } + else + { + $limit = 15; + } + + if ($total_records > $limit) + { + if ($start + $limit > $total_records) + { + $end = $total_records; + } + else + { + $end = $start + $limit; + } + $f = lang('showing x - x of x',($start + 1),$end,$total_records); + } + else + { + $f = lang('showing x',$total_records); + } + return $f; + } } // End of nextmatchs class ?>