setup.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * newmail.php
  4. *
  5. * Copyright (c) 2000 by Michael Huttinger
  6. *
  7. * Quite a hack -- but my first attempt at a plugin. We were
  8. * looking for a way to play a sound when there was unseen
  9. * messages to look at. Nice for users who keep the squirrel
  10. * mail window up for long periods of time and want to know
  11. * when mail arrives.
  12. *
  13. * Basically, I hacked much of left_main.php into a plugin that
  14. * goes through each mail folder and increments a flag if
  15. * there are unseen messages. If the final count of unseen
  16. * folders is > 0, then we play a sound (using the HTML at the
  17. * far end of this script).
  18. *
  19. * This was tested with IE5.0 - but I hear Netscape works well,
  20. * too (with a plugin).
  21. *
  22. * @copyright &copy; 1999-2007 The SquirrelMail Project Team
  23. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  24. * @version $Id$
  25. * @package plugins
  26. * @subpackage newmail
  27. */
  28. /**
  29. * Init newmail plugin
  30. */
  31. function squirrelmail_plugin_init_newmail() {
  32. global $squirrelmail_plugin_hooks;
  33. $totalNewArr=array();
  34. global $totalNewArr;
  35. $squirrelmail_plugin_hooks['folder_status']['newmail'] = 'newmail_folder_status';
  36. $squirrelmail_plugin_hooks['left_main_after']['newmail'] = 'newmail_plugin';
  37. $squirrelmail_plugin_hooks['optpage_register_block']['newmail'] = 'newmail_optpage_register_block';
  38. $squirrelmail_plugin_hooks['options_save']['newmail'] = 'newmail_sav';
  39. $squirrelmail_plugin_hooks['loading_prefs']['newmail'] = 'newmail_pref';
  40. $squirrelmail_plugin_hooks['optpage_set_loadinfo']['newmail'] = 'newmail_set_loadinfo';
  41. }
  42. /**
  43. * Register newmail option block
  44. */
  45. function newmail_optpage_register_block() {
  46. include_once(SM_PATH . 'plugins/newmail/functions.php');
  47. newmail_optpage_register_block_function();
  48. }
  49. /**
  50. * Save newmail plugin settings
  51. */
  52. function newmail_sav() {
  53. include_once(SM_PATH . 'plugins/newmail/functions.php');
  54. newmail_sav_function();
  55. }
  56. /**
  57. * Load newmail plugin settings
  58. */
  59. function newmail_pref() {
  60. include_once(SM_PATH . 'plugins/newmail/functions.php');
  61. newmail_pref_function();
  62. }
  63. /**
  64. * Set loadinfo data
  65. *
  66. * Used by option page when saving settings.
  67. */
  68. function newmail_set_loadinfo() {
  69. include_once(SM_PATH . 'plugins/newmail/functions.php');
  70. newmail_set_loadinfo_function();
  71. }
  72. /**
  73. * Insert needed data in left_main
  74. */
  75. function newmail_plugin() {
  76. include_once(SM_PATH . 'plugins/newmail/functions.php');
  77. newmail_plugin_function();
  78. }