source: extensions/community/admin.php @ 9372

Last change on this file since 9372 was 9372, checked in by plg, 13 years ago

Rewritten version of Community plugin :

  • user upload (web form on gallery side)
  • precise permission manage (who, where, with moderation or not, ability to create sub-albums)
  • email notification to administrators when photos are uploaded

Requires Piwigo 2.2.0RC3

File size: 3.6 KB
Line 
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
24if( !defined("PHPWG_ROOT_PATH") )
25{
26  die ("Hacking attempt!");
27}
28
29include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
30include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
31
32load_language('plugin.lang', COMMUNITY_PATH);
33
34define('COMMUNITY_BASE_URL', get_root_url().'admin.php?page=plugin-community');
35
36// +-----------------------------------------------------------------------+
37// | Check Access and exit when user status is not ok                      |
38// +-----------------------------------------------------------------------+
39
40check_status(ACCESS_ADMINISTRATOR);
41
42// +-----------------------------------------------------------------------+
43// | Tabs                                                                  |
44// +-----------------------------------------------------------------------+
45
46$tabs = array(
47  array(
48    'code' => 'permissions',
49    'label' => l10n('Upload Permissions'),
50    ),
51  array(
52    'code' => 'pendings',
53    'label' => l10n('Pending Photos'),
54    ),
55  );
56
57$tab_codes = array_map(
58  create_function('$a', 'return $a["code"];'),
59  $tabs
60  );
61
62if (isset($_GET['tab']) and in_array($_GET['tab'], $tab_codes))
63{
64  $page['tab'] = $_GET['tab'];
65}
66else
67{
68  $page['tab'] = $tabs[0]['code'];
69}
70
71$tabsheet = new tabsheet();
72foreach ($tabs as $tab)
73{
74  $tabsheet->add(
75    $tab['code'],
76    $tab['label'],
77    COMMUNITY_BASE_URL.'-'.$tab['code']
78    );
79}
80$tabsheet->select($page['tab']);
81$tabsheet->assign();
82
83// +-----------------------------------------------------------------------+
84// |                             template init                             |
85// +-----------------------------------------------------------------------+
86
87$template->set_filenames(
88  array(
89    'photos_add' => 'photos_add_'.$page['tab'].'.tpl'
90    )
91  );
92
93// +-----------------------------------------------------------------------+
94// |                             Load the tab                              |
95// +-----------------------------------------------------------------------+
96
97include(COMMUNITY_PATH.'admin_'.$page['tab'].'.php');
98?>
Note: See TracBrowser for help on using the repository browser.