Last change
on this file since 1757 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 /* |
---|
2 | Plugin Name: Hello World ! |
---|
3 | Author: PhpWebGallery team |
---|
4 | Description: This example plugin changes the page banner for the administration page. |
---|
5 | */ |
---|
6 | |
---|
7 | add_event_handler('loc_begin_page_header', 'hello_world_begin_header' ); |
---|
8 | |
---|
9 | function 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 | |
---|
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 | |
---|
30 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.