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

Last change on this file since 1699 was 1699, checked in by rub, 18 years ago

Feature Issue ID 0000496: Integrate MOD add_index on PWG with plugin.lang.php

Add some plugin triggers:

o for help
o for language
o for site manager
o for advanced features

Allow to launch directly plugin page (without section key)

Add add_index plugin, available on site manager and advanced features

Configuration page and best help must be coming soon.

File size: 3.3 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// | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net              |
7// +-----------------------------------------------------------------------+
8// | branch        : BSF (Best So Far)
9// | file          : $RCSfile$
10// | last update   : $Date: 2006-07-18 23:38:54 +0200 (mar., 18 juil. 2006) $
11// | last modifier : $Author: rub $
12// | revision      : $Revision: 1481 $
13// +-----------------------------------------------------------------------+
14// | This program is free software; you can redistribute it and/or modify  |
15// | it under the terms of the GNU General Public License as published by  |
16// | the Free Software Foundation                                          |
17// |                                                                       |
18// | This program is distributed in the hope that it will be useful, but   |
19// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
20// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
21// | General Public License for more details.                              |
22// |                                                                       |
23// | You should have received a copy of the GNU General Public License     |
24// | along with this program; if not, write to the Free Software           |
25// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
26// | USA.                                                                  |
27// +-----------------------------------------------------------------------+
28
29if ((!defined('PHPWG_ROOT_PATH')) or (!(defined('IN_ADMIN') and IN_ADMIN)))
30{
31  die('Hacking attempt!');
32}
33
34class AdminAddIndex extends AddIndex
35{
36  function loading_lang()
37  {
38    global $lang;
39
40    include(get_language_filepath('plugin.lang.php', $this->path));
41  }
42
43  function array_advanced_features($advanced_features)
44  {
45    array_push($advanced_features,
46      array
47      (
48        'CAPTION' => l10n('Advanced_Add_Index'),
49        'URL' => get_root_url().'admin.php?page=main_page&page_type=plugin&plugin_id=add_index&overwrite'
50      ));
51
52    return $advanced_features;
53  }
54
55  function array_site_manager_plugin_links($site_manager_plugin_links, $site_id, $is_remote)
56  {
57    if (!$is_remote)
58    {
59      array_push($site_manager_plugin_links,
60        array
61        (
62          'U_HREF' => get_root_url().'admin.php?page=main_page&page_type=plugin&plugin_id=add_index&site_id='.$site_id,
63          'U_CAPTION' => l10n('Manager_Add_Index'),
64          'U_HINT' => l10n('Add_Index')
65        ));
66    }
67
68    return $site_manager_plugin_links;
69  }
70}
71
72$add_index = new AdminAddIndex();
73
74add_event_handler('loading_lang', array(&$add_index, 'loading_lang'));
75add_event_handler('array_advanced_features', array(&$add_index, 'array_advanced_features'));
76add_event_handler('array_site_manager_plugin_links', array(&$add_index, 'array_site_manager_plugin_links'), EVENT_HANDLER_PRIORITY_NEUTRAL, 3);
77
78?>
Note: See TracBrowser for help on using the repository browser.