setup.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * setup.php
  4. *
  5. * Squirrelspell setup file, as defined by the SquirrelMail-1.2 API.
  6. *
  7. * @author Konstantin Riabitsev <icon at duke.edu>
  8. * @copyright &copy; 1999-2007 The SquirrelMail Project Team
  9. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10. * @version $Id$
  11. * @package plugins
  12. * @subpackage squirrelspell
  13. * @todo remove sqspell_ prefix from main php scripts.
  14. */
  15. /**
  16. * Standard SquirrelMail plugin initialization API.
  17. *
  18. * @return void
  19. */
  20. function squirrelmail_plugin_init_squirrelspell() {
  21. global $squirrelmail_plugin_hooks;
  22. $squirrelmail_plugin_hooks['template_construct_compose_buttons.tpl']['squirrelspell'] =
  23. 'squirrelspell_setup';
  24. $squirrelmail_plugin_hooks['optpage_register_block']['squirrelspell'] =
  25. 'squirrelspell_optpage_register_block';
  26. $squirrelmail_plugin_hooks['options_link_and_description']['squirrelspell'] =
  27. 'squirrelspell_options';
  28. $squirrelmail_plugin_hooks['right_main_after_header']['squirrelspell'] =
  29. 'squirrelspell_upgrade';
  30. }
  31. /**
  32. * Register option block
  33. *
  34. * This function formats and adds the plugin and its description to the
  35. * Options screen. Code moved to internal function in order to reduce
  36. * setup.php size.
  37. * @return void
  38. */
  39. function squirrelspell_optpage_register_block() {
  40. include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
  41. squirrelspell_optpage_block_function();
  42. }
  43. /**
  44. * Add spell check button in compose.
  45. *
  46. * This function adds a "Check Spelling" link to the "Compose" row
  47. * during message composition.
  48. * @return void
  49. */
  50. function squirrelspell_setup() {
  51. include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
  52. return squirrelspell_setup_function();
  53. }
  54. /**
  55. * Upgrade dictionaries
  56. *
  57. * Transparently upgrades user's dictionaries when message listing is loaded
  58. * @since 1.5.1 (sqspell 0.5)
  59. */
  60. function squirrelspell_upgrade() {
  61. include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
  62. squirrelspell_upgrade_function();
  63. }
  64. /**
  65. * Display SquirrelSpell version
  66. * @since 1.5.1 (sqspell 0.5)
  67. * @return string plugin's version
  68. */
  69. function squirrelspell_version() {
  70. return '0.5';
  71. }