X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fmodules%2Fforget_me_not.mod;h=e787a14583839d6b6a7bd7f2391f5d769db4f59b;hb=773d8dcda5b09d88286d96b152833c0fde4d3b2d;hp=eda679ab03b0cafe3029bf47a7f16f7a08f47eb3;hpb=d112ed5aeee62953707e7042a1edc8e8c2b6a968;p=squirrelmail.git diff --git a/plugins/squirrelspell/modules/forget_me_not.mod b/plugins/squirrelspell/modules/forget_me_not.mod index eda679ab..e787a145 100644 --- a/plugins/squirrelspell/modules/forget_me_not.mod +++ b/plugins/squirrelspell/modules/forget_me_not.mod @@ -1,73 +1,62 @@ - ($Author$) + * @author Konstantin Riabitsev + * @version $Id$ + * @package plugins + * @subpackage squirrelspell */ -global $words, $SQSPELL_VERSION, $SQSPELL_APP_DEFFAULT, $sqspell_use_app; +global $SQSPELL_VERSION, $SQSPELL_APP_DEFAULT; + +if (! sqgetGlobalVar('words',$words,SQ_POST)) { + $words=''; +} +if (! sqgetGlobalVar('sqspell_use_app',$sqspell_use_app,SQ_POST)) { + $sqspell_use_app = $SQSPELL_APP_DEFAYLT; +} + /** * Because of the nature of Javascript, there is no way to efficiently * pass an array. Hence, the words will arrive as a string separated by * "%". To get the array, we explode the "%"'s. * Dirty: yes. Is there a better solution? Let me know. ;) */ -$new_words = ereg_replace("%", "\n", $words); +$new_words = explode("%",$words); /** * Load the user dictionary and see if there is anything in it. */ -$words=sqspell_getWords(); -if (!$words){ - /** - * First time. - */ - $words_dic="# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# Last " - . "Revision: " . date("Y-m-d") - . "\n# LANG: $SQSPELL_APP_DEFAULT\n# $SQSPELL_APP_DEFAULT\n"; - $words_dic .= $new_words . "# End\n"; +$old_words=sqspell_getLang($sqspell_use_app); +if (empty($old_words)){ + $word_dic = $new_words; } else { - /** - * Do some fancy stuff in order to save the dictionary and not mangle the - * rest. - */ - $langs=sqspell_getSettings($words); - $words_dic = "# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# " - . "Last Revision: " . date("Y-m-d") . "\n# LANG: " . join(", ", $langs) - . "\n"; - for ($i=0; $i'; + . _("Close") . ' " onclick="self.close()" />'; sqspell_makeWindow($onload, _("Personal Dictionary Updated"), null, $msg); /** @@ -75,6 +64,7 @@ sqspell_makeWindow($onload, _("Personal Dictionary Updated"), null, $msg); * Local variables: * mode: php * End: + * vim: syntax=php */ -?> +?> \ No newline at end of file