source: extensions/Add_tags_Mass/admin.php @ 26978

Revision 26978, 3.6 KB checked in by poulpix, 6 years ago (diff)
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_map(
49  create_function('$a', 'return $a["code"];'),
50  $tabs
51  );
52
53if (isset($_GET['tab']) and in_array($_GET['tab'], $tab_codes))
54{
55  $page['tab'] = $_GET['tab'];
56}
57else
58{
59  $page['tab'] = $tabs[0]['code'];
60}
61
62$tabsheet = new tabsheet();
63foreach ($tabs as $tab)
64{
65  $tabsheet->add(
66    $tab['code'],
67    $tab['label'],
68    $base_url.'-'.$tab['code']
69    );
70}
71$tabsheet->select($page['tab']);
72$tabsheet->assign();
73
74// +-----------------------------------------------------------------------+
75// |                             template init                             |
76// +-----------------------------------------------------------------------+
77
78$template->set_filenames(
79  array(
80    'plugin_admin_content' => dirname(__FILE__).'/admin_'.$page['tab'].'.tpl'
81    )
82  );
83
84// +-----------------------------------------------------------------------+
85// |                             Load the tab                              |
86// +-----------------------------------------------------------------------+
87
88include(ADDTM_PATH.'admin_'.$page['tab'].'.php');
89
90// +-----------------------------------------------------------------------+
91// | sending html code                                                     |
92// +-----------------------------------------------------------------------+
93
94$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
95?>
Note: See TracBrowser for help on using the repository browser.