source: tags/build-Alligator02/plugins/hello_world/main.inc.php @ 5647

Last change on this file since 5647 was 1590, checked in by rvelices, 18 years ago

plugins last modifications + events are triggered now from picture.php

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 824 bytes
Line 
1<?php /*
2Plugin Name: Hello World !
3Author: PhpWebGallery team
4Description: This example plugin changes the page banner for the administration page.
5*/
6
7add_event_handler('loc_begin_page_header', 'hello_world_begin_header' );
8
9function hello_world_begin_header()
10{
11  global $page;
12  if ( isset($page['body_id']) and $page['body_id']=='theAdminPage')
13  {
14    $hellos = array( 'Aloha', 'Ahoy', 'Guten tag', 'Hello', 'Hoi', 'Hola', 'Salut', 'Yo' );
15    shuffle($hellos);
16    $page['page_banner'] = $hellos[0];
17    // just as an example we modify it a little bit later
18    add_event_handler('loc_end_page_header', 'hello_world_end_header');
19  }
20}
21
22
23function hello_world_end_header()
24{
25  global $template, $page;
26  $template->assign_var( 'PAGE_BANNER',
27    '<h1>"'.$page['page_banner'].'" from PhpWebGallery plugin!</h1>');
28}
29
30?>
Note: See TracBrowser for help on using the repository browser.