source: extensions/block_search/main.inc.php @ 32201

Last change on this file since 32201 was 32166, checked in by ddtddt, 5 years ago

[block_search]

File size: 2.4 KB
Line 
1<?php
2/*
3Plugin Name:  Block search
4Version: auto
5Description: Add a block search
6Plugin URI: https://piwigo.org/ext/extension_view.php?eid=896
7Author: ddtddt
8Author URI: http://temmii.com/piwigo/
9*/
10
11// +-----------------------------------------------------------------------+
12// |Block search for Piwigo by TEMMII                                      |
13// +-----------------------------------------------------------------------+
14// | Copyright(C) 2020 ddtddt                    http://temmii.com/piwigo/ |
15// +-----------------------------------------------------------------------+
16// | This program is free software; you can redistribute it and/or modify  |
17// | it under the terms of the GNU General Public License as published by  |
18// | the Free Software Foundation                                          |
19// |                                                                       |
20// | This program is distributed in the hope that it will be useful, but   |
21// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
22// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
23// | General Public License for more details.                              |
24// |                                                                       |
25// | You should have received a copy of the GNU General Public License     |
26// | along with this program; if not, write to the Free Software           |
27// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
28// | USA.                                                                  |
29// +-----------------------------------------------------------------------+
30
31defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
32
33define('BSEARCH_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
34
35add_event_handler('loading_lang', 'bsearch_loading_lang');       
36function bsearch_loading_lang(){
37  load_language('plugin.lang', BSEARCH_PATH);
38}
39
40  global $pwg_loaded_plugins;
41
42if (isset($pwg_loaded_plugins['PWG_Stuffs'])){
43
44  add_event_handler('get_stuffs_modules', 'register_bsearch_module');
45
46  function register_bsearch_module($modules){
47        array_push($modules, array(
48          'path' => BSEARCH_PATH.'/blocksearch',
49          'name' => l10n('Search'),
50          'description' => l10n('Add Search block'),
51        ));
52        return $modules;
53  }
54}else{
55  if (script_basename() == 'admin'){
56        global $page;
57        $page['errors'][] = l10n('For use "Block search" the plugin PWG_Stuffs must be installed and activated');
58  }     
59}
60
61
62
63
64   
65
66
67
68
69
Note: See TracBrowser for help on using the repository browser.