blob: 5966cf8023da14e9b4e322945a6af01960bf3a70 (
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
|
<?php
/**
* @package stock
* @subpackage functions
*/
namespace Bitweaver\Stock;
require_once '../kernel/includes/setup_inc.php';
global $gBitSystem, $gBitSmarty, $gStockAssembly;
$gStockAssembly = new StockAssembly();
if( !empty( $_REQUEST['gallery_id'] ) && is_numeric( $_REQUEST['gallery_id'] ) ) {
$parentAssembly = new StockAssembly( (int)$_REQUEST['gallery_id'] );
$parentAssembly->load();
if( $parentAssembly->isValid() ) {
$_REQUEST['parent_content_id'] = $parentAssembly->mContentId;
$_REQUEST['show_empty'] = true;
$gBitSmarty->assign( 'parentAssembly', $parentAssembly );
}
} else {
$_REQUEST['show_empty'] = true;
$_REQUEST['no_thumbnails'] = true;
}
if (!empty($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) {
if( $_REQUEST['user_id'] == $gBitUser->mUserId ) {
$_REQUEST['show_empty'] = true;
}
$gBitSmarty->assign('gQueryUserId', $_REQUEST['user_id']);
$template = 'user_galleries.tpl';
} else {
$template = 'list_assemblies.tpl';
}
$galleryList = $gStockAssembly->getList( $_REQUEST );
$gStockAssembly->invokeServices( 'content_list_function', $_REQUEST );
$_REQUEST['listInfo']['parameters'] = array_filter( [
'user_id' => !empty( $_REQUEST['user_id'] ) ? (int)$_REQUEST['user_id'] : '',
'gallery_id' => !empty( $_REQUEST['gallery_id'] ) ? (int)$_REQUEST['gallery_id'] : '',
] );
$gBitSmarty->assign( 'listInfo', $_REQUEST['listInfo'] );
$gBitSmarty->assign( 'galleryList', $galleryList );
$gDefaultCenter = "bitpackage:stock/$template";
$gBitSmarty->assign( 'gDefaultCenter', $gDefaultCenter );
$gBitSystem->display( 'bitpackage:kernel/dynamic.tpl', 'List Assemblies', [ 'display_mode' => 'list' ] );
|