[3761] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | akBookStyle - a plugin for Piwigo | |
---|
| 4 | // +-----------------------------------------------------------------------+ |
---|
| 5 | // | Copyright(C) 2009 Nicolas Roudaire http://www.nikrou.net | |
---|
| 6 | // | Copyright(C) 2009 vdigital | |
---|
| 7 | // +-----------------------------------------------------------------------+ |
---|
| 8 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 9 | // | it under the terms of the GNU General Public License as published by | |
---|
| 10 | // | the Free Software Foundation | |
---|
| 11 | // | | |
---|
| 12 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 13 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 14 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 15 | // | General Public License for more details. | |
---|
| 16 | // | | |
---|
| 17 | // | You should have received a copy of the GNU General Public License | |
---|
| 18 | // | along with this program; if not, write to the Free Software | |
---|
| 19 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 20 | // | USA. | |
---|
| 21 | // +-----------------------------------------------------------------------+ |
---|
| 22 | |
---|
[3764] | 23 | if (!defined('PHPWG_ROOT_PATH')) { |
---|
| 24 | die('Hacking attempt!'); |
---|
| 25 | } |
---|
| 26 | |
---|
[3806] | 27 | $ThumbnailsLocations = array('top','left','bottom','right'); |
---|
| 28 | $MouseEvents = array('click' => 'ak_event_click', |
---|
| 29 | 'mouseover' => 'ak_event_mouseover'); |
---|
| 30 | |
---|
[3791] | 31 | load_language('plugin.lang', AK_PLUGIN_LANG); |
---|
| 32 | |
---|
| 33 | $me = get_plugin_data($plugin_id); |
---|
| 34 | $save_config = false; |
---|
| 35 | |
---|
| 36 | if (!empty($_POST['submit'])) { |
---|
[3842] | 37 | if (!empty($_POST['ak_categories']) && $_POST['ak_categories']!=$me->ak_categories) { |
---|
| 38 | $me->ak_categories = $_POST['ak_categories']; |
---|
[3843] | 39 | if ( $_POST['ak_categories'] == '') $me->ak_categories = '<!--Book-->'; |
---|
[3842] | 40 | array_push($GLOBALS['page']['infos'], $lang['ak_categories_changed']); |
---|
| 41 | $save_config = true; |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | if (!empty($_POST['ak_by_page']) && intval($_POST['ak_by_page'])!=$me->ak_by_page) { |
---|
| 45 | $me->ak_by_page = intval($_POST['ak_by_page']); |
---|
| 46 | array_push($GLOBALS['page']['infos'], $lang['ak_by_page_changed']); |
---|
| 47 | $save_config = true; |
---|
| 48 | } |
---|
| 49 | |
---|
[3791] | 50 | if (!empty($_POST['ak_by_line']) && intval($_POST['ak_by_line'])!=$me->ak_by_line) { |
---|
| 51 | $me->ak_by_line = intval($_POST['ak_by_line']); |
---|
| 52 | array_push($GLOBALS['page']['infos'], $lang['ak_by_line_changed']); |
---|
| 53 | $save_config = true; |
---|
| 54 | } |
---|
| 55 | |
---|
[3802] | 56 | if (!empty($_POST['ak_thumbnail_size']) && $_POST['ak_thumbnail_size']!=$me->ak_thumbnail_size) { |
---|
| 57 | $me->ak_thumbnail_size = (int) $_POST['ak_thumbnail_size']; |
---|
[3792] | 58 | array_push($GLOBALS['page']['infos'], $lang['ak_thumbnail_size_changed']); |
---|
| 59 | $save_config = true; |
---|
| 60 | } |
---|
| 61 | |
---|
[3806] | 62 | if (!empty($_POST['ak_mouse_event']) && $_POST['ak_mouse_event']!=$me->ak_mouse_event) { |
---|
| 63 | $me->ak_mouse_event = isset($MouseEvents[$_POST['ak_mouse_event']])?$_POST['ak_mouse_event']:'click'; |
---|
| 64 | array_push($GLOBALS['page']['infos'], $lang['ak_mouse_event_changed']); |
---|
[3802] | 65 | $save_config = true; |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | if (!empty($_POST['ak_thumbnails_loc']) && $_POST['ak_thumbnails_loc']!=$me->ak_thumbnails_loc) { |
---|
[3806] | 69 | $me->ak_thumbnails_loc = in_array($_POST['ak_thumbnails_loc'],$ThumbnailsLocations)?$_POST['ak_thumbnails_loc']:'left'; |
---|
[3802] | 70 | array_push($GLOBALS['page']['infos'], $lang['ak_thumbnails_loc_changed']); |
---|
| 71 | $save_config = true; |
---|
| 72 | } |
---|
| 73 | |
---|
[3791] | 74 | if ($save_config) { |
---|
| 75 | $me->save_config(); |
---|
| 76 | } |
---|
| 77 | } |
---|
[3764] | 78 | $GLOBALS['template']->set_filenames(array('plugin_admin_content' => AK_PLUGIN_TEMPLATE . '/admin.tpl')); |
---|
[3791] | 79 | $GLOBALS['template']->assign('AK_PLUGIN_CSS', AK_PLUGIN_CSS); |
---|
[3842] | 80 | $GLOBALS['template']->assign('AK_CATEGORIES', $me->ak_categories); |
---|
| 81 | $GLOBALS['template']->assign('AK_BY_PAGE', $me->ak_by_page); |
---|
[3791] | 82 | $GLOBALS['template']->assign('AK_BY_LINE', $me->ak_by_line); |
---|
[3792] | 83 | $GLOBALS['template']->assign('AK_THUMBNAIL_SIZE', $me->ak_thumbnail_size); |
---|
[3806] | 84 | $GLOBALS['template']->assign('AK_MOUSE_EVENT', $me->ak_mouse_event); |
---|
| 85 | $GLOBALS['template']->assign('AK_AVAILABLE_EVENTS', array_keys($MouseEvents)); |
---|
| 86 | $GLOBALS['template']->assign('AK_EVENTS_LABELS', array_values($MouseEvents)); |
---|
[3802] | 87 | $GLOBALS['template']->assign('AK_THUMBNAILS_LOC', $me->ak_thumbnails_loc); |
---|
[3806] | 88 | $GLOBALS['template']->assign('AK_THUMBNAILS_LOCATIONS', $ThumbnailsLocations); |
---|
[3764] | 89 | $GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
[3761] | 90 | ?> |
---|