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

Last change on this file since 3792 was 3792, checked in by nikrou, 15 years ago

Generate square thumbnails (css clip)
Allow admin to define thumbnail size

File size: 2.7 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']) && intval($_POST['ak_thumbnail_size'])!=$me->ak_thumbnail_size) {
40    $me->ak_thumbnail_size = intval($_POST['ak_thumbnail_size']);
41    array_push($GLOBALS['page']['infos'], $lang['ak_thumbnail_size_changed']);
42    $save_config = true;
43  }
44
45  if ($save_config) {
46    $me->save_config();
47  }
48}
49
50$GLOBALS['template']->set_filenames(array('plugin_admin_content' => AK_PLUGIN_TEMPLATE . '/admin.tpl'));
51$GLOBALS['template']->assign('AK_PLUGIN_CSS', AK_PLUGIN_CSS); 
52$GLOBALS['template']->assign('AK_BY_LINE', $me->ak_by_line); 
53$GLOBALS['template']->assign('AK_THUMBNAIL_SIZE', $me->ak_thumbnail_size); 
54$GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
55?>
Note: See TracBrowser for help on using the repository browser.