ade9c788ff76c6b3178dad8651ccb8b81278a04a
[squirrelmail.git] / plugins / squirrelspell / modules / init.mod.php
1 <?php
2 /**
3 INIT.MOD.PHP
4 -------------
5 Initial loading of the popup window interface.
6 **/
7
8 // See if we need to give user the option of choosing which dictionary
9 // he wants to use to spellcheck his message.
10 $langs=sqspell_getSettings(null);
11 $msg="<form method=\"post\">
12 <input type=\"hidden\" name=\"MOD\" value=\"check_me\">
13 <input type=\"hidden\" name=\"sqspell_text\">
14 <p align=\"center\">";
15 if (sizeof($langs)==1){
16 // only one dictionary defined by the users. Submit the form
17 // automatically.
18 $onload="sqspell_init(true)";
19 $msg .= "Please wait, communicating with the server...</p>
20 <input type=\"hidden\" name=\"sqspell_use_app\" value=\"$langs[0]\">
21 ";
22 } else {
23 // more than one dictionary. Let the user choose the dictionary first
24 // then manually submit the form.
25 $onload="sqspell_init(false)";
26 $msg .= "Please choose which dictionary you would like to use to spellcheck this
27 message:</p>
28 <p align=\"center\">
29 <select name=\"sqspell_use_app\">
30 ";
31 for ($i=0; $i<sizeof($langs); $i++){
32 $msg .= "<option";
33 if (!$i) $msg .= " selected";
34 $msg .= ">$langs[$i]</option>\n";
35 }
36
37 $msg .= " </select>
38 <input type=\"submit\" value=\"Go\">
39 </p>
40 ";
41 }
42 $msg .="</form>\n";
43 sqspell_makeWindow($onload, "SquirrelSpell Initiating", "init.js", $msg);
44 ?>