c1c4cf2aa7f739966f69cd7cae19b70fc02d8a09
6 ** This file provides the framework for a plugin architecture.
8 ** Plugins will eventually be a way to provide added functionality
9 ** without having to patch the SquirrelMail source code. Have some
10 ** patients, though, as the these funtions might change in the near
13 ** Documentation on how to write plugins might show up some time.
20 // This function adds a plugin
21 function use_plugin ($name) {
22 include ('../plugins/'.$name.'/setup.php');
23 $function = 'squirrelmail_plugin_init_'.$name;
27 // This function executes a hook
28 function do_hook ($name) {
29 global $squirrelmail_plugin_hooks;
30 if (is_array($squirrelmail_plugin_hooks[$name])) {
31 reset($squirrelmail_plugin_hooks[$name]);
33 while (list ($id, $function) =
34 each ($squirrelmail_plugin_hooks[$name])) {
35 // Add something to set correct gettext domain for plugin
41 // On startup, register all plugins configured for use
42 if (is_array($plugins))
43 while (list ($id, $name) = each ($plugins))