Source for file setup.php

Documentation is available at setup.php

  1. <?php
  2. /**
  3.  * setup.php
  4.  * -----------
  5.  * Squirrelspell setup file, as defined by the SquirrelMail-1.2 API.
  6.  *
  7.  * Copyright (c) 1999-2006 The SquirrelMail Project Team
  8.  * Licensed under the GNU GPL. For full terms see the file COPYING.
  9.  *
  10.  * @author Konstantin Riabitsev <[email protected]>
  11.  * @version $Id: setup.php,v 1.10.2.6 2006/02/03 22:27:52 jervfors Exp $
  12.  * @package plugins
  13.  * @subpackage squirrelspell
  14.  */
  15.  
  16. /** @ignore */
  17. if (defined('SM_PATH')) define('SM_PATH','../../');
  18.  
  19. /**
  20.  * Standard SquirrelMail plugin initialization API.
  21.  *
  22.  * @return void 
  23.  */
  24.   global $squirrelmail_plugin_hooks;
  25.   $squirrelmail_plugin_hooks['compose_button_row']['squirrelspell'=
  26.       'squirrelspell_setup';
  27.   $squirrelmail_plugin_hooks['optpage_register_block']['squirrelspell'=
  28.       'squirrelspell_optpage_register_block';
  29.   $squirrelmail_plugin_hooks['options_link_and_description']['squirrelspell'=
  30.       'squirrelspell_options';
  31. }
  32.  
  33. /**
  34.  * This function formats and adds the plugin and its description to the
  35.  * Options screen.
  36.  *
  37.  * @return void 
  38.  */
  39.   global $optpage_blocks;
  40.   /**
  41.    * soupNazi checks if this browser is capable of using the plugin.
  42.    */
  43.   if (!soupNazi()) {
  44.     /**
  45.      * The browser checks out.
  46.      * Register Squirrelspell with the $optionpages array.
  47.      */
  48.     $optpage_blocks[=
  49.       array(
  50.         'name' => _("SpellChecker Options"),
  51.         'url'  => '../plugins/squirrelspell/sqspell_options.php',
  52.         'desc' => _("Here you may set up how your personal dictionary is stored, edit it, or choose which languages should be available to you when spell-checking."),
  53.         'js'   => TRUE);
  54.   }
  55. }
  56.  
  57. /**
  58.  * This function adds a "Check Spelling" link to the "Compose" row
  59.  * during message composition.
  60.  *
  61.  * @return void 
  62.  */
  63. function squirrelspell_setup({
  64.   /**
  65.    * Check if this browser is capable of displaying SquirrelSpell
  66.    * correctly.
  67.    */
  68.   if (!soupNazi()) {
  69.     /**
  70.      * Some people may choose to disable javascript even though their
  71.      * browser is capable of using it. So these freaks don't complain,
  72.      * use document.write() so the "Check Spelling" button is not
  73.      * displayed if js is off in the browser.
  74.      */
  75.     echo "<script type=\"text/javascript\">\n".
  76.       "<!--\n".
  77.       'document.write("<input type=\"button\" value=\"'.
  78.       _("Check Spelling").
  79.       '\" name=\"check_spelling\" onclick=\"window.open(\'../plugins/squirrelspell/sqspell_'.
  80.       'interface.php\', \'sqspell\', \'status=yes,width=550,height=370,'.
  81.       'resizable=yes\')\" />");' "\n".
  82.       "//-->\n".
  83.       "</script>\n";
  84.   }
  85. }
  86.  
  87. ?>

Documentation generated on Sat, 07 Oct 2006 16:33:39 +0300 by phpDocumentor 1.3.0RC6