7 * Copyright (c) 1999-2005 The SquirrelMail Project Team
8 * Licensed under the GNU GPL. For full terms see the file COPYING.
10 * This module deletes the words from the user dictionary. Called
11 * after EDIT_DIC module.
15 * @author Konstantin Riabitsev <icon@duke.edu>
18 * @subpackage squirrelspell
21 global $SQSPELL_VERSION, $SQSPELL_APP_DEFAULT;
23 if (! sqgetGlobalVar('words_ary',$words_ary,SQ_POST) || ! is_array($words_ary)) {
27 if (! sqgetGlobalVar('sqspell_use_app',$sqspell_use_app,SQ_POST)){
28 $sqspell_use_app = $SQSPELL_APP_DEFAULT;
32 * If something needs to be deleted, then $words_ary will be
35 if (! empty($words_ary)){
36 $lang_words = sqspell_getLang($sqspell_use_app);
38 . sprintf(_("Deleting the following entries from %s dictionary:"), '<strong>'.$sqspell_use_app.'</strong>')
42 // print list of deleted words
43 foreach ($words_ary as $deleted_word) {
44 $msg.= '<li>'.htmlspecialchars($deleted_word)."</li>\n";
48 $new_words_ary = array();
49 foreach ($lang_words as $word){
50 if (! in_array($word,$words_ary)) {
51 $new_words_ary[]=$word;
55 sqspell_writeWords($new_words_ary,$sqspell_use_app);
56 $msg .= '</ul><p>' . _("All done!") . "</p>\n";
57 sqspell_makePage(_("Personal Dictionary Updated"), null, $msg);
60 * Click on some words first, Einstein!
62 sqspell_makePage(_("Personal Dictionary"), null,
63 '<p>' . _("No changes requested.") . '</p>');