1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Photo added by plugin for Piwigo | |
---|
4 | // +-----------------------------------------------------------------------+ |
---|
5 | // | Copyright(C) 2012-2016 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 | // +-----------------------------------------------------------------------+ |
---|
21 | |
---|
22 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
23 | global $template, $conf, $user; |
---|
24 | include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php'); |
---|
25 | load_language('plugin.lang', PAB_PATH); |
---|
26 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
27 | |
---|
28 | // +-----------------------------------------------------------------------+ |
---|
29 | // | Check Access and exit when user status is not ok | |
---|
30 | // +-----------------------------------------------------------------------+ |
---|
31 | check_status(ACCESS_ADMINISTRATOR); |
---|
32 | |
---|
33 | //-------------------------------------------------------- sections definitions |
---|
34 | |
---|
35 | // Gestion des onglets |
---|
36 | if (!isset($_GET['tab'])) |
---|
37 | $page['tab'] = 'gestion'; |
---|
38 | else |
---|
39 | $page['tab'] = $_GET['tab']; |
---|
40 | |
---|
41 | $tabsheet = new tabsheet(); |
---|
42 | $tabsheet->add('gestion',l10n('Configuration'),PAB_ADMIN.'-gestion'); |
---|
43 | $tabsheet->select($page['tab']); |
---|
44 | $tabsheet->assign(); |
---|
45 | |
---|
46 | // Onglet gest |
---|
47 | switch ($page['tab']) |
---|
48 | { |
---|
49 | case 'gestion': |
---|
50 | |
---|
51 | global $conf; |
---|
52 | |
---|
53 | $selected = $conf['Photo_add_by']; |
---|
54 | $options['Author'] = l10n('Author'); |
---|
55 | $options['datecreate'] = l10n('Created on'); |
---|
56 | $options['datepost'] = l10n('Posted on'); |
---|
57 | $options['Dimensions'] = l10n('Dimensions'); |
---|
58 | $options['File'] = l10n('File'); |
---|
59 | $options['Filesize'] = l10n('Filesize'); |
---|
60 | $options['Tags'] = l10n('tags'); |
---|
61 | $options['Categories'] = l10n('Albums'); |
---|
62 | $options['Visits'] = l10n('Visits'); |
---|
63 | $options['Average'] = l10n('Rating score'); |
---|
64 | |
---|
65 | $template->assign( |
---|
66 | 'gestionA', |
---|
67 | array( |
---|
68 | 'OPTIONS' => $options, |
---|
69 | 'SELECTED' => $selected, |
---|
70 | )); |
---|
71 | |
---|
72 | $PASPBY = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'see_photos_by_user';")); |
---|
73 | if($PASPBY['state'] == 'active') |
---|
74 | { |
---|
75 | $PABS2T = array( |
---|
76 | l10n('No'), |
---|
77 | l10n('Yes'), |
---|
78 | ); |
---|
79 | |
---|
80 | $PABS2 = array( |
---|
81 | '0', |
---|
82 | '1', |
---|
83 | ); |
---|
84 | |
---|
85 | $template->assign( |
---|
86 | 'gestionB', |
---|
87 | array( |
---|
88 | 'TOTO' => 'toto', |
---|
89 | )); |
---|
90 | global $conf; |
---|
91 | $template->assign('pabs2', $PABS2); |
---|
92 | $template->assign('pabs2t', $PABS2T); |
---|
93 | $template->assign('PABS', $conf['Photo_add_by_show']); |
---|
94 | |
---|
95 | } |
---|
96 | |
---|
97 | if (isset($_POST['submitpab'])) |
---|
98 | { |
---|
99 | conf_update_param('Photo_add_by', $_POST['infopab']); |
---|
100 | if($PASPBY['state'] == 'active') |
---|
101 | { |
---|
102 | conf_update_param('Photo_add_by_show', $_POST['inspabs2']); |
---|
103 | $template->assign( |
---|
104 | 'gestionB', |
---|
105 | array( |
---|
106 | 'TOTO' => 'toto', |
---|
107 | )); |
---|
108 | $template->assign('PABS', $_POST['inspabs2']); |
---|
109 | } |
---|
110 | $template->delete_compiled_templates(); |
---|
111 | array_push($page['infos'], l10n('Your configuration settings are saved')); |
---|
112 | |
---|
113 | $selected = $_POST['infopab']; |
---|
114 | $template->assign( |
---|
115 | 'gestionA', |
---|
116 | array( |
---|
117 | 'OPTIONS' => $options, |
---|
118 | 'SELECTED' => $selected, |
---|
119 | )); |
---|
120 | } |
---|
121 | break; |
---|
122 | } |
---|
123 | |
---|
124 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin/admin.tpl')); |
---|
125 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
126 | ?> |
---|