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

Last change on this file since 26065 was 26065, checked in by mistic100, 7 years ago

update for Piwigo 2.6 + code clean

File size: 1.3 KB
Line 
1<?php
2defined('GUESTBOOK_PATH') or die('Hacking attempt!');
3
4function gb_admin_menu($menu) 
5{
6  $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    $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    $page['section'] = 'guestbook';
41    $page['body_id'] = 'theGuestBook';
42    $page['is_external'] = true;
43    $page['is_homepage'] = false;
44   
45    $page['title'] = l10n('GuestBook');
46    $page['section_title'] = '<a href="'.get_gallery_home_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].l10n('GuestBook');
47  }
48}
49
50function gb_index() 
51{
52  global $template, $page, $conf;
53
54  if (isset($page['section']) and $page['section'] == 'guestbook')
55  {
56    if (is_a_guest() && !$conf['guestbook']['guest_can_view'])
57    {
58      access_denied();
59    }
60 
61    include(GUESTBOOK_PATH . '/include/guestbook.inc.php');
62  }
63}
Note: See TracBrowser for help on using the repository browser.