Source for file setup.php

Documentation is available at setup.php

  1. <?php
  2.  
  3. /**
  4.  * newmail.php
  5.  *
  6.  * Copyright (c) 2000 by Michael Huttinger
  7.  *
  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
  12.  * when mail arrives.
  13.  *
  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).
  19.  *
  20.  * This was tested with IE5.0 - but I hear Netscape works well,
  21.  * too (with a plugin).
  22.  *
  23.  * @copyright 1999-2020 The SquirrelMail Project Team
  24.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  25.  * @version $Id: setup.php 14845 2020-01-07 08:09:34Z pdontthink $
  26.  * @package plugins
  27.  * @subpackage newmail
  28.  */
  29.  
  30.  
  31. /**
  32.  * Init newmail plugin
  33.  */
  34.  
  35.     global $squirrelmail_plugin_hooks;
  36.     $totalNewArr=array();
  37.     global $totalNewArr;
  38.  
  39.     $squirrelmail_plugin_hooks['folder_status']['newmail']
  40.         = 'newmail_folder_status';
  41.     $squirrelmail_plugin_hooks['template_construct_left_main.tpl']['newmail']
  42.         = 'newmail_plugin';
  43.     $squirrelmail_plugin_hooks['optpage_register_block']['newmail']
  44.         = 'newmail_optpage_register_block';
  45.     $squirrelmail_plugin_hooks['options_save']['newmail']
  46.         = 'newmail_sav';
  47.     $squirrelmail_plugin_hooks['loading_prefs']['newmail']
  48.         = 'newmail_pref';
  49.     $squirrelmail_plugin_hooks['optpage_set_loadinfo']['newmail']
  50.         = 'newmail_set_loadinfo';
  51.  
  52. }
  53.  
  54.  
  55. /**
  56.  * Register newmail option block
  57.  */
  58.     include_once(SM_PATH 'plugins/newmail/functions.php');
  59. }
  60.  
  61.  
  62. /**
  63.  * Save newmail plugin settings
  64.  */
  65. function newmail_sav({
  66.     include_once(SM_PATH 'plugins/newmail/functions.php');
  67. }
  68.  
  69.  
  70. /**
  71.  * Load newmail plugin settings
  72.  */
  73. function newmail_pref({
  74.     include_once(SM_PATH 'plugins/newmail/functions.php');
  75. }
  76.  
  77.  
  78. /**
  79.  * Set loadinfo data
  80.  *
  81.  * Used by option page when saving settings.
  82.  */
  83. function newmail_set_loadinfo({
  84.     include_once(SM_PATH 'plugins/newmail/functions.php');
  85. }
  86.  
  87.  
  88. /**
  89.  * Insert needed data in left_main
  90.  */
  91. function newmail_plugin({
  92.     include_once(SM_PATH 'plugins/newmail/functions.php');
  93.     return newmail_plugin_function();
  94. }
  95.  
  96.  
  97. /**
  98.  * Returns info about this plugin
  99.  *
  100.  */
  101. function newmail_info({
  102.     return array(
  103.         'english_name' => 'New Mail',
  104.         'authors' => array(
  105.             'SquirrelMail Team' => array(),
  106.         ),
  107.         'version' => 'CORE',
  108.         'required_sm_version' => 'CORE',
  109.         'requires_configuration' => 0,
  110.         'summary' => 'This plugin is used to notify the user when a new mail arrives.',
  111.         '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.',
  112.     );
  113. }
  114.  
  115.  
  116.  
  117. /**
  118.  * Returns version info about this plugin
  119.  *
  120.  */
  121. function newmail_version({
  122.     $info newmail_info();
  123.     return $info['version'];
  124. }

Documentation generated on Mon, 13 Jan 2020 04:23:32 +0100 by phpDocumentor 1.4.3