5 This module saves the added words into the user dictionary. Called
8 // For our friends with E_ALL.
9 global $words, $SQSPELL_VERSION, $SQSPELL_APP_DEFFAULT, $sqspell_use_app;
11 $new_words = ereg_replace("%", "\n", $words);
13 // Load the user dictionary.
14 $words=sqspell_getWords();
18 $words_dic="# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: $SQSPELL_APP_DEFAULT\n# $SQSPELL_APP_DEFAULT\n";
19 $words_dic .= $new_words . "# End\n";
21 // Do some fancy stuff in order to save the dictionary and not mangle the
23 $langs=sqspell_getSettings($words);
24 $words_dic = "# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last Revision: " . date("Y-m-d") . "\n# LANG: " . join(", ", $langs) . "\n";
25 for ($i=0; $i<sizeof($langs); $i++
){
26 $lang_words=sqspell_getLang($words, $langs[$i]);
27 if ($langs[$i]==$sqspell_use_app){
28 if (!$lang_words) $lang_words="# $langs[$i]\n";
29 $lang_words .= $new_words;
31 $words_dic .= $lang_words;
33 $words_dic .= "# End\n";
37 sqspell_writeWords($words_dic);
38 // display the splash screen, then close it automatically after 2 sec.
39 $onload="setTimeout('self.close()', 2000)";
40 $msg="<form onsubmit=\"return false\"><div align=\"center\"><input type=\"submit\" value=\" Close \" onclick=\"self.close()\"></div></form>";
41 sqspell_makeWindow($onload, "Personal Dictionary Updated", null, $msg);