d484a1a59e2fabdd52c08ee0a825736f69276935
4 ** FORGET_ME.MOD.PHP -- Squirrelspell module
6 ** Copyright (c) 1999-2001 The SquirrelMail development team
7 ** Licensed under the GNU GPL. For full terms see the file COPYING.
9 ** This module deletes the words from the user dictionary. Called
10 ** after EDIT_DIC module.
15 // Make it two packs of Guinness and a bag of pistachios, fidian. :)
16 global $words_ary, $sqspell_use_app, $SQSPELL_VERSION;
17 if (sizeof($words_ary)){
18 // something needs to be deleted.
19 $words=sqspell_getWords();
20 $lang_words = sqspell_getLang($words, $sqspell_use_app);
22 sprintf( _("Deleting the following entries from <strong>%s</strong> dictionary:", $sqspell_use_app ) .
25 for ($i=0; $i<sizeof($words_ary); $i++
){
26 // remove word by word...
27 $lang_words=str_replace("$words_ary[$i]\n", "", $lang_words);
28 $msg .= "<li>$words_ary[$i]</li>\n";
30 $new_words_ary=split("\n", $lang_words);
31 // Wipe this lang, if only 2 members in array (no words left).
32 if (sizeof($new_words_ary)<=2) {
35 $new_lang_words = $lang_words;
36 // process the stuff and write the dic back.
37 $langs=sqspell_getSettings($words);
38 $words_dic = "# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: " . join(", ", $langs) . "\n";
39 for ($i=0; $i<sizeof($langs); $i++
){
40 if ($langs[$i]==$sqspell_use_app) {
41 $lang_words = $new_lang_words;
43 $lang_words = sqspell_getLang($words, $langs[$i]);
46 $words_dic .= $lang_words;
49 $words_dic .= "# End\n";
50 sqspell_writeWords($words_dic);
52 '<p>' _("All done!") . "</p>\n";
53 sqspell_makePage(_("Personal Dictionary Updated"), null, $msg);
55 // Click on some words first, Einstein!
56 sqspell_makePage(_("Personal Dictionary"), null, '<p>' . _("No changes requested.") . '</p>');