6 * Copyright (c) 2000 by Michael Huttinger
8 * Quite a hack -- but my first attempt at a plugin. We were
9 * looking for a way to play a sound when there was unseen
10 * messages to look at. Nice for users who keep the squirrel
11 * mail window up for long periods of time and want to know
14 * Basically, I hacked much of left_main.php into a plugin that
15 * goes through each mail folder and increments a flag if
16 * there are unseen messages. If the final count of unseen
17 * folders is > 0, then we play a sound (using the HTML at the
18 * far end of this script).
20 * This was tested with IE5.0 - but I hear Netscape works well,
21 * too (with a plugin).
23 * @copyright © 1999-2006 The SquirrelMail Project Team
24 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
31 if (! defined('SM_PATH')) define('SM_PATH','../../');
36 function squirrelmail_plugin_init_newmail() {
37 global $squirrelmail_plugin_hooks;
39 $squirrelmail_plugin_hooks['left_main_before']['newmail'] = 'newmail_plugin';
40 $squirrelmail_plugin_hooks['optpage_register_block']['newmail'] = 'newmail_optpage_register_block';
41 $squirrelmail_plugin_hooks['options_save']['newmail'] = 'newmail_sav';
42 $squirrelmail_plugin_hooks['loading_prefs']['newmail'] = 'newmail_pref';
43 $squirrelmail_plugin_hooks['optpage_set_loadinfo']['newmail'] = 'newmail_set_loadinfo';
47 * Register newmail option block
49 function newmail_optpage_register_block() {
50 include_once(SM_PATH
. 'plugins/newmail/functions.php');
51 newmail_optpage_register_block_function();
55 * Save newmail plugin settings
57 function newmail_sav() {
58 include_once(SM_PATH
. 'plugins/newmail/functions.php');
59 newmail_sav_function();
63 * Load newmail plugin settings
65 function newmail_pref() {
66 include_once(SM_PATH
. 'plugins/newmail/functions.php');
67 newmail_pref_function();
73 * Used by option page when saving settings.
75 function newmail_set_loadinfo() {
76 include_once(SM_PATH
. 'plugins/newmail/functions.php');
77 newmail_set_loadinfo_function();
81 * Insert needed data in left_main
83 function newmail_plugin() {
84 include_once(SM_PATH
. 'plugins/newmail/functions.php');
85 newmail_plugin_function();