setup.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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']
  36. = 'newmail_folder_status';
  37. $squirrelmail_plugin_hooks['template_construct_left_main.tpl']['newmail']
  38. = 'newmail_plugin';
  39. $squirrelmail_plugin_hooks['optpage_register_block']['newmail']
  40. = 'newmail_optpage_register_block';
  41. $squirrelmail_plugin_hooks['options_save']['newmail']
  42. = 'newmail_sav';
  43. $squirrelmail_plugin_hooks['loading_prefs']['newmail']
  44. = 'newmail_pref';
  45. $squirrelmail_plugin_hooks['optpage_set_loadinfo']['newmail']
  46. = 'newmail_set_loadinfo';
  47. }
  48. /**
  49. * Register newmail option block
  50. */
  51. function newmail_optpage_register_block() {
  52. include_once(SM_PATH . 'plugins/newmail/functions.php');
  53. newmail_optpage_register_block_function();
  54. }
  55. /**
  56. * Save newmail plugin settings
  57. */
  58. function newmail_sav() {
  59. include_once(SM_PATH . 'plugins/newmail/functions.php');
  60. newmail_sav_function();
  61. }
  62. /**
  63. * Load newmail plugin settings
  64. */
  65. function newmail_pref() {
  66. include_once(SM_PATH . 'plugins/newmail/functions.php');
  67. newmail_pref_function();
  68. }
  69. /**
  70. * Set loadinfo data
  71. *
  72. * Used by option page when saving settings.
  73. */
  74. function newmail_set_loadinfo() {
  75. include_once(SM_PATH . 'plugins/newmail/functions.php');
  76. newmail_set_loadinfo_function();
  77. }
  78. /**
  79. * Insert needed data in left_main
  80. */
  81. function newmail_plugin() {
  82. include_once(SM_PATH . 'plugins/newmail/functions.php');
  83. return newmail_plugin_function();
  84. }
  85. /**
  86. * Returns info about this plugin
  87. *
  88. */
  89. function newmail_info() {
  90. return array(
  91. 'english_name' => 'New Mail',
  92. 'authors' => array(
  93. 'SquirrelMail Team' => array(),
  94. ),
  95. 'version' => 'CORE',
  96. 'required_sm_version' => 'CORE',
  97. 'requires_configuration' => 0,
  98. 'summary' => 'This plugin is used to notify the user when a new mail arrives.',
  99. 'details' => 'This plugin is used to notify the user when a new mail arrives. This is accomplished by playing a sound through the browser or spawning a popup window whenever the user has unseen messages.',
  100. );
  101. }
  102. /**
  103. * Returns version info about this plugin
  104. *
  105. */
  106. function newmail_version() {
  107. $info = newmail_info();
  108. return $info['version'];
  109. }