Last change
on this file since 13488 was
1900,
checked in by rub, 17 years ago
|
Apply property svn:eol-style Value: LF
|
-
Property svn:eol-style set to
LF
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
917 bytes
|
Line | |
---|
1 | <?php /* |
---|
2 | Plugin Name: Hello World |
---|
3 | Version: 1.0 |
---|
4 | Description: This example plugin changes the page banner for the administration page. |
---|
5 | Plugin URI: http://www.phpwebgallery.net |
---|
6 | Author: PhpWebGallery team |
---|
7 | Author URI: http://www.phpwebgallery.net |
---|
8 | */ |
---|
9 | |
---|
10 | add_event_handler('loc_begin_page_header', 'hello_world_begin_header' ); |
---|
11 | |
---|
12 | function hello_world_begin_header() |
---|
13 | { |
---|
14 | global $page; |
---|
15 | if ( isset($page['body_id']) and $page['body_id']=='theAdminPage') |
---|
16 | { |
---|
17 | $hellos = array( 'Aloha', 'Ahoy', 'Guten tag', 'Hello', 'Hoi', 'Hola', 'Salut', 'Yo' ); |
---|
18 | shuffle($hellos); |
---|
19 | $page['page_banner'] = $hellos[0]; |
---|
20 | // just as an example we modify it a little bit later |
---|
21 | add_event_handler('loc_end_page_header', 'hello_world_end_header'); |
---|
22 | } |
---|
23 | } |
---|
24 | |
---|
25 | |
---|
26 | function hello_world_end_header() |
---|
27 | { |
---|
28 | global $template, $page; |
---|
29 | $template->assign_var( 'PAGE_BANNER', |
---|
30 | '<h1>"'.$page['page_banner'].'" from PhpWebGallery plugin!</h1>'); |
---|
31 | } |
---|
32 | |
---|
33 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.