Changeset 1590 for trunk/plugins/hello_world
- Timestamp:
- Nov 1, 2006, 6:54:35 AM (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/hello_world/main.inc.php
r1586 r1590 2 2 Plugin Name: Hello World ! 3 3 Author: PhpWebGallery team 4 Description: This example plugin changes the page banner for the administration page 4 Description: This example plugin changes the page banner for the administration page. 5 5 */ 6 6 7 add_event_handler(' page_banner', 'hello_world_banner' );7 add_event_handler('loc_begin_page_header', 'hello_world_begin_header' ); 8 8 9 function hello_world_b anner($banner)9 function hello_world_begin_header() 10 10 { 11 11 global $page; 12 12 if ( isset($page['body_id']) and $page['body_id']=='theAdminPage') 13 13 { 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'); 15 19 } 16 return $banner;17 20 } 21 22 23 function 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 18 30 ?>
Note: See TracChangeset
for help on using the changeset viewer.