init.mod 1.8 KB

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