summaryrefslogtreecommitdiff
path: root/admin/plugins/mime_image.php
blob: 68cc0019b03c1459ea4b2212e03475a6fcc2e038 (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
<?php
require_once( '../../../kernel/setup_inc.php' );
include_once( KERNEL_PKG_PATH.'simple_form_functions_lib.php' );

$gBitSystem->verifyPermission( 'p_admin' );

$settings = array(
	'mime_image_panoramas' => array(
		'label' => 'Panorama Images',
		'note' => 'When users upload 360&deg; panoramic images, they can enable a flash viewer to view these. This can greatly enhance the image viewing experience for panoramic images. (<a class="external" href="http://pan0.net/fspp">example</a>)',
		'type' => 'checkbox',
	),
);
$gBitSmarty->assign( 'settings', $settings );

$panWidth = array(
	1500 => '1500 x 750',
	2000 => '2000 x 1000 (about 1MB)',
	2500 => '2500 x 1250',
	3000 => '3000 x 1500 (about 2MB)',
	3500 => '3500 x 1750',
	4000 => '4000 x 2000 (about 3-4MB)',
	4500 => '4500 x 2250',
	5000 => '5000 x 2500 (about 5-6MB)',
);
$gBitSmarty->assign( 'panWidth', $panWidth );

if( $gBitSystem->getConfig( 'image_processor' ) != 'magickwand' ) {
	$gBitSmarty->assign( 'image_processor_warning', TRUE );
}

$feedback = array();
if( !empty( $_REQUEST['settings_store'] )) {
	foreach( $settings as $item => $data ) {
		if( $data['type'] == 'checkbox' ) {
			simple_set_toggle( $item, TREASURY_PKG_NAME );
		} elseif( $data['type'] == 'numeric' ) {
			simple_set_int( $item, TREASURY_PKG_NAME );
		} else {
			$gBitSystem->storeConfig( $item, ( !empty( $_REQUEST[$item] ) ? $_REQUEST[$item] : NULL ), TREASURY_PKG_NAME );
		}
	}
	simple_set_int( 'mime_image_panorama_width', $_REQUEST['mime_image_panorama_width'] );
}
$gBitSmarty->assign( 'feedback', $feedback );
$gBitSystem->display( 'bitpackage:liberty/mime/image/admin.tpl', tra( 'Image Plugin Settings' ), array( 'display_mode' => 'admin' ));
?>