| 1 | <?php |
|---|
| 2 | // +-----------------------------------------------------------------------+ |
|---|
| 3 | // | pwgCumulus - a plugin for Piwigo | |
|---|
| 4 | // +-----------------------------------------------------------------------+ |
|---|
| 5 | // | Copyright(C) 2009-2011 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 | $save_config = false; |
|---|
| 23 | |
|---|
| 24 | if (!empty($_POST['submit'])) { |
|---|
| 25 | if (!empty($_POST['pwg_cumulus_width']) && intval($_POST['pwg_cumulus_width'])!=$me->pwg_cumulus_width) { |
|---|
| 26 | $me->pwg_cumulus_width = intval($_POST['pwg_cumulus_width']); |
|---|
| 27 | $page['infos'][] = l10n('Width updated'); |
|---|
| 28 | $save_config = true; |
|---|
| 29 | } |
|---|
| 30 | if (!empty($_POST['pwg_cumulus_height']) && intval($_POST['pwg_cumulus_height'])!=$me->pwg_cumulus_height) { |
|---|
| 31 | $me->pwg_cumulus_height = intval($_POST['pwg_cumulus_height']); |
|---|
| 32 | $page['infos'][] = l10n('Height updated'); |
|---|
| 33 | $save_config = true; |
|---|
| 34 | } |
|---|
| 35 | if (!empty($_POST['pwg_cumulus_coeff']) && intval($_POST['pwg_cumulus_coeff'])!=$me->pwg_cumulus_coeff) { |
|---|
| 36 | $me->pwg_cumulus_coeff = intval($_POST['pwg_cumulus_coeff']); |
|---|
| 37 | $page['infos'][] = l10n('Coefficient for tags size updated'); |
|---|
| 38 | $save_config = true; |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | if (!empty($_POST['pwg_cumulus_mode_transparent']) && !$me->pwg_cumulus_mode_transparent) { |
|---|
| 42 | $me->pwg_cumulus_mode_transparent = true; |
|---|
| 43 | $page['infos'][] = l10n('Transparent mode is used'); |
|---|
| 44 | $save_config = true; |
|---|
| 45 | } elseif (empty($_POST['pwg_cumulus_mode_transparent']) && $me->pwg_cumulus_mode_transparent) { |
|---|
| 46 | $me->pwg_cumulus_mode_transparent = false; |
|---|
| 47 | $page['infos'][] = l10n('Transparent mode is not used'); |
|---|
| 48 | $save_config = true; |
|---|
| 49 | } |
|---|
| 50 | if (!empty($_POST['pwg_cumulus_bgcolor']) && trim($_POST['pwg_cumulus_bgcolor'])!=$me->pwg_cumulus_bgcolor) { |
|---|
| 51 | $me->pwg_cumulus_bgcolor = str_replace('#', '', $_POST['pwg_cumulus_bgcolor']); |
|---|
| 52 | $page['infos'][] = l10n('Background color updated'); |
|---|
| 53 | $save_config = true; |
|---|
| 54 | } |
|---|
| 55 | if (!empty($_POST['pwg_cumulus_color1']) && trim($_POST['pwg_cumulus_color1'])!=$me->pwg_cumulus_color1) { |
|---|
| 56 | $me->pwg_cumulus_color1 = str_replace('#', '', $_POST['pwg_cumulus_color1']); |
|---|
| 57 | $page['infos'][] = l10n('Color 1 updated'); |
|---|
| 58 | $save_config = true; |
|---|
| 59 | } |
|---|
| 60 | if (!empty($_POST['pwg_cumulus_color2']) && trim($_POST['pwg_cumulus_color2'])!=$me->pwg_cumulus_color2) { |
|---|
| 61 | $me->pwg_cumulus_color2 = str_replace('#', '', $_POST['pwg_cumulus_color2']); |
|---|
| 62 | $page['infos'][] = l10n('Color 2 updated'); |
|---|
| 63 | $save_config = true; |
|---|
| 64 | } |
|---|
| 65 | if (!empty($_POST['pwg_cumulus_hicolor']) && trim($_POST['pwg_cumulus_hicolor'])!=$me->pwg_cumulus_hicolor) { |
|---|
| 66 | $me->pwg_cumulus_hicolor = str_replace('#', '', $_POST['pwg_cumulus_hicolor']); |
|---|
| 67 | $page['infos'][] = l10n('Mouseover color updated'); |
|---|
| 68 | $save_config = true; |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | if ($save_config) { |
|---|
| 72 | $me->save_config(); |
|---|
| 73 | } |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | $template->assign('PWG_CUMULUS_WIDTH', $me->pwg_cumulus_width); |
|---|
| 77 | $template->assign('PWG_CUMULUS_HEIGHT', $me->pwg_cumulus_height); |
|---|
| 78 | $template->assign('PWG_CUMULUS_COEFF', $me->pwg_cumulus_coeff); |
|---|
| 79 | $template->assign('PWG_CUMULUS_MODE_TRANSPARENT', $me->pwg_cumulus_mode_transparent); |
|---|
| 80 | $template->assign('PWG_CUMULUS_BGCOLOR', $me->pwg_cumulus_bgcolor); |
|---|
| 81 | $template->assign('PWG_CUMULUS_COLOR1', $me->pwg_cumulus_color1); |
|---|
| 82 | $template->assign('PWG_CUMULUS_COLOR2', $me->pwg_cumulus_color2); |
|---|
| 83 | $template->assign('PWG_CUMULUS_HICOLOR', $me->pwg_cumulus_hicolor); |
|---|
| 84 | ?> |
|---|