source: extensions/Add_tags_Mass/admin.php

Last change on this file was 32681, checked in by plg, 2 years ago

compatibility with PHP 7.2

File size: 3.6 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Piwigo - a PHP based picture gallery                                  |
4// +-----------------------------------------------------------------------+
5// | This program is free software; you can redistribute it and/or modify  |
6// | it under the terms of the GNU General Public License as published by  |
7// | the Free Software Foundation                                          |
8// |                                                                       |
9// | This program is distributed in the hope that it will be useful, but   |
10// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
11// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
12// | General Public License for more details.                              |
13// |                                                                       |
14// | You should have received a copy of the GNU General Public License     |
15// | along with this program; if not, write to the Free Software           |
16// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
17// | USA.                                                                  |
18// +-----------------------------------------------------------------------+
19
20if( !defined("PHPWG_ROOT_PATH") )
21{
22  die ("Hacking attempt!");
23}
24
25include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
26include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
27load_language('plugin.lang', ADDTM_PATH);
28
29$base_url = get_root_url().'admin.php?page=plugin-Add_tags_mass';
30
31// +-----------------------------------------------------------------------+
32// | Check Access and exit when user status is not ok                      |
33// +-----------------------------------------------------------------------+
34
35check_status(ACCESS_ADMINISTRATOR);
36
37// +-----------------------------------------------------------------------+
38// | Tabs                                                                  |
39// +-----------------------------------------------------------------------+
40
41$tabs = array(
42  array(
43    'code' => 'update',
44    'label' => l10n('Update'),
45    ),
46  );
47
48$tab_codes = array_column($tabs, 'code');
49
50if (isset($_GET['tab']) and in_array($_GET['tab'], $tab_codes))
51{
52  $page['tab'] = $_GET['tab'];
53}
54else
55{
56  $page['tab'] = $tabs[0]['code'];
57}
58
59$tabsheet = new tabsheet();
60foreach ($tabs as $tab)
61{
62  $tabsheet->add(
63    $tab['code'],
64    $tab['label'],
65    $base_url.'-'.$tab['code']
66    );
67}
68$tabsheet->select($page['tab']);
69$tabsheet->assign();
70
71// +-----------------------------------------------------------------------+
72// |                             template init                             |
73// +-----------------------------------------------------------------------+
74
75$template->set_filenames(
76  array(
77    'plugin_admin_content' => dirname(__FILE__).'/admin_'.$page['tab'].'.tpl'
78    )
79  );
80
81// +-----------------------------------------------------------------------+
82// |                             Load the tab                              |
83// +-----------------------------------------------------------------------+
84
85include(ADDTM_PATH.'admin_'.$page['tab'].'.php');
86
87// +-----------------------------------------------------------------------+
88// | sending html code                                                     |
89// +-----------------------------------------------------------------------+
90
91$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
92?>
Note: See TracBrowser for help on using the repository browser.