[5201] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | pwgCumulus - a plugin for Piwigo | |
---|
| 4 | // +-----------------------------------------------------------------------+ |
---|
[5323] | 5 | // | Copyright(C) 2009-2010 Nicolas Roudaire http://www.nikrou.net | |
---|
[5201] | 6 | // +-----------------------------------------------------------------------+ |
---|
| 7 | // | This program is free software; you can redistribute it and/or modify | |
---|
[6433] | 8 | // | it under the terms of the GNU General Public License version 2 as | |
---|
| 9 | // | published by the Free Software Foundation | |
---|
[5201] | 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 | |
---|
[6433] | 18 | // | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | |
---|
| 19 | // | MA 02110-1301 USA | |
---|
[5201] | 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']); |
---|
[5323] | 34 | array_push($GLOBALS['page']['infos'], $lang['Width updated']); |
---|
[5201] | 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']); |
---|
[5323] | 39 | array_push($GLOBALS['page']['infos'], $lang['Height updated']); |
---|
[5201] | 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']); |
---|
[5323] | 44 | array_push($GLOBALS['page']['infos'], $lang['Coefficient for tags size updated']); |
---|
[5201] | 45 | $save_config = true; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | if (!empty($_POST['pwg_cumulus_color1']) && trim($_POST['pwg_cumulus_color1'])!=$me->pwg_cumulus_color1) { |
---|
[6379] | 49 | $me->pwg_cumulus_color1 = str_replace('#', '', $_POST['pwg_cumulus_color1']); |
---|
[5323] | 50 | array_push($GLOBALS['page']['infos'], $lang['Color 1 updated']); |
---|
[5201] | 51 | $save_config = true; |
---|
| 52 | } |
---|
| 53 | if (!empty($_POST['pwg_cumulus_color2']) && trim($_POST['pwg_cumulus_color2'])!=$me->pwg_cumulus_color2) { |
---|
[6379] | 54 | $me->pwg_cumulus_color2 = str_replace('#', '', $_POST['pwg_cumulus_color2']); |
---|
[5323] | 55 | array_push($GLOBALS['page']['infos'], $lang['Color 2 updated']); |
---|
[5201] | 56 | $save_config = true; |
---|
| 57 | } |
---|
| 58 | if (!empty($_POST['pwg_cumulus_hicolor']) && trim($_POST['pwg_cumulus_hicolor'])!=$me->pwg_cumulus_hicolor) { |
---|
[6379] | 59 | $me->pwg_cumulus_hicolor = str_replace('#', '', $_POST['pwg_cumulus_hicolor']); |
---|
[5323] | 60 | array_push($GLOBALS['page']['infos'], $lang['Mouseover color updated']); |
---|
[5201] | 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')); |
---|
[5405] | 70 | $GLOBALS['template']->assign('PWG_CUMULUS_PLUGIN_CSS', PWG_CUMULUS_PLUGIN_CSS); |
---|
| 71 | $GLOBALS['template']->assign('PWG_CUMULUS_PLUGIN_JS', PWG_CUMULUS_PLUGIN_JS); |
---|
[5201] | 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 | ?> |
---|