source: extensions/memories/admin.php @ 32755

Last change on this file since 32755 was 32407, checked in by ddtddt, 4 years ago

[memories] piwigo 11

File size: 4.2 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Memories for Piwigo by TEMMII                                         |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2020-2021 ddtddt               http://temmii.com/piwigo/ |
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 as published by  |
9// | 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
19// | USA.                                                                  |
20// +-----------------------------------------------------------------------+
21if (!defined('PHPWG_ROOT_PATH'))
22    die('Hacking attempt!');
23global $template, $conf, $user;
24
25// +-----------------------------------------------------------------------+
26// | Check Access and exit when user status is not ok                      |
27// +-----------------------------------------------------------------------+
28check_status(ACCESS_ADMINISTRATOR);
29
30global $conf, $page;
31$confpfoya = safe_unserialize($conf['pfoya']);
32
33$template->assign(
34  array(
35        'PFOYA_POSITION' => $confpfoya['pfoya_position'],
36        'PFOYA_DATE' => $confpfoya['pfoya_dateb'],
37        'PFOYA_DATEMAX' => $confpfoya['pfoya_datemax'],
38        'PFOYA_NIP' => $confpfoya['pfoya_nip'],
39        'PFOYA_MENU' => $confpfoya['pfoya_menu'],
40        'PFOYA_SHOW' => $confpfoya['pfoya_show'],
41        'PFOYA_SHOWPS' => $confpfoya['pfoya_showps'],
42  )
43);
44
45$PFOYA3T = array(
46  l10n('Available date'),
47  l10n('Creation date'),
48);
49
50$PFOYA3 = array(
51  'date_available',
52  'date_creation',
53);
54
55$template->assign('PFOYA3', $PFOYA3);
56$template->assign('PFOYA3T', $PFOYA3T);
57
58$PFOYA2T = array(
59  l10n('none'),
60  l10n('link Specials/Explore menu'),
61  l10n('block menu'),
62);
63$PFOYA2 = array(
64  '-1',
65  'link',
66  'block',
67); 
68
69$template->assign('pfoya2', $PFOYA2);
70$template->assign('pfoya2T', $PFOYA2T);
71
72$PFOYA4T = array(
73  l10n('yes'),
74  l10n('no'),
75);
76$PFOYA4 = array(
77  '1',
78  '0',
79); 
80
81$template->assign('pfoya4', $PFOYA4);
82$template->assign('pfoya4T', $PFOYA4T);
83
84$PFOYA8T = array(
85  l10n('link in blocks'),
86  l10n('link to memories page'),
87  l10n('no'),
88);
89$PFOYA8 = array(
90  '2',
91  '1',
92  '0',
93); 
94
95$template->assign('pfoya8', $PFOYA8);
96$template->assign('pfoya8T', $PFOYA8T);
97
98
99
100if (isset($_POST['submitpfoya'])){
101  if (is_numeric($_POST['submitpfoyadatemax'])){
102    $confpfoya['pfoya_datemax']=$_POST['submitpfoyadatemax'];
103  }else{
104        $_SESSION['page_errors'] = array(l10n('number years must be a number'));
105  }
106  $confpfoya['pfoya_dateb']=$_POST['submitpfoyadateb'];
107  $confpfoya['pfoya_menu']=$_POST['submitpfoyamenu'];
108  $confpfoya['pfoya_show']=$_POST['submitpfoyashow'];
109  $confpfoya['pfoya_showps']=$_POST['submitpfoyashowps'];
110  if (is_numeric($_POST['submitpfoyaposition'])){
111    $confpfoya['pfoya_position']=$_POST['submitpfoyaposition'];
112  }else{
113        $_SESSION['page_errors'] = array(l10n('position must be a number'));
114  }
115  if (is_numeric($_POST['submitpfoyanip'])){
116    $confpfoya['pfoya_nip']=$_POST['submitpfoyanip'];
117  }else{
118        $_SESSION['page_errors'] = array(l10n('number photos must be a number'));
119  }
120  conf_update_param('pfoya', $confpfoya, true);
121  $_SESSION['page_infos'] = array(l10n('Information data registered in database'));
122  redirect(PFOYA_ADMIN);
123}
124if (isset($_POST['resetpfoya'])){
125  redirect(PFOYA_ADMIN);
126}
127
128$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/admin.tpl'));
129$template->assign_var_from_handle('ADMIN_CONTENT','plugin_admin_content');
130?>
Note: See TracBrowser for help on using the repository browser.