[16720] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Whois Online in menu |
---|
[31477] | 4 | Version: auto |
---|
[16720] | 5 | Description: Add info whois_online in the menubar |
---|
[31477] | 6 | Plugin URI:http://piwigo.org/ext/extension_view.php?eid=619 |
---|
[16720] | 7 | Author: ddtddt |
---|
[31477] | 8 | Author URI: http://temmii.com/piwigo/ |
---|
[16720] | 9 | */ |
---|
| 10 | |
---|
[31477] | 11 | // +-----------------------------------------------------------------------+ |
---|
| 12 | // | Whois Online in menu by plugin for Piwigo | |
---|
| 13 | // +-----------------------------------------------------------------------+ |
---|
| 14 | // | Copyright(C) 2012-2016 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 | |
---|
[16720] | 31 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 32 | |
---|
| 33 | define('W1M_DIR' , basename(dirname(__FILE__))); |
---|
| 34 | define('W1M_PATH' , PHPWG_PLUGINS_PATH . W1M_DIR . '/'); |
---|
| 35 | |
---|
[31477] | 36 | load_language('plugin.lang', W1M_PATH); |
---|
| 37 | load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) ); |
---|
[16720] | 38 | |
---|
| 39 | add_event_handler('blockmanager_register_blocks', 'register_w1m_menubar_blocks'); |
---|
| 40 | add_event_handler('blockmanager_apply', 'w1m_apply'); |
---|
| 41 | |
---|
[31477] | 42 | function register_w1m_menubar_blocks( $menu_ref_arr ){ |
---|
[16720] | 43 | $menu = & $menu_ref_arr[0]; |
---|
| 44 | if ($menu->get_id() != 'menubar') |
---|
[31477] | 45 | return; |
---|
[16720] | 46 | $menu->register_block( new RegisteredBlock( 'mbWonline', 'Wonline', 'W1M')); |
---|
| 47 | } |
---|
| 48 | |
---|
[31477] | 49 | function w1m_apply($menu_ref_arr){ |
---|
[16720] | 50 | global $template; |
---|
[31477] | 51 | $menu = & $menu_ref_arr[0]; |
---|
| 52 | $template->assign ( |
---|
| 53 | array( |
---|
| 54 | 'W1MTITLE' => l10n('Whois Online'), |
---|
| 55 | )); |
---|
[16720] | 56 | |
---|
[31477] | 57 | $template->assign('W1M_PATH', W1M_PATH); |
---|
| 58 | if (($block = $menu->get_block( 'mbWonline' )) != null) { |
---|
[16720] | 59 | $template->set_template_dir(W1M_PATH.'template/'); |
---|
| 60 | $block->template = 'report_about.tpl'; |
---|
[31477] | 61 | } |
---|
[16720] | 62 | } |
---|
| 63 | |
---|
| 64 | add_event_handler('loc_begin_page_header', 'WHE1',20 ); |
---|
[31477] | 65 | function WHE1(){ |
---|
| 66 | global $template; |
---|
| 67 | $cachewol=''; |
---|
| 68 | $template->append('head_elements', $cachewol); |
---|
[16720] | 69 | } |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | ?> |
---|