diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2006-01-17 13:40:50 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2006-01-17 13:40:50 +0000 |
| commit | fbd7236704470e9faf6e0c6ad9faaa9fe38cec77 (patch) | |
| tree | b860ba81248cb17b3f200496c35a645c2bf555d3 /list.php | |
| parent | 35bab2b8201cba59a0bb53fdd1111ce49abb1573 (diff) | |
| download | pigeonholes-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.php | 32 |
1 files changed, 9 insertions, 23 deletions
@@ -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' ) ); ?> |
