setup.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 1999-2025 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['right_main_after_header']['squirrelspell'] =
  27. 'squirrelspell_upgrade';
  28. }
  29. /**
  30. * Register option block
  31. *
  32. * This function formats and adds the plugin and its description to the
  33. * Options screen. Code moved to internal function in order to reduce
  34. * setup.php size.
  35. * @return void
  36. */
  37. function squirrelspell_optpage_register_block() {
  38. include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
  39. squirrelspell_optpage_block_function();
  40. }
  41. /**
  42. * Add spell check button in compose.
  43. *
  44. * This function adds a "Check Spelling" link to the "Compose" row
  45. * during message composition.
  46. * @return void
  47. */
  48. function squirrelspell_setup() {
  49. include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
  50. return squirrelspell_setup_function();
  51. }
  52. /**
  53. * Upgrade dictionaries
  54. *
  55. * Transparently upgrades user's dictionaries when message listing is loaded
  56. * @since 1.5.1 (sqspell 0.5)
  57. */
  58. function squirrelspell_upgrade() {
  59. include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
  60. squirrelspell_upgrade_function();
  61. }
  62. /**
  63. * Display SquirrelSpell version
  64. * @since 1.5.1 (sqspell 0.5)
  65. * @return string plugin's version
  66. */
  67. function squirrelspell_version() {
  68. return '0.5';
  69. }