summaryrefslogtreecommitdiff
path: root/list.php
blob: 0afce88045401aeab1fa2be4f0ebdb2bc2252f12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
 * $Header
 *
 * @author   xing <xing@synapse.plus.com>
 * @version  $Revision$
 * @package  pigeonholes
 * @subpackage functions
 */

/**
 * required setup
 */
use Bitweaver\KernelTools;
require_once("../kernel/includes/setup_inc.php");

$gBitSystem->verifyPackage( 'pigeonholes' );
$gBitSystem->verifyPermission( 'p_pigeonholes_view' );

include_once( PIGEONHOLES_PKG_INCLUDE_PATH.'lookup_pigeonholes_inc.php' );

$listHash = &$_REQUEST;
$listHash['load_only_root'] = true;
$listHash['sort_mode'] = !empty( $listHash['sort_mode'] ) ? $listHash['sort_mode'] : 'title_asc';
$listHash['parse_data'] = true;
$pigeonList = $gContent->getList( $listHash );

// set up structure related stuff
if( !empty( $pigeonList ) ) {
	foreach( $pigeonList as $key => $pigeonhole ) {
		if( empty( $gStructure ) ) {
			$gStructure = new LibertyStructure();
		}
		$pigeonList[$key]['subtree'] = $gStructure->getSubTree( $pigeonhole['root_structure_id'] );
		// add permissions to all so we know if we can display pages within category
//		foreach( $pigeonList[$key]['subtree'] as $k => $node ) {
//			$pigeonList[$key]['subtree'][$k]['preferences'] = $gContent->loadPreferences( $node['content_id'] );
//		}
	}
	$gBitSmarty->assign( 'pigeonList', $pigeonList );
}
$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );

$gBitSystem->display( 'bitpackage:pigeonholes/list.tpl', KernelTools::tra( 'List Categories' ) , [ 'display_mode' => 'list' ]);
?>