source: extensions/stripped/admin/admin.inc.php @ 31574

Last change on this file since 31574 was 30459, checked in by plg, 10 years ago

avoid using load_conf_from_db

File size: 3.1 KB
Line 
1<?php
2
3global $conf;
4
5// Need upgrade?
6if (!isset($conf['stripped']))
7  include(PHPWG_THEMES_PATH.'stripped/admin/upgrade.inc.php');
8
9$stripped = unserialize( $conf['stripped'] );
10
11// Need upgrade from v1.x?
12if (!isset($stripped['themeStyle'])) {
13        include(PHPWG_THEMES_PATH.'stripped/admin/upgrade.inc.php');
14        $stripped = array_merge( unserialize( $conf['stripped'] ), (array)$stripped );
15}
16
17// Need upgrade from v2.x?
18if (!isset($stripped['paramVersion'])) {
19        include(PHPWG_THEMES_PATH.'stripped/admin/upgrade.inc.php');
20        $stripped = array_merge( unserialize( $conf['stripped'] ), (array)$stripped );
21}
22
23load_language('theme.lang', PHPWG_THEMES_PATH.'stripped/');
24
25$config= array ();
26
27if(isset($_POST['submit_stripped']))
28{
29        $config['paramVersion']='2.3';
30
31        $config['themeStyle']=$_POST['f_themeStyle'];
32        $config['hideMenu']=isset($_POST['f_hideMenu']);
33        $config['animatedMenu']=isset($_POST['f_animatedMenu']);
34        $config['noLowercase']=!isset($_POST['f_forceLowercase']);
35        $config['albumType']=$_POST['f_albumType'];
36        $config['albumFrame']=isset($_POST['f_albumFrame']);
37        $config['thumbFrame']=isset($_POST['f_thumbFrame']);
38        $config['showThumbLegend']=isset($_POST['f_showThumbLegend']);
39
40        $config['showTitleOnBrowsePath']=isset($_POST['f_showTitleOnBrowsePath']);
41        $config['imageFrame']=isset($_POST['f_imageFrame']);
42        $config['imageCaption']=$_POST['f_imageCaption'];
43        $config['imageArrows']=isset($_POST['f_imageArrows']);
44        $config['navArrows']=isset($_POST['f_navArrows']);
45        $config['HDlightbox']=($_POST['f_lightboxOptions'] != 'never');
46        $config['forceLightboxOn']=($_POST['f_lightboxOptions'] == 'always');
47        $config['defaultZoomSize']=$_POST['f_defaultZoomSize'];
48        $config['animatedTabs']=isset($_POST['f_animatedTabs']);
49        $config['infoTabAdminOnly']=isset($_POST['f_infoTabAdminOnly']);
50        $config['defaultTab']=$_POST['f_defaultTab'];
51
52        $config['albumSize']=$_POST['f_albumSize'];
53        $config['thumbSize']=$_POST['f_thumbSize'];
54        $config['imageSize']=$_POST['f_imageSize'];
55        $config['hdSize']=$_POST['f_hdSize'];
56
57        $config['imageAutosize']=isset($_POST['f_imageAutosize']);
58        if (isset($_POST['f_imageAutosizeMargin'])) { $config['imageAutosizeMargin']=intval($_REQUEST['f_imageAutosizeMargin']); }
59        if (isset($_POST['f_imageAutosizeMinHeight'])) { $config['imageAutosizeMinHeight']=intval($_REQUEST['f_imageAutosizeMinHeight']); }
60
61        $config['imagePreload']=isset($_POST['f_imagePreload']);
62        $config['imagePreloadNb']=$_POST['f_imagePreloadNb'];
63        $config['imagePreloadThumbs']=isset($_POST['f_imagePreloadThumbs']);
64        $config['imagePreloadHD']=false;
65
66        $config['marginContainer']=30;
67        $config['paddingContainer']=10;
68        $config['highResClickMode']='zoom';
69        $config['maxThumb']=15;
70
71        conf_update_param('stripped', $config, true);
72        array_push($page['infos'], l10n('stripped Configuration updated'));
73}
74
75$template->set_filenames(array(
76    'theme_admin_content' => dirname(__FILE__) . '/admin.tpl'));
77
78$template->assign('options', safe_unserialize($conf['stripped']));
79
80$template->assign_var_from_handle('ADMIN_CONTENT', 'theme_admin_content');
81 
82?>
Note: See TracBrowser for help on using the repository browser.