source: extensions/GuestBook/main.inc.php @ 28883

Last change on this file since 28883 was 28883, checked in by mistic100, 10 years ago

add menu_link parameter, add identifier for menu link

File size: 1.2 KB
Line 
1<?php
2/*
3Plugin Name: GuestBook
4Version: auto
5Description: Add a guestbook to the gallery
6Plugin URI: auto
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
12
13// TODO akismet
14global $conf, $prefixeTable;
15
16define('GUESTBOOK_ID',      basename(dirname(__FILE__)));
17define('GUESTBOOK_PATH' ,   PHPWG_PLUGINS_PATH . GUESTBOOK_ID . '/');
18define('GUESTBOOK_TABLE' ,  $prefixeTable . 'guestbook');
19define('GUESTBOOK_ADMIN',   get_root_url().'admin.php?page=plugin-' . GUESTBOOK_ID);
20define('GUESTBOOK_URL',     get_absolute_root_url() . make_index_url(array('section' => 'guestbook')));
21
22$conf['guestbook'] = safe_unserialize($conf['guestbook']);
23
24include_once(GUESTBOOK_PATH . 'include/events.inc.php');
25
26
27add_event_handler('init', 'guestbook_init');
28
29if (defined('IN_ADMIN'))
30{
31  add_event_handler('get_admin_plugin_menu_links', 'gb_admin_menu');
32}
33else
34{
35  add_event_handler('loc_end_section_init', 'gb_section_init');
36  add_event_handler('loc_end_index', 'gb_index');
37}
38
39if ($conf['guestbook']['menu_link'])
40{
41  add_event_handler('blockmanager_apply', 'gb_menubar_apply', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
42}
43
44
45function guestbook_init()
46{
47  load_language('plugin.lang', GUESTBOOK_PATH);
48}
Note: See TracBrowser for help on using the repository browser.