Files
Piwigo/plugins/hello_world/main.inc.php
rvelices cb2408a82c Plugins:
- display author and and author url (if present) on plugin admin page
 - uniformized versions/authors... for all plugins in svn
 - security fix (html escape name, version, uri, author... to avoid javascript injection which could automatically simulate click on Install)
 - added confirmation for install/uninstall plugins

Web services:
 - web service explorer now caches method details in order to avoid unnecessary web calls
 - web service explorer can now send parameters as arrays
 - web service explorer uses now prototype.js version 1.5
 - small improvements

- added and use function bad_request (sends http status code 400)

git-svn-id: http://piwigo.org/svn/trunk@1852 68402e56-0260-453c-a942-63ccdbb3a9ee
2007-02-23 13:18:34 +00:00

33 lines
917 B
PHP

<?php /*
Plugin Name: Hello World
Version: 1.0
Description: This example plugin changes the page banner for the administration page.
Plugin URI: http://www.phpwebgallery.net
Author: PhpWebGallery team
Author URI: http://www.phpwebgallery.net
*/
add_event_handler('loc_begin_page_header', 'hello_world_begin_header' );
function hello_world_begin_header()
{
global $page;
if ( isset($page['body_id']) and $page['body_id']=='theAdminPage')
{
$hellos = array( 'Aloha', 'Ahoy', 'Guten tag', 'Hello', 'Hoi', 'Hola', 'Salut', 'Yo' );
shuffle($hellos);
$page['page_banner'] = $hellos[0];
// just as an example we modify it a little bit later
add_event_handler('loc_end_page_header', 'hello_world_end_header');
}
}
function hello_world_end_header()
{
global $template, $page;
$template->assign_var( 'PAGE_BANNER',
'<h1>"'.$page['page_banner'].'" from PhpWebGallery plugin!</h1>');
}
?>