From e04de0b9d163343c246f327b27edbd307a9a1029 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Wed, 5 Sep 2007 19:06:47 +0000 Subject: [PATCH] Add options block demo git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12674 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/demo/functions.php | 24 ++++++++++++++++++++++++ plugins/demo/setup.php | 26 +++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/plugins/demo/functions.php b/plugins/demo/functions.php index 8b3ad3dd..230df743 100644 --- a/plugins/demo/functions.php +++ b/plugins/demo/functions.php @@ -33,3 +33,27 @@ function demo_page_header_template_do() +/** + * Inserts an option block in the main SM options page + * + */ +function demo_option_link_do() +{ + + global $optpage_blocks; + + sq_change_text_domain('demo'); + + $optpage_blocks[] = array( + 'name' => _("Demo"), + 'url' => sqm_baseuri() . 'plugins/demo/demo.php', + 'desc' => _("This is where you would describe what your plugin does."), + 'js' => FALSE + ); + + sq_change_text_domain('squirrelmail'); + +} + + + diff --git a/plugins/demo/setup.php b/plugins/demo/setup.php index 95ef58ad..0d92dc0e 100644 --- a/plugins/demo/setup.php +++ b/plugins/demo/setup.php @@ -19,24 +19,30 @@ */ function squirrelmail_plugin_init_demo() { +//FIXME: put *ALL* SM hooks in here... which includes template_construct hooks for any templates that have plugin output sections in them... and put them all in the right order +//FIXME: many hooks have examples in the original demo plugin in trunk/plugins/demo global $squirrelmail_plugin_hooks; +//FIXME: this hook not yet implemented below $squirrelmail_plugin_hooks['login_cookie']['demo'] = 'demo_login_cookie'; +//FIXME: not all of the above hooks are yet implemented below $squirrelmail_plugin_hooks['login_top']['demo'] = 'demo_login_top'; +//FIXME: not all of the above hooks are yet implemented below $squirrelmail_plugin_hooks['login_bottom']['demo'] = 'demo_login_bottom'; +//FIXME: this template may have more plugin output sections that are not yet implemented below $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['demo'] = 'demo_page_header_template'; -//FIXME: put *ALL* SM hooks in here... which includes template_construct hooks for any templates that have plugin output sections in them and put page_header_template in right order -//FIXME: not all of the above hooks are yet implemented below -//FIXME: many hooks have examples in the original demo plugin in trunk/plugins/demo + $squirrelmail_plugin_hooks['optpage_register_block']['demo'] + = 'demo_option_link'; + } @@ -89,3 +95,17 @@ function demo_page_header_template() +/** + * Inserts an option block in the main SM options page + * + * @return void + * + */ +function demo_option_link() +{ + include_once(SM_PATH . 'plugins/demo/functions.php'); + demo_option_link_do(); +} + + + -- 2.25.1