source: trunk/plugins/add_index/main.admin.inc.php @ 2126

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