4 ** EDIT_DIC.MOD.PHP -- Squirrelspell module
6 ** Copyright (c) 1999-2002 The SquirrelMail development team
7 ** Licensed under the GNU GPL. For full terms see the file COPYING.
9 ** This module handles the encryption/decryption of the user dictionary
10 ** if the user so chooses from the options page.
15 // fidian, you owe me a pack of Guinness! :)
17 $words=sqspell_getWords();
19 // Agt. Smith: "You're empty."
21 sqspell_makePage(_("Personal Dictionary"), null, '<p>' . _("No words in your personal dictionary.") . '</p>');
23 // We're loaded with booty.
24 $pre_msg = '<p>' . _("Please check any words you wish to delete from your dictionary.") . "</p>\n";
25 $pre_msg .= "<table border=\"0\" width=\"95%\" align=\"center\">\n";
26 $langs=sqspell_getSettings($words);
27 for ($i=0; $i<sizeof($langs); $i++){
28 $lang_words = sqspell_getLang($words, $langs[$i]);
30 // No words in this dictionary.
34 $msg .= "<tr bgcolor=\"$color[0]\" align=\"center\"><th>" .
35 sprintf( _("%s dictionary"), $langs[$i] ) . '</th></tr>'.
36 '<tr><td align="center">'.
37 '<form method="post">'.
38 '<input type="hidden" name="MOD" value="forget_me">'.
39 '<input type="hidden" name="sqspell_use_app" value="' . $langs[$i] . '">'.
40 '<table border="0" width="95%" align="center">'.
42 "<td valign=\"top\">\n";
43 $words_ary=explode("\n", $lang_words);
44 array_pop($words_ary);
45 array_shift($words_ary);
46 // Do some fancy stuff to separate the words into three columns.
47 for ($j=0; $j<sizeof($words_ary); $j++){
48 if ($j==intval(sizeof($words_ary)/3) || $j==intval(sizeof($words_ary)/3*2))
49 $msg .= "</td><td valign=\"top\">\n";
50 $msg .= "<input type=\"checkbox\" name=\"words_ary[]\" value=\"$words_ary[$j]\"> $words_ary[$j]<br>";
52 $msg .= '</td></tr></table></td></tr>' .
53 "<tr bgcolor=\"$color[0]\" align=\"center\"><td>".
54 '<input type="submit" value="' . _("Delete checked words") . '"></form>'.
55 '</td></tr><tr><td><hr>'.
59 // Check if all dictionaries were empty.
61 $msg = '<p>' . _("No words in your personal dictionary.") . '</p>';
65 sqspell_makePage(_("Edit your Personal Dictionary"), null, $msg);