4 * Message and Spam Filter Plugin - Setup
6 * @copyright © 1999-2006 The SquirrelMail Project Team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
17 function squirrelmail_plugin_init_filters() {
18 global $squirrelmail_plugin_hooks;
20 $squirrelmail_plugin_hooks['left_main_before']['filters'] = 'start_filters_hook';
21 $squirrelmail_plugin_hooks['right_main_after_header']['filters'] = 'start_filters_hook';
22 $squirrelmail_plugin_hooks['optpage_register_block']['filters'] = 'filters_optpage_register_block_hook';
23 $squirrelmail_plugin_hooks['special_mailbox']['filters'] = 'filters_special_mailbox';
24 $squirrelmail_plugin_hooks['rename_or_delete_folder']['filters'] = 'update_for_folder_hook';
25 $squirrelmail_plugin_hooks['template_construct_login_webmail.tpl']['filters'] = 'start_filters_hook';
26 $squirrelmail_plugin_hooks['folder_status']['filters'] = 'filters_folder_status';
30 * Report spam folder as special mailbox
31 * @param string $mb variable used by hook
32 * @return string spam folder name
35 function filters_special_mailbox( $mb ) {
36 global $data_dir, $username;
37 return( $mb == getPref($data_dir, $username, 'filters_spam_folder', 'na' ) );
41 * Called by hook to Register option blocks
44 function filters_optpage_register_block_hook() {
45 include_once(SM_PATH
. 'plugins/filters/filters.php');
46 filters_optpage_register_block ();
50 * Called by hook to Start Filtering
51 * @param mixed $args optional variable passed by hook
54 function start_filters_hook($args) {
55 include_once(SM_PATH
. 'plugins/filters/filters.php');
56 start_filters ($args);
60 * Called by hook to Update filters when Folders Change
63 function update_for_folder_hook($args) {
64 include_once(SM_PATH
. 'plugins/filters/filters.php');
65 update_for_folder ($args);