5 This module displays the words in your dictionary for editing.
7 // fidian, you owe me a pack of Guinness! :)
9 $words=sqspell_getWords();
11 // Agt. Smith: "You're empty."
13 sqspell_makePage("Personal Dictionary", null, "<p>No words in your personal dictionary.</p>");
15 // We're loaded with booty.
16 $pre_msg = "<p>Please check any words you wish to delete from your dictionary.</p>\n";
17 $pre_msg .= "<table border=\"0\" width=\"95%\" align=\"center\">\n";
18 $langs=sqspell_getSettings($words);
19 for ($i=0; $i<sizeof($langs); $i++
){
20 $lang_words = sqspell_getLang($words, $langs[$i]);
22 // No words in this dictionary.
23 if (!$msg) $msg = $pre_msg;
24 $msg .= "<tr bgcolor=\"$color[0]\" align=\"center\"><th>$langs[$i] dictionary</th></tr>
25 <tr><td align=\"center\">
26 <form method=\"post\">
27 <input type=\"hidden\" name=\"MOD\" value=\"forget_me\">
28 <input type=\"hidden\" name=\"sqspell_use_app\" value=\"$langs[$i]\">
29 <table border=\"0\" width=\"95%\" align=\"center\">
31 <td valign=\"top\">\n";
32 $words_ary=explode("\n", $lang_words);
33 array_pop($words_ary);
34 array_shift($words_ary);
35 // Do some fancy stuff to separate the words into three columns.
36 for ($j=0; $j<sizeof($words_ary); $j++
){
37 if ($j==intval(sizeof($words_ary)/3) ||
$j==intval(sizeof($words_ary)/3*2))
38 $msg .= "</td><td valign=\"top\">\n";
39 $msg .= "<input type=\"checkbox\" name=\"words_ary[]\" value=\"$words_ary[$j]\"> $words_ary[$j]<br>";
45 <tr bgcolor=\"$color[0]\" align=\"center\"><td>
46 <input type=\"submit\" value=\"Delete checked words\"></form>
47 </td></tr><tr><td><hr>
51 // Check if all dictionaries were empty.
53 $msg = "<p>No words in your dictionary.</p>";
54 else $msg .= "</table>";
55 sqspell_makePage("Edit your Personal Dictionary", null, $msg);