summaryrefslogtreecommitdiff
path: root/list.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2006-01-17 13:40:50 +0000
committerMax Kremmel <xing@synapse.plus.com>2006-01-17 13:40:50 +0000
commitfbd7236704470e9faf6e0c6ad9faaa9fe38cec77 (patch)
treeb860ba81248cb17b3f200496c35a645c2bf555d3 /list.php
parent35bab2b8201cba59a0bb53fdd1111ce49abb1573 (diff)
downloadpigeonholes-fbd7236704470e9faf6e0c6ad9faaa9fe38cec77.tar.gz
pigeonholes-fbd7236704470e9faf6e0c6ad9faaa9fe38cec77.tar.bz2
pigeonholes-fbd7236704470e9faf6e0c6ad9faaa9fe38cec77.zip
bring getList() up to the new standards and use pagination when listing categories
Diffstat (limited to 'list.php')
-rw-r--r--list.php32
1 files changed, 9 insertions, 23 deletions
diff --git a/list.php b/list.php
index 44c2c55..e1bcdf6 100644
--- a/list.php
+++ b/list.php
@@ -3,7 +3,7 @@
* $Header
*
* @author xing <xing@synapse.plus.com>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
* @package pigeonholes
* @subpackage functions
*/
@@ -18,35 +18,21 @@ $gBitSystem->verifyPermission( 'bit_p_view_pigeonholes' );
include_once( PIGEONHOLES_PKG_PATH.'lookup_pigeonholes_inc.php' );
-// some specific offsets and pagination settings
-if( !empty( $_REQUEST['sort_mode'] ) ) {
- $gBitSmarty->assign( 'sort_mode', $_REQUEST['sort_mode'] );
-}
-
-$gBitSmarty->assign( 'curPage', $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1 );
-$listHash = array(
- 'sort_mode' => !empty( $_REQUEST['sort_mode'] ) ? $_REQUEST['sort_mode'] : 'title_asc',
- 'max_rows' => $gBitSystem->mPrefs['maxRecords'],
- 'offset' => ( $page - 1 ) * $gBitSystem->mPrefs['maxRecords'],
- 'find' => !empty( $_REQUEST['find'] ) ? $_REQUEST['find'] : NULL,
- 'load_only_root' => TRUE,
-);
-
+$listHash = &$_REQUEST;
+$listHash['load_only_root'] = TRUE;
+$listHash['sort_mode'] = !empty( $listHash['sort_mode'] ) ? $listHash['sort_mode'] : 'title_asc';
$pigeonList = $gPigeonholes->getList( $listHash );
// set up structure related stuff
-if( !empty( $pigeonList['data'] ) ) {
- foreach( $pigeonList['data'] as $key => $pigeonhole ) {
+if( !empty( $pigeonList ) ) {
+ foreach( $pigeonList as $key => $pigeonhole ) {
$gStructure = new LibertyStructure( $pigeonhole['root_structure_id'] );
$gStructure->load();
- $pigeonList['data'][$key]['subtree'] = $gStructure->getSubTree( $gStructure->mStructureId );
+ $pigeonList[$key]['subtree'] = $gStructure->getSubTree( $gStructure->mStructureId );
}
- $gBitSmarty->assign( 'pigeonList', $pigeonList['data'] );
+ $gBitSmarty->assign( 'pigeonList', $pigeonList );
}
-
-//$gBitSmarty->assign_by_ref('offset', $offset);
-$gBitSmarty->assign( 'pigeonCount', $pigeonList['cant'] );
-$gBitSmarty->assign( 'numPages', ceil( $pigeonList['cant'] / $gBitSystem->mPrefs['maxRecords'] ) );
+$gBitSmarty->assign( 'listInfo', $listHash['control'] );
$gBitSystem->display( 'bitpackage:pigeonholes/list.tpl', tra( 'List Pigeonholes' ) );
?>