summaryrefslogtreecommitdiff
path: root/admin/admin_fisheye_inc.php
blob: 278fd0b3ae6c3af6a22548b74cb748be6872fc0c (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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
//This holds the checkbox options for what to display on the 'list galleries' page
$formGalleryGeneral = array(
	"fisheye_menu_text" => array(
		'label' => 'Menu Text',
		'note' => '',
		'type' => 'text'
	),
/* Disabled for now - spiderr
	"feature_megaupload" => array(
		'label' => 'Use <a href="http://sourceforge.net/projects/megaupload">MegaUpload</a>',
		'note' => 'Upload progress meter that requires Perl and ExecCGI permission',
		'type' => 'checkbox'
	),
*/
	"liberty_offline_thumbnailer" => array(
		'label' => 'Background Thumbnailer',
		'note' => 'Thumbnails will be queued and regenerated by a background command-line script. For more information, see '.FISHEYE_PKG_PATH.'thumbaniler.php or you can <a href="'.FISHEYE_PKG_URL.'thumbnailer.php">run it manually</a>',
		'type' => 'checkbox'
	),
	"fisheye_show_public_on_upload" => array(
		'label' => 'Show Public Galleries on Upload',
		'note' => 'Enable this if you want to have all public galleries visible when uploading files. This might cause problems on large sites with many public galleries.',
		'type' => 'checkbox'
	),
	"fisheye_show_all_to_admins" => array(
		'label' => 'Show all Galleries to Administrators',
		'note' => 'This will allow gallery admins to upload and move around images in all galleries. This might cause problems on large sites with many galleries.',
		'type' => 'checkbox'
	),
);
if( !$gBitSystem->isPackageActive( 'gigaupload' ) ) {
	$formGalleryGeneral["fisheye_extended_upload_slots"] = array(
		'label' => 'Extended Upload Slots',
		'note' => 'When you enable this, users can enter the title and description of the file when uploading them.',
		'type' => 'checkbox'
	);
};
$gBitSmarty->assign('formGalleryGeneral', $formGalleryGeneral);

$formGalleryListLists = array(
	"fisheye_list_title" => array(
		'label' => 'Gallery title',
		'note' => 'List the title of the gallery.',
	),
	"fisheye_list_thumbnail" => array(
		'label' => 'Thumbnail',
		'note' => 'Display a small thumbnail associated with a gallery',
	),
	"fisheye_list_description" => array(
		'label' => 'Description',
		'note' => 'List the description of a gallery',
	),
	"fisheye_list_user" => array(
		'label' => 'Creator',
		'note' => 'List the name of the user who created the gallery',
	),
	"fisheye_list_hits" => array(
		'label' => 'Hits',
		'note' => 'List number of hits this gallery has receieved',
	),
	"fisheye_list_created" => array(
		'label' => 'Creation date',
		'note' => 'List the creation date of the gallery',
	),
	"fisheye_list_lastmodif" => array(
		'label' => 'Last modification',
		'note' => 'List date this gallery was last modified',
	),
);
$gBitSmarty->assign('formGalleryListLists', $formGalleryListLists);

// This holds the checkbox options for what to display on a 'view gallery' page
$formGalleryLists = array(
	"fisheye_gallery_list_title" => array(
		'label' => 'Gallery title',
		'note' => 'When viewing a gallery, display the title of the gallery',
	),
	"fisheye_gallery_list_description" => array(
		'label' => 'Gallery description',
		'note' => 'When viewing a gallery, display the description of the gallery below the title',
	),
	"fisheye_gallery_list_image_titles" => array(
		'label' => 'Image titles',
		'note' => 'Show image titles underneath each thumbnail',
	),
	"fisheye_gallery_hide_modules" => array(
		'label' => 'Hide modules for galleries',
		'note' => 'When viewing a gallery, hide the left and right module columns',
	),
	"fisheye_gallery_list_image_descriptions" => array(
		'label' => 'Image description',
		'note' => 'Show image descriptions underneath each thumbnail',
	),
	"fisheye_gallery_div_layout" => array(
		'label' => '&lt;div&gt; based Layout',
		'note' => 'You can use a &lt;div&gt; based layout, which will adjust the number of images in each row to the width of the browser. Please visit the online help for more information.',
		'page' => 'FisheyePackage',
	),
);
$gBitSmarty->assign( 'formGalleryLists',$formGalleryLists );

// This holds the checkbox options for what to display on an 'image details' page
$formImageLists = array(
	"fisheye_image_list_title" => array(
		'label' => 'Image title',
		'note' => 'When viewing an image, display the title of the image',
	),
	"fisheye_image_list_description" => array(
		'label' => 'Image description',
		'note' => 'When viewing an image, display the description of the image below the title',
	),
	"fisheye_image_hide_modules" => array(
		'label' => 'Hide modules for images',
		'note' => 'When viewing an image, hide the left and right module columns',
	),
	"gallerybar_use_icons" => array(
		'label' => 'Use icons in the gallery bar',
		'note' => 'When viewing an image, show <strong>previous</strong> and <strong>next</strong> links as images instead of words',
	),
	"gallery_bar_use_thumbnails" => array(
		'label' => 'Use Thumbnails in gallery bar',
		'note' => 'When viewing an image, show previous and next <strong>thumbnails</strong> with the appropriate links.',
	),
);
$gBitSmarty->assign( 'formImageLists', $formImageLists);

$sortOptions = array(
	''                      => tra( 'None' ),
	'lc.title_desc'         => tra( 'Image Title' ).  ' - '.tra( 'descending' ),
	'lc.title_asc'          => tra( 'Image Title' ).  ' - '.tra( 'ascending' ),
	'lc.created_desc'       => tra( 'Date Uploaded' ).' - '.tra( 'descending' ),
	'lc.created_asc'        => tra( 'Date Uploaded' ).' - '.tra( 'ascending' ),
	'lc.last_modified_desc' => tra( 'Last Modified' ).' - '.tra( 'descending' ),
	'lc.last_modified_asc'  => tra( 'Last Modified' ).' - '.tra( 'ascending' ),
);
$gBitSmarty->assign( 'sortOptions', $sortOptions );
$gBitSmarty->assign( 'imageSizes', get_image_size_options( FALSE ));

//vd($_REQUEST);
if (!empty($_REQUEST['fisheyeAdminSubmit'])) {
	// General Settings
	foreach ($formGalleryGeneral as $item=>$data) {
		if( $data['type'] == 'checkbox' ) {
			simple_set_toggle($item, FISHEYE_PKG_NAME);
		} else {
			$gBitSystem->storeConfig($item, $_REQUEST[$item], FISHEYE_PKG_NAME );
		}
	}

	// Gallery List Display Settings
	foreach ($formGalleryListLists as $item=>$data) {
		simple_set_toggle($item, FISHEYE_PKG_NAME);
	}

	// Gallery Display Settings
	foreach ($formGalleryLists as $item => $data) {
		simple_set_toggle($item, FISHEYE_PKG_NAME);
	}
	$gBitSystem->storeConfig('fisheye_list_thumbnail_size', $_REQUEST['list_thumbnail_size'], FISHEYE_PKG_NAME);
	$gBitSystem->storeConfig('fisheye_gallery_default_thumbnail_size', $_REQUEST['default_gallery_thumbnail_size'], FISHEYE_PKG_NAME);
	$gBitSystem->storeConfig('fisheye_gallery_default_rows_per_page', $_REQUEST['rows_per_page'], FISHEYE_PKG_NAME);
	$gBitSystem->storeConfig('fisheye_gallery_default_cols_per_page', $_REQUEST['cols_per_page'], FISHEYE_PKG_NAME);
	$gBitSystem->storeConfig('fisheye_gallery_default_sort_mode', $_REQUEST['fisheye_gallery_default_sort_mode'], FISHEYE_PKG_NAME);

	// Image Display Settings
	foreach ($formImageLists as $item => $data) {
		simple_set_toggle( $item, FISHEYE_PKG_NAME );
	}
	if( !empty( $_REQUEST['default_image_thumbnail_size'] ) ) {
		$gBitSystem->storeConfig('fisheye_image_default_thumbnail_size', $_REQUEST['default_image_thumbnail_size'], FISHEYE_PKG_NAME );
	}

}

?>