Happy New Year
[squirrelmail.git] / plugins / squirrelspell / modules / init.mod
CommitLineData
849bdf42 1<?php
4b4abf93 2
d112ed5a 3/**
91e0dccc 4 * init.mod
d112ed5a 5 *
4b4abf93 6 * Squirrelspell module
d112ed5a 7 *
8 * Initial loading of the popup window interface.
9 *
4b4abf93 10 * @author Konstantin Riabitsev <icon at duke.edu>
77a1e3d1 11 * @copyright 1999-2022 The SquirrelMail Project Team
4b4abf93 12 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
44d661aa 13 * @version $Id$
14 * @package plugins
15 * @subpackage squirrelspell
d112ed5a 16 */
849bdf42 17
d112ed5a 18/**
91e0dccc 19 * See if we need to give user the option of choosing which dictionary
d112ed5a 20 * s/he wants to use to spellcheck his message.
21 */
7996c920 22$langs=sqspell_getSettings();
d112ed5a 23$msg = '<form method="post">'
04fa3c41 24 . '<input type="hidden" name="MOD" value="check_me" />'
25 . '<input type="hidden" name="sqspell_text" />'
d112ed5a 26 . '<p align="center">';
91e0dccc 27if (sizeof($langs)==1){
d112ed5a 28 /**
29 * Only one dictionary defined by the user. Submit the form
30 * automatically.
31 */
32 $onload="sqspell_init(true)";
33 $msg .= _("Please wait, communicating with the server...")
34 . '</p>'
04fa3c41 35 . "<input type=\"hidden\" name=\"sqspell_use_app\" value=\"$langs[0]\" />";
d112ed5a 36} else {
37 /**
38 * More than one dictionary. Let the user choose the dictionary first
39 * then manually submit the form.
40 */
41 $onload="sqspell_init(false)";
42 $msg .= _("Please choose which dictionary you would like to use to spellcheck this message:")
43 . '</p><p align="center">'
44 . '<select name="sqspell_use_app">';
45 for ($i=0; $i<sizeof($langs); $i++){
46 $msg .= "<option";
47 if (!$i) {
e1728a7a 48 $msg .= ' selected="selected"';
2b5a7157 49 }
d112ed5a 50 $msg .= " value=\"$langs[$i]\"> " . _($langs[$i]) . "</option>\n";
91e0dccc 51 }
d112ed5a 52 $msg .= ' </select>'
04fa3c41 53 . '<input type="submit" value="' . _("Go") . '" />'
d112ed5a 54 . '</p>';
55}
56$msg .="</form>\n";
57sqspell_makeWindow($onload, _("SquirrelSpell Initiating"), "init.js", $msg);
58
59/**
60 * For the Emacs weenies:
61 * Local variables:
62 * mode: php
63 * End:
2b6b400e 64 * vim: syntax=php
d112ed5a 65 */