source: extensions/GuestBook/include/events.inc.php @ 24889

Revision 24889, 1.5 KB checked in by mistic100, 6 years ago (diff)

use my plugin architecture, add options to hide the page for guests, fix admin links in mails

Line 
1<?php
2defined('GUESTBOOK_PATH') or die('Hacking attempt!');
3
4function gb_admin_menu($menu) 
5{
6  array_push($menu, array(
7    'NAME' => 'GuestBook',
8    'URL' => GUESTBOOK_ADMIN,
9  ));
10  return $menu;
11}
12
13function gb_menubar_apply($menu_ref_arr)
14{
15  global $conf;
16 
17  if (is_a_guest() && !$conf['guestbook']['guest_can_view'])
18  {
19    return;
20  }
21 
22  $menu = &$menu_ref_arr[0];
23 
24  if ( ($block = $menu->get_block('mbMenu')) != null )
25  {
26    array_push($block->data, array(
27      'URL' => GUESTBOOK_URL,
28      'TITLE' => l10n('GuestBook'),
29      'NAME' => l10n('GuestBook')
30    ));
31  }
32}
33
34function gb_section_init()
35{
36  global $tokens, $page, $conf;
37
38  if ($tokens[0] == 'guestbook')
39  {
40    add_event_handler('loc_begin_page_header', 'gb_page_header');
41   
42    $page['section'] = 'guestbook';
43    $page['title'] = l10n('GuestBook');
44    $page['section_title'] = '<a href="'.get_gallery_home_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].l10n('GuestBook');
45  }
46}
47
48function gb_page_header()
49{
50  global $page;
51  $page['body_id'] = 'theGuestBook';
52}
53
54function gb_index() 
55{
56  global $template, $page, $conf;
57 
58  if (is_a_guest() && !$conf['guestbook']['guest_can_view'])
59  {
60    access_denied();
61  }
62
63  if (isset($page['section']) and $page['section'] == 'guestbook')
64  {
65    include(GUESTBOOK_PATH . '/include/guestbook.inc.php');
66  }
67}
68
69/*function gb_register_stuffs_module($modules)
70{
71  array_push($modules, array(
72    'path' => GUESTBOOK_PATH . '/stuffs_module',
73    'name' => GB_NAME,
74    'description' => l10n('gb_stuffs_desc'),
75  ));
76
77  return $modules;
78}*/
Note: See TracBrowser for help on using the repository browser.