source: extensions/properties_mass_update/admin.php @ 15746

Last change on this file since 15746 was 15389, checked in by ddtddt, 13 years ago

[extensions] - properties_mass_update - plg plugin

File size: 3.7 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Piwigo - a PHP based picture gallery                                  |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2012      Pierrick LE GALL   http://le-gall.net/pierrick |
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
22if( !defined("PHPWG_ROOT_PATH") )
23{
24  die ("Hacking attempt!");
25}
26
27include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
28include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
29load_language('plugin.lang', PPMU_PATH);
30
31$base_url = get_root_url().'admin.php?page=plugin-properties_mass_update';
32
33// +-----------------------------------------------------------------------+
34// | Check Access and exit when user status is not ok                      |
35// +-----------------------------------------------------------------------+
36
37check_status(ACCESS_ADMINISTRATOR);
38
39// +-----------------------------------------------------------------------+
40// | Tabs                                                                  |
41// +-----------------------------------------------------------------------+
42
43$tabs = array(
44  array(
45    'code' => 'update',
46    'label' => l10n('Update'),
47    ),
48  );
49
50$tab_codes = array_map(
51  create_function('$a', 'return $a["code"];'),
52  $tabs
53  );
54
55if (isset($_GET['tab']) and in_array($_GET['tab'], $tab_codes))
56{
57  $page['tab'] = $_GET['tab'];
58}
59else
60{
61  $page['tab'] = $tabs[0]['code'];
62}
63
64$tabsheet = new tabsheet();
65foreach ($tabs as $tab)
66{
67  $tabsheet->add(
68    $tab['code'],
69    $tab['label'],
70    $base_url.'-'.$tab['code']
71    );
72}
73$tabsheet->select($page['tab']);
74$tabsheet->assign();
75
76// +-----------------------------------------------------------------------+
77// |                             template init                             |
78// +-----------------------------------------------------------------------+
79
80$template->set_filenames(
81  array(
82    'plugin_admin_content' => dirname(__FILE__).'/admin_'.$page['tab'].'.tpl'
83    )
84  );
85
86// +-----------------------------------------------------------------------+
87// |                             Load the tab                              |
88// +-----------------------------------------------------------------------+
89
90include(PPMU_PATH.'admin_'.$page['tab'].'.php');
91
92// +-----------------------------------------------------------------------+
93// | sending html code                                                     |
94// +-----------------------------------------------------------------------+
95
96$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
97?>
Note: See TracBrowser for help on using the repository browser.