4 ** FORGET_ME_NOT.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 saves the added words into the user dictionary. Called
10 ** after CHECK_ME module.
15 // For our friends with E_ALL.
16 global $words, $SQSPELL_VERSION, $SQSPELL_APP_DEFFAULT, $sqspell_use_app;
18 $new_words = ereg_replace("%", "\n", $words);
20 // Load the user dictionary.
21 $words=sqspell_getWords();
25 $words_dic="# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: $SQSPELL_APP_DEFAULT\n# $SQSPELL_APP_DEFAULT\n";
26 $words_dic .= $new_words . "# End\n";
28 // Do some fancy stuff in order to save the dictionary and not mangle the
30 $langs=sqspell_getSettings($words);
31 $words_dic = "# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: " . join(", ", $langs) . "\n";
32 for ($i=0; $i<sizeof($langs); $i++){
33 $lang_words=sqspell_getLang($words, $langs[$i]);
34 if ($langs[$i]==$sqspell_use_app){
36 $lang_words="# $langs[$i]\n";
38 $lang_words .= $new_words;
40 $words_dic .= $lang_words;
42 $words_dic .= "# End\n";
46 sqspell_writeWords($words_dic);
47 // display the splash screen, then close it automatically after 2 sec.
48 $onload = "setTimeout('self.close()', 2000)";
49 $msg = '<form onsubmit="return false"><div align="center"><input type="submit" value=" '.
50 _("Close") . ' " onclick="self.close()"></div></form>';
51 sqspell_makeWindow($onload, _("Personal Dictionary Updated"), null, $msg);