Ignore:
Timestamp:
Nov 1, 2006, 6:54:35 AM (18 years ago)
Author:
rvelices
Message:

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

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/plugins/hello_world/main.inc.php

    r1586 r1590  
    22Plugin Name: Hello World !
    33Author: PhpWebGallery team
    4 Description: This example plugin changes the page banner for the administration page
     4Description: This example plugin changes the page banner for the administration page.
    55*/
    66
    7 add_event_handler('page_banner', 'hello_world_banner' );
     7add_event_handler('loc_begin_page_header', 'hello_world_begin_header' );
    88
    9 function hello_world_banner($banner)
     9function hello_world_begin_header()
    1010{
    1111  global $page;
    1212  if ( isset($page['body_id']) and $page['body_id']=='theAdminPage')
    1313  {
    14     return '<h1>Hello world from PhpWebGallery plugin!</h1>';
     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');
    1519  }
    16   return $banner;
    1720}
     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
    1830?>
Note: See TracChangeset for help on using the changeset viewer.