summaryrefslogtreecommitdiff
path: root/templates/center_list_assemblies.php
blob: c50b0c9dfa89eb198fcd7590ba64bb607369e3bb (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
46
47
48
49
50
51
52
53
54
55
56
57
<?php
global $gQueryUser;
if( !empty( $moduleParams ) ) {
	extract( $moduleParams );
}
use Bitweaver\Stock\StockAssembly;
use Bitweaver\BitBase;

$gStockAssembly = new StockAssembly();

/* Get a list of galleries which matches the imput paramters (default is to list every gallery in the system) */
$listHash['root_only'] = true;
$listHash['get_thumbnails'] = true;
/*	Not supported in StockAssembly::getList
if( !empty( $module_params['assembly_id'] ) && is_numeric( $module_params['assembly_id'] ) ) {
	$listHash['assembly_id'] = $module_params['assembly_id'];
}*/
if ($gQueryUserId) {
	$listHash['user_id'] = $gQueryUserId;
} elseif( !empty( $module_params['user_id'] ) && BitBase::verifyId( $module_params['user_id'] ) ) {
	$listHash['user_id'] = $module_params['user_id'];
}
if( !empty( $module_params['contain_item'] ) && BitBase::verifyId( $module_params['contain_item'] ) ) {
	$listHash['contain_item'] = $module_params['contain_item'];
}
$listHash['sort_mode'] = !empty( $module_params['sort_mode'] )
	? $module_params['sort_mode']
	: 'created_desc';
if( !empty( $module_params['nav_bar'] ) ){
	$gBitSmarty->assign('navBar', $module_params['nav_bar']);
}else{
	$gBitSmarty->assign('navBar',true);
}
if( !empty( $module_params['max_records'] ) ){
	$listHash['max_records'] = $module_params['max_records'];
}

$galleryList = $gStockAssembly->getList( $listHash );
// support for div/ul/li listing of galleries
$gBitSmarty->assign( 'galleryList', $galleryList );

/* Process the input parameters this page accepts */
if (!empty($gQueryUser) && $gQueryUser->isRegistered()) {
	$gBitSmarty->assign('gQueryUserId', $gQueryUser->mUserId);
	$template = 'user_galleries.tpl';
} else {
	$template = 'list_assemblies.tpl';
}
if (!empty($_REQUEST['offset']) && is_numeric($_REQUEST['offset'])) {
	$gBitSmarty->assign('iMaxRows', $iMaxRows);
}
if (!empty($_REQUEST['sort_mode'])) {
	$gBitSmarty->assign('iSortMode', $_REQUEST['sort_mode']);
}
if (!empty($_REQUEST['search'])) {
	$gBitSmarty->assign('iSearchString', $iSearchtring);
}