source: extensions/whois_online_menu/main.inc.php @ 20461

Last change on this file since 20461 was 16720, checked in by ddtddt, 12 years ago

[extensions] - whois_online_menu - new plugin for T00kie

File size: 1.5 KB
Line 
1<?php
2/*
3Plugin Name: Whois Online in menu
4Version: 1
5Description: Add info whois_online in the menubar
6Plugin URI: http://piwigo.org
7Author: ddtddt
8Author URI:http://piwigo.org/ext/extension_view.php?eid=619
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13define('W1M_DIR' , basename(dirname(__FILE__)));
14define('W1M_PATH' , PHPWG_PLUGINS_PATH . W1M_DIR . '/');
15
16        load_language('plugin.lang', W1M_PATH);
17        load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) );
18
19add_event_handler('blockmanager_register_blocks', 'register_w1m_menubar_blocks');
20add_event_handler('blockmanager_apply', 'w1m_apply');
21
22function register_w1m_menubar_blocks( $menu_ref_arr )
23{
24  $menu = & $menu_ref_arr[0];
25  if ($menu->get_id() != 'menubar')
26    return;
27  $menu->register_block( new RegisteredBlock( 'mbWonline', 'Wonline', 'W1M'));
28}
29
30function w1m_apply($menu_ref_arr)
31{
32  global $template;
33
34 $menu = & $menu_ref_arr[0];
35 
36      // Envoi des données au template
37            $template->assign   (
38                array   (
39        'W1MTITLE'     => l10n('Whois Online'),
40                                )                       );
41
42 $template->assign('W1M_PATH', W1M_PATH);
43   
44    if (($block = $menu->get_block( 'mbWonline' )) != null) {
45        $template->set_template_dir(W1M_PATH.'template/');
46        $block->template = 'report_about.tpl';
47    }
48}
49
50add_event_handler('loc_begin_page_header', 'WHE1',20 );
51function WHE1()
52{
53
54global $template;
55
56$cachewol='';
57
58    $template->append('head_elements', $cachewol);
59}
60
61
62?>
Note: See TracBrowser for help on using the repository browser.