7 * Copyright (c) 1999-2005 The SquirrelMail development team
8 * Licensed under the GNU GPL. For full terms see the file COPYING.
10 * This module lets the user edit his/her personal dictionary.
12 * @author Konstantin Riabitsev <icon@duke.edu>
15 * @subpackage squirrelspell
20 * Get the user dictionary and see if it's empty or not.
22 $words=sqspell_getWords();
25 * Agt. Smith: "You're empty."
28 sqspell_makePage(_("Personal Dictionary"), null,
29 '<p>' . _("No words in your personal dictionary.")
33 * We're loaded with booty.
36 . _("Please check any words you wish to delete from your dictionary.")
38 $pre_msg .= "<table border=\"0\" width=\"95%\" align=\"center\">\n";
40 * Get how many dictionaries this user has defined.
42 $langs=sqspell_getSettings($words);
43 for ($i=0; $i<sizeof($langs); $i++){
45 * Get all words from this language dictionary.
47 $lang_words = sqspell_getLang($words, $langs[$i]);
50 * There are words in this dictionary. If this is the first
51 * language we're processing, prepend the output with the
54 if (!isset($msg) || !$msg) {
57 $msg .= "<tr bgcolor=\"$color[0]\" align=\"center\"><th>"
58 . sprintf( _("%s dictionary"), $langs[$i] ) . '</th></tr>'
59 . '<tr><td align="center">'
60 . '<form method="post">'
61 . '<input type="hidden" name="MOD" value="forget_me" />'
62 . '<input type="hidden" name="sqspell_use_app" value="'
64 . '<table border="0" width="95%" align="center">'
66 . "<td valign=\"top\">\n";
67 $words_ary=explode("\n", $lang_words);
69 * There are two lines we need to remove:
73 array_pop($words_ary);
74 array_shift($words_ary);
76 * Do some fancy stuff to separate the words into three
79 for ($j=0; $j<sizeof($words_ary); $j++){
80 if ($j==intval(sizeof($words_ary)/3)
81 || $j==intval(sizeof($words_ary)/3*2)){
82 $msg .= "</td><td valign=\"top\">\n";
84 $msg .= "<input type=\"checkbox\" name=\"words_ary[]\" "
85 . 'value="'.htmlspecialchars($words_ary[$j]). '" /> '
86 . htmlspecialchars($words_ary[$j]) . "<br />\n";
88 $msg .= '</td></tr></table></td></tr>'
89 . "<tr bgcolor=\"$color[0]\" align=\"center\"><td>"
90 . '<input type="submit" value="' . _("Delete checked words")
92 . '</td></tr><tr><td><hr />'
97 * Check if all dictionaries were empty.
100 $msg = '<p>' . _("No words in your personal dictionary.") . '</p>';
104 sqspell_makePage(_("Edit your Personal Dictionary"), null, $msg);