8 * This module deletes the words from the user dictionary. Called
9 * after EDIT_DIC module.
12 * @author Konstantin Riabitsev <icon at duke.edu>
13 * @copyright 1999-2013 The SquirrelMail Project Team
14 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
17 * @subpackage squirrelspell
20 global $SQSPELL_VERSION, $SQSPELL_APP_DEFAULT;
22 if (! sqgetGlobalVar('words_ary',$words_ary,SQ_POST) || ! is_array($words_ary)) {
26 if (! sqgetGlobalVar('sqspell_use_app',$sqspell_use_app,SQ_POST)){
27 $sqspell_use_app = $SQSPELL_APP_DEFAULT;
31 * If something needs to be deleted, then $words_ary will be
34 if (! empty($words_ary)){
35 $lang_words = sqspell_getLang($sqspell_use_app);
37 . sprintf(_("Deleting the following entries from %s dictionary:"), '<strong>'.$sqspell_use_app.'</strong>')
41 // print list of deleted words
42 foreach ($words_ary as $deleted_word) {
43 $msg.= '<li>'.sm_encode_html_special_chars($deleted_word)."</li>\n";
47 $new_words_ary = array();
48 foreach ($lang_words as $word){
49 if (! in_array($word,$words_ary)) {
50 $new_words_ary[]=$word;
54 sqspell_writeWords($new_words_ary,$sqspell_use_app);
55 $msg .= '</ul><p>' . _("All done!") . "</p>\n";
56 sqspell_makePage(_("Personal Dictionary Updated"), null, $msg);
59 * Click on some words first, Einstein!
61 sqspell_makePage(_("Personal Dictionary"), null,
62 '<p>' . _("No changes requested.") . '</p>');