source: extensions/community/admin.php @ 25450

Last change on this file since 25450 was 23085, checked in by plg, 11 years ago

New feature: user album. Only for registered users, no recursivity. Piwigo
will automatically create an upload album for each user with appropriate
community permissions, at first connection.

Bug fixed: on activation, do not create a new "Community" album if it already
exists.

Bug fixed: remove debug for quota

Bug fixed: round corners for number of pending pictures in admin menu.

File size: 3.8 KB
RevLine 
[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
24if( !defined("PHPWG_ROOT_PATH") )
25{
26  die ("Hacking attempt!");
27}
28
29include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
[9372]30include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
31
32define('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]38check_status(ACCESS_ADMINISTRATOR);
39
40// +-----------------------------------------------------------------------+
[9372]41// | Tabs                                                                  |
[3673]42// +-----------------------------------------------------------------------+
43
[9516]44$pendings_label = l10n('Pending Photos');
45if ($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    ),
[23085]59  array(
60    'code' => 'config',
61    'label' => l10n('Configuration'),
62    ),
[9372]63  );
[3673]64
[9372]65$tab_codes = array_map(
66  create_function('$a', 'return $a["code"];'),
67  $tabs
68  );
[3673]69
[9372]70if (isset($_GET['tab']) and in_array($_GET['tab'], $tab_codes))
[3673]71{
[9372]72  $page['tab'] = $_GET['tab'];
[3673]73}
[9372]74else
75{
76  $page['tab'] = $tabs[0]['code'];
77}
[3673]78
[9372]79$tabsheet = new tabsheet();
80foreach ($tabs as $tab)
[3673]81{
[9372]82  $tabsheet->add(
83    $tab['code'],
84    $tab['label'],
85    COMMUNITY_BASE_URL.'-'.$tab['code']
86    );
[3673]87}
[9372]88$tabsheet->select($page['tab']);
89$tabsheet->assign();
[3673]90
91// +-----------------------------------------------------------------------+
92// |                             template init                             |
93// +-----------------------------------------------------------------------+
94
95$template->set_filenames(
96  array(
[9372]97    'photos_add' => 'photos_add_'.$page['tab'].'.tpl'
[3673]98    )
99  );
100
101// +-----------------------------------------------------------------------+
[9372]102// |                             Load the tab                              |
[3673]103// +-----------------------------------------------------------------------+
104
[9372]105include(COMMUNITY_PATH.'admin_'.$page['tab'].'.php');
[3673]106?>
Note: See TracBrowser for help on using the repository browser.