14db1594150ae01894ad362ae8c4b9fc9e79e93e
[squirrelmail.git] / plugins / demo / setup.php
1 <?php
2
3 /**
4 * SquirrelMail Demo Plugin
5 * @copyright &copy; 2006-2007 The SquirrelMail Project Team
6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
7 * @version $Id$
8 * @package plugins
9 * @subpackage demo
10 */
11
12
13
14 /**
15 * Register this plugin with SquirrelMail
16 *
17 * @return void
18 *
19 */
20 function squirrelmail_plugin_init_demo()
21 {
22 //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
23 //FIXME: many hooks have examples in the original demo plugin in trunk/plugins/demo
24
25 global $squirrelmail_plugin_hooks;
26
27 //FIXME: this hook not yet implemented below
28 $squirrelmail_plugin_hooks['login_cookie']['demo']
29 = 'demo_login_cookie';
30
31 //FIXME: not all of the above hooks are yet implemented below
32 $squirrelmail_plugin_hooks['login_top']['demo']
33 = 'demo_login_top';
34
35 //FIXME: not all of the above hooks are yet implemented below
36 $squirrelmail_plugin_hooks['login_bottom']['demo']
37 = 'demo_login_bottom';
38
39 //FIXME: this template may have more plugin output sections that are not yet implemented below
40 $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['demo']
41 = 'demo_page_header_template';
42
43 $squirrelmail_plugin_hooks['optpage_register_block']['demo']
44 = 'demo_option_link';
45
46 $squirrelmail_plugin_hooks['configtest']['demo']
47 = 'demo_check_configuration';
48 }
49
50
51
52 /**
53 * Returns info about this plugin
54 *
55 * @return array An array of plugin information.
56 *
57 */
58 function demo_info()
59 {
60
61 return array(
62 'english_name' => 'Demo',
63 'version' => 'CORE',
64 'summary' => 'This plugin provides test/sample code for many of the hook points in the SquirrelMail core.',
65 'details' => 'This plugin provides test/sample code for many of the hook points in the SquirrelMail core.',
66 'requires_configuration' => 0,
67 'requires_source_patch' => 0,
68 );
69
70 }
71
72
73
74 /**
75 * Returns version info about this plugin
76 *
77 */
78 function demo_version()
79 {
80 $info = demo_info();
81 return $info['version'];
82 }
83
84
85
86 /**
87 * Add link to menu at top of content pane
88 *
89 * @return void
90 *
91 */
92 function demo_page_header_template()
93 {
94 include_once(SM_PATH . 'plugins/demo/functions.php');
95 return demo_page_header_template_do();
96 }
97
98
99
100 /**
101 * Inserts an option block in the main SM options page
102 *
103 * @return void
104 *
105 */
106 function demo_option_link()
107 {
108 include_once(SM_PATH . 'plugins/demo/functions.php');
109 demo_option_link_do();
110 }
111
112
113
114 /**
115 * Validate that this plugin is configured correctly
116 *
117 * @return boolean Whether or not there was a
118 * configuration error for this plugin.
119 *
120 */
121 function demo_check_configuration()
122 {
123 include_once(SM_PATH . 'plugins/demo/functions.php');
124 return demo_check_configuration_do();
125 }
126
127
128