lang_setup.mod 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * lang_setup.mod
  4. *
  5. * Squirrelspell module
  6. *
  7. * This module displays available dictionaries to the user and lets
  8. * him/her choose which ones s/he wants to check messages with.
  9. *
  10. * @author Konstantin Riabitsev <icon at duke.edu>
  11. * @copyright 1999-2025 The SquirrelMail Project Team
  12. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  13. * @version $Id$
  14. * @package plugins
  15. * @subpackage squirrelspell
  16. */
  17. global $SQSPELL_APP;
  18. $msg = '<p>'
  19. . _("Please check any available international dictionaries which you would like to use when spellchecking:")
  20. . '</p>'
  21. . '<form method="post">'
  22. . '<input type="hidden" name="MOD" value="lang_change" />'
  23. . '<input type="hidden" name="smtoken" value="' . sm_generate_security_token() . '" />'
  24. . '<blockquote><p>';
  25. /**
  26. * Present a nice listing.
  27. */
  28. $langs = sqspell_getSettings();
  29. $add = '<p><label for="lang_default">'
  30. . _("Make this dictionary my default selection:")
  31. . "</label> <select name=\"lang_default\" id=\"lang_default\">\n";
  32. foreach ($SQSPELL_APP as $avail_lang => $ignore){
  33. $msg .= "<input type=\"checkbox\" name=\"use_langs[]\" "
  34. . "value=\"$avail_lang\" id=\"use_langs_$avail_lang\"";
  35. if (in_array($avail_lang, $langs)) {
  36. $msg .= ' checked="checked"';
  37. }
  38. $msg .= ' /> <label for="use_langs_' . $avail_lang . '">'
  39. . _($avail_lang) . "</label><br />\n";
  40. $add .= "<option";
  41. if ($avail_lang==$langs[0]) {
  42. $add .= ' selected="selected"';
  43. }
  44. $add .= " value=\"$avail_lang\" >" . _($avail_lang) . "</option>\n";
  45. }
  46. $msg .= "</p>\n" . $add . "</select>\n";
  47. $msg .= "</p></blockquote><p><input type=\"submit\" value=\" "
  48. . _("Make these changes") . " \" /></p></form>";
  49. sqspell_makePage(_("Add International Dictionaries"), null, $msg);
  50. /**
  51. * For Emacs weenies:
  52. * Local variables:
  53. * mode: php
  54. * End:
  55. * vim: syntax=php
  56. */