init.mod 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * init.mod
  4. * ---------
  5. * Squirrelspell module
  6. *
  7. * Copyright (c) 1999-2002 The SquirrelMail development team
  8. * Licensed under the GNU GPL. For full terms see the file COPYING.
  9. *
  10. * Initial loading of the popup window interface.
  11. *
  12. * $Id$
  13. *
  14. * @author Konstantin Riabitsev <icon@duke.edu> ($Author$)
  15. * @version $Date$
  16. */
  17. /**
  18. * See if we need to give user the option of choosing which dictionary
  19. * s/he wants to use to spellcheck his message.
  20. */
  21. $langs=sqspell_getSettings(null);
  22. $msg = '<form method="post">'
  23. . '<input type="hidden" name="MOD" value="check_me">'
  24. . '<input type="hidden" name="sqspell_text">'
  25. . '<p align="center">';
  26. if (sizeof($langs)==1){
  27. /**
  28. * Only one dictionary defined by the user. Submit the form
  29. * automatically.
  30. */
  31. $onload="sqspell_init(true)";
  32. $msg .= _("Please wait, communicating with the server...")
  33. . '</p>'
  34. . "<input type=\"hidden\" name=\"sqspell_use_app\" value=\"$langs[0]\">";
  35. } else {
  36. /**
  37. * More than one dictionary. Let the user choose the dictionary first
  38. * then manually submit the form.
  39. */
  40. $onload="sqspell_init(false)";
  41. $msg .= _("Please choose which dictionary you would like to use to spellcheck this message:")
  42. . '</p><p align="center">'
  43. . '<select name="sqspell_use_app">';
  44. for ($i=0; $i<sizeof($langs); $i++){
  45. $msg .= "<option";
  46. if (!$i) {
  47. $msg .= ' selected';
  48. }
  49. $msg .= " value=\"$langs[$i]\"> " . _($langs[$i]) . "</option>\n";
  50. }
  51. $msg .= ' </select>'
  52. . '<input type="submit" value="' . _("Go") . '">'
  53. . '</p>';
  54. }
  55. $msg .="</form>\n";
  56. sqspell_makeWindow($onload, _("SquirrelSpell Initiating"), "init.js", $msg);
  57. /**
  58. * For the Emacs weenies:
  59. * Local variables:
  60. * mode: php
  61. * End:
  62. */
  63. ?>