[3673] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | Piwigo - a PHP based picture gallery | |
---|
| 4 | // +-----------------------------------------------------------------------+ |
---|
[9372] | 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 | |
---|
[3673] | 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'); |
---|
[9372] | 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'); |
---|
[3673] | 33 | |
---|
| 34 | // +-----------------------------------------------------------------------+ |
---|
| 35 | // | Check Access and exit when user status is not ok | |
---|
| 36 | // +-----------------------------------------------------------------------+ |
---|
[9372] | 37 | |
---|
[3673] | 38 | check_status(ACCESS_ADMINISTRATOR); |
---|
| 39 | |
---|
| 40 | // +-----------------------------------------------------------------------+ |
---|
[9372] | 41 | // | Tabs | |
---|
[3673] | 42 | // +-----------------------------------------------------------------------+ |
---|
| 43 | |
---|
[9516] | 44 | $pendings_label = l10n('Pending Photos'); |
---|
| 45 | if ($page['community_nb_pendings'] > 0) |
---|
| 46 | { |
---|
| 47 | $pendings_label.= ' ('.$page['community_nb_pendings'].')'; |
---|
| 48 | } |
---|
| 49 | |
---|
[9372] | 50 | $tabs = array( |
---|
| 51 | array( |
---|
| 52 | 'code' => 'permissions', |
---|
| 53 | 'label' => l10n('Upload Permissions'), |
---|
| 54 | ), |
---|
| 55 | array( |
---|
| 56 | 'code' => 'pendings', |
---|
[9516] | 57 | 'label' => $pendings_label, |
---|
[9372] | 58 | ), |
---|
| 59 | ); |
---|
[3673] | 60 | |
---|
[9372] | 61 | $tab_codes = array_map( |
---|
| 62 | create_function('$a', 'return $a["code"];'), |
---|
| 63 | $tabs |
---|
| 64 | ); |
---|
[3673] | 65 | |
---|
[9372] | 66 | if (isset($_GET['tab']) and in_array($_GET['tab'], $tab_codes)) |
---|
[3673] | 67 | { |
---|
[9372] | 68 | $page['tab'] = $_GET['tab']; |
---|
[3673] | 69 | } |
---|
[9372] | 70 | else |
---|
| 71 | { |
---|
| 72 | $page['tab'] = $tabs[0]['code']; |
---|
| 73 | } |
---|
[3673] | 74 | |
---|
[9372] | 75 | $tabsheet = new tabsheet(); |
---|
| 76 | foreach ($tabs as $tab) |
---|
[3673] | 77 | { |
---|
[9372] | 78 | $tabsheet->add( |
---|
| 79 | $tab['code'], |
---|
| 80 | $tab['label'], |
---|
| 81 | COMMUNITY_BASE_URL.'-'.$tab['code'] |
---|
| 82 | ); |
---|
[3673] | 83 | } |
---|
[9372] | 84 | $tabsheet->select($page['tab']); |
---|
| 85 | $tabsheet->assign(); |
---|
[3673] | 86 | |
---|
| 87 | // +-----------------------------------------------------------------------+ |
---|
| 88 | // | template init | |
---|
| 89 | // +-----------------------------------------------------------------------+ |
---|
| 90 | |
---|
| 91 | $template->set_filenames( |
---|
| 92 | array( |
---|
[9372] | 93 | 'photos_add' => 'photos_add_'.$page['tab'].'.tpl' |
---|
[3673] | 94 | ) |
---|
| 95 | ); |
---|
| 96 | |
---|
| 97 | // +-----------------------------------------------------------------------+ |
---|
[9372] | 98 | // | Load the tab | |
---|
[3673] | 99 | // +-----------------------------------------------------------------------+ |
---|
| 100 | |
---|
[9372] | 101 | include(COMMUNITY_PATH.'admin_'.$page['tab'].'.php'); |
---|
[3673] | 102 | ?> |
---|