1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | pwgCumulus - a plugin for Piwigo | |
---|
4 | // +-----------------------------------------------------------------------+ |
---|
5 | // | Copyright(C) 2009-2010 Nicolas Roudaire http://www.nikrou.net | |
---|
6 | // +-----------------------------------------------------------------------+ |
---|
7 | // | This program is free software; you can redistribute it and/or modify | |
---|
8 | // | it under the terms of the GNU General Public License version 2 as | |
---|
9 | // | published by the Free Software Foundation | |
---|
10 | // | | |
---|
11 | // | This program is distributed in the hope that it will be useful, but | |
---|
12 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
13 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
14 | // | General Public License for more details. | |
---|
15 | // | | |
---|
16 | // | You should have received a copy of the GNU General Public License | |
---|
17 | // | along with this program; if not, write to the Free Software | |
---|
18 | // | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | |
---|
19 | // | MA 02110-1301 USA | |
---|
20 | // +-----------------------------------------------------------------------+ |
---|
21 | |
---|
22 | if (!defined('PHPWG_ROOT_PATH')) { |
---|
23 | die('Hacking attempt!'); |
---|
24 | } |
---|
25 | |
---|
26 | load_language('plugin.lang', PWG_CUMULUS_PLUGIN_LANG); |
---|
27 | |
---|
28 | $me = get_plugin_data($plugin_id); |
---|
29 | $save_config = false; |
---|
30 | |
---|
31 | if (!empty($_POST['submit'])) { |
---|
32 | if (!empty($_POST['pwg_cumulus_width']) && intval($_POST['pwg_cumulus_width'])!=$me->pwg_cumulus_width) { |
---|
33 | $me->pwg_cumulus_width = intval($_POST['pwg_cumulus_width']); |
---|
34 | array_push($GLOBALS['page']['infos'], $lang['Width updated']); |
---|
35 | $save_config = true; |
---|
36 | } |
---|
37 | if (!empty($_POST['pwg_cumulus_height']) && intval($_POST['pwg_cumulus_height'])!=$me->pwg_cumulus_height) { |
---|
38 | $me->pwg_cumulus_height = intval($_POST['pwg_cumulus_height']); |
---|
39 | array_push($GLOBALS['page']['infos'], $lang['Height updated']); |
---|
40 | $save_config = true; |
---|
41 | } |
---|
42 | if (!empty($_POST['pwg_cumulus_coeff']) && intval($_POST['pwg_cumulus_coeff'])!=$me->pwg_cumulus_coeff) { |
---|
43 | $me->pwg_cumulus_coeff = intval($_POST['pwg_cumulus_coeff']); |
---|
44 | array_push($GLOBALS['page']['infos'], $lang['Coefficient for tags size updated']); |
---|
45 | $save_config = true; |
---|
46 | } |
---|
47 | |
---|
48 | if (!empty($_POST['pwg_cumulus_color1']) && trim($_POST['pwg_cumulus_color1'])!=$me->pwg_cumulus_color1) { |
---|
49 | $me->pwg_cumulus_color1 = str_replace('#', '', $_POST['pwg_cumulus_color1']); |
---|
50 | array_push($GLOBALS['page']['infos'], $lang['Color 1 updated']); |
---|
51 | $save_config = true; |
---|
52 | } |
---|
53 | if (!empty($_POST['pwg_cumulus_color2']) && trim($_POST['pwg_cumulus_color2'])!=$me->pwg_cumulus_color2) { |
---|
54 | $me->pwg_cumulus_color2 = str_replace('#', '', $_POST['pwg_cumulus_color2']); |
---|
55 | array_push($GLOBALS['page']['infos'], $lang['Color 2 updated']); |
---|
56 | $save_config = true; |
---|
57 | } |
---|
58 | if (!empty($_POST['pwg_cumulus_hicolor']) && trim($_POST['pwg_cumulus_hicolor'])!=$me->pwg_cumulus_hicolor) { |
---|
59 | $me->pwg_cumulus_hicolor = str_replace('#', '', $_POST['pwg_cumulus_hicolor']); |
---|
60 | array_push($GLOBALS['page']['infos'], $lang['Mouseover color updated']); |
---|
61 | $save_config = true; |
---|
62 | } |
---|
63 | |
---|
64 | if ($save_config) { |
---|
65 | $me->save_config(); |
---|
66 | } |
---|
67 | } |
---|
68 | |
---|
69 | $GLOBALS['template']->set_filenames(array('plugin_admin_content' => PWG_CUMULUS_PLUGIN_TEMPLATE . '/admin.tpl')); |
---|
70 | $GLOBALS['template']->assign('PWG_CUMULUS_PLUGIN_CSS', PWG_CUMULUS_PLUGIN_CSS); |
---|
71 | $GLOBALS['template']->assign('PWG_CUMULUS_PLUGIN_JS', PWG_CUMULUS_PLUGIN_JS); |
---|
72 | $GLOBALS['template']->assign('PWG_CUMULUS_WIDTH', $me->pwg_cumulus_width); |
---|
73 | $GLOBALS['template']->assign('PWG_CUMULUS_HEIGHT', $me->pwg_cumulus_height); |
---|
74 | $GLOBALS['template']->assign('PWG_CUMULUS_COEFF', $me->pwg_cumulus_coeff); |
---|
75 | $GLOBALS['template']->assign('PWG_CUMULUS_COLOR1', $me->pwg_cumulus_color1); |
---|
76 | $GLOBALS['template']->assign('PWG_CUMULUS_COLOR2', $me->pwg_cumulus_color2); |
---|
77 | $GLOBALS['template']->assign('PWG_CUMULUS_HICOLOR', $me->pwg_cumulus_hicolor); |
---|
78 | $GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
79 | ?> |
---|