1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Piwigo - a PHP based picture gallery | |
---|
4 | // +-----------------------------------------------------------------------+ |
---|
5 | // | Copyright(C) 2008-2010 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')) or (!(defined('IN_ADMIN') and IN_ADMIN))) |
---|
25 | { |
---|
26 | die('Hacking attempt!'); |
---|
27 | } |
---|
28 | |
---|
29 | class AdminAddIndex extends AddIndex |
---|
30 | { |
---|
31 | function load_params() |
---|
32 | { |
---|
33 | global $conf; |
---|
34 | |
---|
35 | // Name of index file (index.php or index.htm or index.html) |
---|
36 | if (!isset($conf['add_index_filename'])) |
---|
37 | { |
---|
38 | $conf['add_index_filename'] = 'index.php'; |
---|
39 | } |
---|
40 | // Name of index file (index.php or index.htm or index.html) |
---|
41 | if (!isset($conf['add_index_source_directory_path'])) |
---|
42 | { |
---|
43 | // Name of the directoty use in order to copy index file |
---|
44 | $conf['add_index_source_directory_path'] = PHPWG_ROOT_PATH.'include/'; |
---|
45 | } |
---|
46 | } |
---|
47 | |
---|
48 | function loading_lang() |
---|
49 | { |
---|
50 | load_language('plugin.lang', $this->path); |
---|
51 | } |
---|
52 | |
---|
53 | function get_admin_advanced_features_links($advanced_features) |
---|
54 | { |
---|
55 | array_push($advanced_features, |
---|
56 | array |
---|
57 | ( |
---|
58 | 'CAPTION' => l10n('Advanced_Add_Index'), |
---|
59 | 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/main_page.php').'&overwrite' |
---|
60 | )); |
---|
61 | |
---|
62 | return $advanced_features; |
---|
63 | } |
---|
64 | |
---|
65 | function get_admins_site_links($site_manager_plugin_links, $site_id, $is_remote) |
---|
66 | { |
---|
67 | if (!$is_remote) |
---|
68 | { |
---|
69 | array_push($site_manager_plugin_links, |
---|
70 | array |
---|
71 | ( |
---|
72 | 'U_HREF' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/main_page.php').'&site_id='.$site_id, |
---|
73 | 'U_CAPTION' => l10n('Manager_Add_Index'), |
---|
74 | 'U_HINT' => l10n('Add_Index') |
---|
75 | )); |
---|
76 | } |
---|
77 | |
---|
78 | return $site_manager_plugin_links; |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|
82 | // Create object |
---|
83 | $add_index = new AdminAddIndex(); |
---|
84 | |
---|
85 | // Load Add Index parameters |
---|
86 | $add_index->load_params(); |
---|
87 | |
---|
88 | // Add events |
---|
89 | add_event_handler('loading_lang', array(&$add_index, 'loading_lang')); |
---|
90 | add_event_handler('get_admin_advanced_features_links', array(&$add_index, 'get_admin_advanced_features_links')); |
---|
91 | add_event_handler('get_admins_site_links', array(&$add_index, 'get_admins_site_links'), EVENT_HANDLER_PRIORITY_NEUTRAL, 3); |
---|
92 | |
---|
93 | ?> |
---|