Happy New Year
[squirrelmail.git] / plugins / squirrelspell / modules / init.mod
1 <?php
2
3 /**
4 * init.mod
5 *
6 * Squirrelspell module
7 *
8 * Initial loading of the popup window interface.
9 *
10 * @author Konstantin Riabitsev <icon at duke.edu>
11 * @copyright 1999-2020 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
18 /**
19 * See if we need to give user the option of choosing which dictionary
20 * s/he wants to use to spellcheck his message.
21 */
22 $langs=sqspell_getSettings();
23 $msg = '<form method="post">'
24 . '<input type="hidden" name="MOD" value="check_me" />'
25 . '<input type="hidden" name="sqspell_text" />'
26 . '<p align="center">';
27 if (sizeof($langs)==1){
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>'
35 . "<input type=\"hidden\" name=\"sqspell_use_app\" value=\"$langs[0]\" />";
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) {
48 $msg .= ' selected="selected"';
49 }
50 $msg .= " value=\"$langs[$i]\"> " . _($langs[$i]) . "</option>\n";
51 }
52 $msg .= ' </select>'
53 . '<input type="submit" value="' . _("Go") . '" />'
54 . '</p>';
55 }
56 $msg .="</form>\n";
57 sqspell_makeWindow($onload, _("SquirrelSpell Initiating"), "init.js", $msg);
58
59 /**
60 * For the Emacs weenies:
61 * Local variables:
62 * mode: php
63 * End:
64 * vim: syntax=php
65 */