source: extensions/add_index/main.admin.inc.php @ 15907

Last change on this file since 15907 was 12801, checked in by rub, 12 years ago

Add upload directory
Fixed site id
Fixed first dir

Update Copyright (C)

  • Property svn:eol-style set to LF
File size: 3.3 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Add Index - a Piwigo Plugin                                           |
4// | Copyright (C) 2019-2011 Piwigo team                                   |
5// +-----------------------------------------------------------------------+
6// | This program is free software; you can redistribute it and/or modify  |
7// | it under the terms of the GNU General Public License as published by  |
8// | the Free Software Foundation                                          |
9// |                                                                       |
10// | This program is distributed in the hope that it will be useful, but   |
11// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
12// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
13// | General Public License for more details.                              |
14// |                                                                       |
15// | You should have received a copy of the GNU General Public License     |
16// | along with this program; if not, write to the Free Software           |
17// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
18// | USA.                                                                  |
19// +-----------------------------------------------------------------------+
20
21if ((!defined('PHPWG_ROOT_PATH')) or (!(defined('IN_ADMIN') and IN_ADMIN)))
22{
23  die('Hacking attempt!');
24}
25
26class AdminAddIndex extends AddIndex
27{
28  function load_params()
29  {
30    global $conf;
31
32    // Name of index file (index.php or index.htm or index.html)
33    if (!isset($conf['add_index_filename']))
34    {
35      $conf['add_index_filename'] = 'index.php';
36    }
37    // Name of index file (index.php or index.htm or index.html)
38    if (!isset($conf['add_index_source_directory_path']))
39    {
40      // Name of the directoty use in order to copy index file
41      $conf['add_index_source_directory_path'] = PHPWG_ROOT_PATH.'include/';
42    }
43  }
44
45  function loading_lang()
46  {
47    load_language('plugin.lang', $this->path);
48  }
49
50  function get_admin_advanced_features_links($advanced_features)
51  {
52    array_push($advanced_features,
53      array
54      (
55        'CAPTION' => l10n('Advanced_Add_Index'),
56        'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/main_page.php').'&amp;overwrite'
57      ));
58
59    return $advanced_features;
60  }
61
62  function get_admins_site_links($site_manager_plugin_links, $site_id, $is_remote)
63  {
64    if (!$is_remote)
65    {
66      array_push($site_manager_plugin_links,
67        array
68        (
69          'U_HREF' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/main_page.php').'&amp;site_id='.$site_id,
70          'U_CAPTION' => l10n('Manager_Add_Index'),
71          'U_HINT' => l10n('Add_Index')
72        ));
73    }
74
75    return $site_manager_plugin_links;
76  }
77}
78
79// Create object
80$add_index = new AdminAddIndex();
81
82// Load Add Index parameters
83$add_index->load_params();
84
85// Add events
86add_event_handler('loading_lang', array(&$add_index, 'loading_lang'));
87add_event_handler('get_admin_advanced_features_links', array(&$add_index, 'get_admin_advanced_features_links'));
88add_event_handler('get_admins_site_links', array(&$add_index, 'get_admins_site_links'), EVENT_HANDLER_PRIORITY_NEUTRAL, 3);
89
90?>
Note: See TracBrowser for help on using the repository browser.