source: extensions/akBookStyle/trunk/admin.php @ 3802

Last change on this file since 3802 was 3802, checked in by vdigital, 12 years ago

Admin new parameters (Not functional)

File size: 3.4 KB
Line 
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
23if (!defined('PHPWG_ROOT_PATH')) {
24  die('Hacking attempt!');
25}
26
27load_language('plugin.lang', AK_PLUGIN_LANG);
28
29$me = get_plugin_data($plugin_id);
30$save_config = false;
31
32if (!empty($_POST['submit'])) {
33  if (!empty($_POST['ak_by_line']) && intval($_POST['ak_by_line'])!=$me->ak_by_line) {
34    $me->ak_by_line = intval($_POST['ak_by_line']);
35    array_push($GLOBALS['page']['infos'], $lang['ak_by_line_changed']);
36    $save_config = true;
37  }
38
39  if (!empty($_POST['ak_thumbnail_size']) && $_POST['ak_thumbnail_size']!=$me->ak_thumbnail_size) {
40    $me->ak_thumbnail_size = (int) $_POST['ak_thumbnail_size'];
41    array_push($GLOBALS['page']['infos'], $lang['ak_thumbnail_size_changed']);
42    $save_config = true;
43  }
44
45  if (!empty($_POST['ak_show_over']) && $_POST['ak_show_over']!=$me->ak_show_over) {
46    $me->ak_show_over = ($_POST['ak_show_over']=='true')?'true':'false';
47    array_push($GLOBALS['page']['infos'], $lang['ak_show_over_changed']);
48    $save_config = true;
49  }
50
51  if (!empty($_POST['ak_thumbnails_loc']) && $_POST['ak_thumbnails_loc']!=$me->ak_thumbnails_loc) {
52    $me->ak_thumbnails_loc = (in_array($_POST['ak_thumbnails_loc'],array('top','left','bottom','right')))?$_POST['ak_thumbnails_loc']:'left';
53    array_push($GLOBALS['page']['infos'], $lang['ak_thumbnails_loc_changed']);
54    $save_config = true;
55  }
56
57  if ($save_config) {
58    $me->save_config();
59  }
60}
61$GLOBALS['template']->set_filenames(array('plugin_admin_content' => AK_PLUGIN_TEMPLATE . '/admin.tpl'));
62$GLOBALS['template']->assign('AK_PLUGIN_CSS', AK_PLUGIN_CSS); 
63$GLOBALS['template']->assign('AK_BY_LINE', $me->ak_by_line); 
64$GLOBALS['template']->assign('AK_THUMBNAIL_SIZE', $me->ak_thumbnail_size); 
65$GLOBALS['template']->assign('AK_SHOW_OVER', $me->ak_show_over); 
66$GLOBALS['template']->assign('AK_THUMBNAILS_LOC', $me->ak_thumbnails_loc); 
67$GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
68?>
Note: See TracBrowser for help on using the repository browser.