summaryrefslogtreecommitdiff
path: root/admin/index.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2005-12-09 07:07:05 +0000
committerChristian Fowler <spider@viovio.com>2005-12-09 07:07:05 +0000
commitac962a4f1f1158ddc11b3ed5567dadb7bedf7158 (patch)
tree6c5c245ef452840e47a47393bbb605a2c7e28a58 /admin/index.php
parente7bc7b34fbd41030b3df705700c3fb9caaa54b19 (diff)
downloadnewsletters-ac962a4f1f1158ddc11b3ed5567dadb7bedf7158.tar.gz
newsletters-ac962a4f1f1158ddc11b3ed5567dadb7bedf7158.tar.bz2
newsletters-ac962a4f1f1158ddc11b3ed5567dadb7bedf7158.zip
clean up admin for getList function
Diffstat (limited to 'admin/index.php')
-rw-r--r--admin/index.php39
1 files changed, 8 insertions, 31 deletions
diff --git a/admin/index.php b/admin/index.php
index cb67726..5a98885 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -1,6 +1,6 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/Attic/index.php,v 1.2 2005/12/09 07:04:17 spiderr Exp $
+// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/Attic/index.php,v 1.3 2005/12/09 07:07:05 spiderr Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
@@ -78,44 +78,21 @@ if (isset($_REQUEST["save"])) {
$gBitSmarty->assign('info', $info);
}
-if ( empty( $_REQUEST["sort_mode"] ) ) {
- $sort_mode = 'created_desc';
-} else {
- $sort_mode = $_REQUEST["sort_mode"];
-}
-
-if (!isset($_REQUEST["offset"])) {
- $offset = 0;
-} else {
- $offset = $_REQUEST["offset"];
-}
-
-$gBitSmarty->assign_by_ref('offset', $offset);
-
-if (isset($_REQUEST["find"])) {
- $find = $_REQUEST["find"];
-} else {
- $find = '';
-}
-
-$gBitSmarty->assign('find', $find);
-
-$gBitSmarty->assign_by_ref('sort_mode', $sort_mode);
-$channels = $nllib->list_newsletters($offset, $maxRecords, $sort_mode, $find);
+$channels = $nllib->getList( $listHash );
-$cant_pages = ceil($channels["cant"] / $maxRecords);
+$cant_pages = ceil( $channels["cant"] / $listHash['max_records'] );
$gBitSmarty->assign_by_ref('cant_pages', $cant_pages);
-$gBitSmarty->assign('actual_page', 1 + ($offset / $maxRecords));
+$gBitSmarty->assign( 'actual_page', 1 + ( $listHash['offset'] / $listHash['max_records'] ) );
-if ($channels["cant"] > ($offset + $maxRecords)) {
- $gBitSmarty->assign('next_offset', $offset + $maxRecords);
+if( $channels["cant"] > ( $listHash['offset'] + $listHash['max_records'] ) ) {
+ $gBitSmarty->assign( 'next_offset', $offset + $listHash['max_records'] );
} else {
$gBitSmarty->assign('next_offset', -1);
}
// If offset is > 0 then prev_offset
-if ($offset > 0) {
- $gBitSmarty->assign('prev_offset', $offset - $maxRecords);
+if( $listHash['offset'] > 0) {
+ $gBitSmarty->assign('prev_offset', $listHash['offset'] - $listHash['max_records']);
} else {
$gBitSmarty->assign('prev_offset', -1);
}