options_main.mod 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * options_main.mod
  4. *
  5. * Squirrelspell module
  6. *
  7. * Default page called when accessing SquirrelSpell's options.
  8. *
  9. * @author Konstantin Riabitsev <icon at duke.edu>
  10. * @copyright 1999-2025 The SquirrelMail Project Team
  11. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  12. * @version $Id$
  13. * @package plugins
  14. * @subpackage squirrelspell
  15. */
  16. global $SQSPELL_APP, $main_options_changed_message;
  17. if (!empty($main_options_changed_message))
  18. $msg = $main_options_changed_message;
  19. else
  20. $msg = '';
  21. $msg .= '<p>'
  22. . _("Please choose which options you wish to set up:")
  23. . '</p>'
  24. . '<ul>'
  25. . '<li><a href="sqspell_options.php?MOD=edit_dic">'
  26. . _("Edit your personal dictionary") . '</a></li>';
  27. /**
  28. * See if more than one dictionary is defined system-wide.
  29. * If so, let the user choose his preferred ones.
  30. */
  31. if (sizeof($SQSPELL_APP)>1) {
  32. $msg .= '<li><a href="sqspell_options.php?MOD=lang_setup">'
  33. . _("Set up international dictionaries")
  34. . "</a></li>\n";
  35. }
  36. /**
  37. * See if MCRYPT is available.
  38. * If so, let the user choose whether s/he wants to encrypt the
  39. * personal dictionary file.
  40. */
  41. if (function_exists("mcrypt_generic")) {
  42. $msg .= '<li><a href="sqspell_options.php?MOD=enc_setup">'
  43. . _("Encrypt or decrypt your personal dictionary")
  44. . "</a></li>\n";
  45. } else {
  46. $msg .= '<li>'
  47. . _("Personal dictionary encryption options are not available")
  48. . '</li>';
  49. }
  50. $msg .= "</ul>\n";
  51. // add checkbox to enable/disable the spellcheck button on compose screen
  52. //
  53. $sqspell_show_button = getPref($data_dir, $username, 'sqspell_show_button', 1);
  54. $msg .= '<form method="post">'
  55. . '<input type="hidden" name="MOD" value="change_main_options" />'
  56. . '<input type="hidden" name="smtoken" value="' . sm_generate_security_token() . '" />'
  57. . '<p>'
  58. . '<input type="checkbox" id="sqspell_show_button" name="sqspell_show_button" value="1"';
  59. if ($sqspell_show_button) {
  60. $msg .= ' checked="checked"';
  61. }
  62. $msg .= ' /><label for="sqspell_show_button"> '
  63. . sprintf(_("Show \"%s\" button when composing"), _("Check Spelling"))
  64. . "</label>\n";
  65. $msg .= " <input type=\"submit\" value=\" "
  66. . _("Make these changes") . " \" /></p></form>";
  67. sqspell_makePage( _("SquirrelSpell Options Menu"), null, $msg);
  68. /**
  69. * For Emacs weenies:
  70. * Local variables:
  71. * mode: php
  72. * End:
  73. * vim: syntax=php
  74. */