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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
<?php
use Bitweaver\KernelTools;
$formGalleryGeneral = [
"stock_menu_text" => [
'label' => 'Menu Text',
'note' => '',
'type' => 'text',
],
"stock_show_public_on_upload" => [
'label' => 'Show Public Assemblies on Upload',
'note' => 'Enable this if you want to have all public assemblies visible when adding components. This might cause problems on large sites with many public assemblies.',
'type' => 'checkbox',
],
"stock_show_all_to_admins" => [
'label' => 'Show all Assemblies to Administrators',
'note' => 'This will allow assembly admins to move components between all assemblies.',
'type' => 'checkbox',
],
];
$gBitSmarty->assign('formGalleryGeneral', $formGalleryGeneral);
$formGalleryListLists = [
"stock_list_title" => [
'label' => 'Assembly title',
'note' => 'List the title of the assembly.',
],
"stock_list_thumbnail" => [
'label' => 'Thumbnail',
'note' => 'Display a cover thumbnail associated with an assembly',
],
"stock_list_description" => [
'label' => 'Description',
'note' => 'List the description of an assembly',
],
"stock_list_user" => [
'label' => 'Creator',
'note' => 'List the name of the user who created the assembly',
],
"stock_list_hits" => [
'label' => 'Hits',
'note' => 'List number of hits this assembly has received',
],
"stock_list_created" => [
'label' => 'Creation date',
'note' => 'List the creation date of the assembly',
],
"stock_list_lastmodif" => [
'label' => 'Last modification',
'note' => 'List date this assembly was last modified',
],
];
$gBitSmarty->assign('formGalleryListLists', $formGalleryListLists);
$formGalleryLists = [
"stock_gallery_list_title" => [
'label' => 'Assembly title',
'note' => 'When viewing an assembly, display the title',
],
"stock_gallery_list_description" => [
'label' => 'Assembly description',
'note' => 'When viewing an assembly, display the description below the title',
],
"stock_gallery_list_image_titles" => [
'label' => 'Component titles',
'note' => 'Show component titles in grid layouts',
],
"stock_gallery_list_image_descriptions" => [
'label' => 'Component descriptions',
'note' => 'Show component descriptions in grid layouts',
],
];
$gBitSmarty->assign( 'formGalleryLists', $formGalleryLists );
$formImageLists = [
"stock_item_list_desc" => [
'label' => 'Component description',
'note' => 'Show component description in list and position views',
],
"stock_item_list_date" => [
'label' => 'Created date',
'note' => 'Show the date the component was created',
],
"stock_item_list_creator" => [
'label' => 'Creator',
'note' => 'Show the name of the user who created the component',
],
"stock_item_list_hits" => [
'label' => 'Views',
'note' => 'Show the view count for each component',
],
"stock_item_list_attid" => [
'label' => 'Plugin tag',
'note' => 'Show the wiki plugin tag that can be used to embed this component',
],
];
$gBitSmarty->assign( 'formImageLists', $formImageLists );
use Bitweaver\Stock\StockAssembly;
$gBitSmarty->assign( 'galleryPaginationTypes', StockAssembly::getAllLayouts() );
$sortOptions = [
'' => KernelTools::tra( 'None' ),
'lc.title_desc' => KernelTools::tra( 'Title' ). ' - '.KernelTools::tra( 'descending' ),
'lc.title_asc' => KernelTools::tra( 'Title' ). ' - '.KernelTools::tra( 'ascending' ),
'lc.created_desc' => KernelTools::tra( 'Created' ). ' - '.KernelTools::tra( 'descending' ),
'lc.created_asc' => KernelTools::tra( 'Created' ). ' - '.KernelTools::tra( 'ascending' ),
'lc.last_modified_desc' => KernelTools::tra( 'Last Modified' ). ' - '.KernelTools::tra( 'descending' ),
'lc.last_modified_asc' => KernelTools::tra( 'Last Modified' ). ' - '.KernelTools::tra( 'ascending' ),
];
$gBitSmarty->assign( 'sortOptions', $sortOptions );
if (!empty($_REQUEST['stockAdminSubmit'])) {
foreach ($formGalleryGeneral as $item => $data) {
if( $data['type'] == 'checkbox' ) {
simple_set_toggle($item, STOCK_PKG_NAME);
} else {
$gBitSystem->storeConfig($item, $_REQUEST[$item], STOCK_PKG_NAME);
}
}
foreach ($formGalleryListLists as $item => $data) {
simple_set_toggle($item, STOCK_PKG_NAME);
}
foreach ($formGalleryLists as $item => $data) {
simple_set_toggle($item, STOCK_PKG_NAME);
}
foreach( [ 'default_assembly_pagination', 'rows_per_page', 'cols_per_page', 'total_per_page', 'lines_per_page', 'stock_gallery_default_sort_mode' ] as $key ) {
$gBitSystem->storeConfig($key, $_REQUEST[$key], STOCK_PKG_NAME);
}
foreach ($formImageLists as $item => $data) {
simple_set_toggle( $item, STOCK_PKG_NAME );
}
}
|