1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Piwigo - a PHP based picture gallery | |
---|
4 | // +-----------------------------------------------------------------------+ |
---|
5 | // | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org | |
---|
6 | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | |
---|
7 | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | |
---|
8 | // +-----------------------------------------------------------------------+ |
---|
9 | // | This program is free software; you can redistribute it and/or modify | |
---|
10 | // | it under the terms of the GNU General Public License as published by | |
---|
11 | // | the Free Software Foundation | |
---|
12 | // | | |
---|
13 | // | This program is distributed in the hope that it will be useful, but | |
---|
14 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
15 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
16 | // | General Public License for more details. | |
---|
17 | // | | |
---|
18 | // | You should have received a copy of the GNU General Public License | |
---|
19 | // | along with this program; if not, write to the Free Software | |
---|
20 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
21 | // | USA. | |
---|
22 | // +-----------------------------------------------------------------------+ |
---|
23 | |
---|
24 | if( !defined("PHPWG_ROOT_PATH") ) |
---|
25 | { |
---|
26 | die ("Hacking attempt!"); |
---|
27 | } |
---|
28 | |
---|
29 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
30 | include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
31 | |
---|
32 | define('COMMUNITY_BASE_URL', get_root_url().'admin.php?page=plugin-community'); |
---|
33 | |
---|
34 | // +-----------------------------------------------------------------------+ |
---|
35 | // | Check Access and exit when user status is not ok | |
---|
36 | // +-----------------------------------------------------------------------+ |
---|
37 | |
---|
38 | check_status(ACCESS_ADMINISTRATOR); |
---|
39 | |
---|
40 | // +-----------------------------------------------------------------------+ |
---|
41 | // | Tabs | |
---|
42 | // +-----------------------------------------------------------------------+ |
---|
43 | |
---|
44 | $pendings_label = l10n('Pending Photos'); |
---|
45 | if ($page['community_nb_pendings'] > 0) |
---|
46 | { |
---|
47 | $pendings_label.= ' ('.$page['community_nb_pendings'].')'; |
---|
48 | } |
---|
49 | |
---|
50 | $tabs = array( |
---|
51 | array( |
---|
52 | 'code' => 'permissions', |
---|
53 | 'label' => l10n('Upload Permissions'), |
---|
54 | ), |
---|
55 | array( |
---|
56 | 'code' => 'pendings', |
---|
57 | 'label' => $pendings_label, |
---|
58 | ), |
---|
59 | array( |
---|
60 | 'code' => 'config', |
---|
61 | 'label' => l10n('Configuration'), |
---|
62 | ), |
---|
63 | ); |
---|
64 | |
---|
65 | $tab_codes = array_map( |
---|
66 | create_function('$a', 'return $a["code"];'), |
---|
67 | $tabs |
---|
68 | ); |
---|
69 | |
---|
70 | if (isset($_GET['tab']) and in_array($_GET['tab'], $tab_codes)) |
---|
71 | { |
---|
72 | $page['tab'] = $_GET['tab']; |
---|
73 | } |
---|
74 | else |
---|
75 | { |
---|
76 | $page['tab'] = $tabs[0]['code']; |
---|
77 | } |
---|
78 | |
---|
79 | $tabsheet = new tabsheet(); |
---|
80 | foreach ($tabs as $tab) |
---|
81 | { |
---|
82 | $tabsheet->add( |
---|
83 | $tab['code'], |
---|
84 | $tab['label'], |
---|
85 | COMMUNITY_BASE_URL.'-'.$tab['code'] |
---|
86 | ); |
---|
87 | } |
---|
88 | $tabsheet->select($page['tab']); |
---|
89 | $tabsheet->assign(); |
---|
90 | |
---|
91 | // +-----------------------------------------------------------------------+ |
---|
92 | // | template init | |
---|
93 | // +-----------------------------------------------------------------------+ |
---|
94 | |
---|
95 | $template->set_filenames( |
---|
96 | array( |
---|
97 | 'photos_add' => 'photos_add_'.$page['tab'].'.tpl' |
---|
98 | ) |
---|
99 | ); |
---|
100 | |
---|
101 | // +-----------------------------------------------------------------------+ |
---|
102 | // | Load the tab | |
---|
103 | // +-----------------------------------------------------------------------+ |
---|
104 | |
---|
105 | include(COMMUNITY_PATH.'admin_'.$page['tab'].'.php'); |
---|
106 | ?> |
---|