X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fmodules%2Fedit_dic.mod;h=ed9fa534f0be13e294de3d4859b923644b512a7e;hp=7cf99e35fb65add1ceea9dd711538188a7ed36b6;hb=353d074afac6827c90f4bb03e846c5e453d3b5b1;hpb=48a1015b888d1150c6d9ac77594c6526e9e13902 diff --git a/plugins/squirrelspell/modules/edit_dic.mod b/plugins/squirrelspell/modules/edit_dic.mod index 7cf99e35..ed9fa534 100644 --- a/plugins/squirrelspell/modules/edit_dic.mod +++ b/plugins/squirrelspell/modules/edit_dic.mod @@ -1,113 +1,92 @@ ($Author$) - * @version $Date + * @author Konstantin Riabitsev + * @copyright 1999-2018 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package plugins + * @subpackage squirrelspell */ global $color; + +$pre_msg = '

' + . _("Please check any words you wish to delete from your dictionary.") + . "

\n"; +$pre_msg .= "\n"; + /** - * Get the user dictionary and see if it's empty or not. + * Get how many dictionaries this user has defined. */ -$words=sqspell_getWords(); -if (!$words){ - /** - * Agt. Smith: "You're empty." - * Neo: "So are you." - */ - sqspell_makePage(_("Personal Dictionary"), null, - '

' . _("No words in your personal dictionary.") - . '

'); -} else { - /** - * We're loaded with booty. - */ - $pre_msg = '

' - . _("Please check any words you wish to delete from your dictionary.") - . "

\n"; - $pre_msg .= "
\n"; +$langs=sqspell_getSettings(); + +foreach ($langs as $lang) { /** - * Get how many dictionaries this user has defined. + * Get all words from this language dictionary. */ - $langs=sqspell_getSettings($words); - for ($i=0; $i' - . '' + . "\n"; } - /** - * Check if all dictionaries were empty. - */ - if (!$msg) { - $msg = '

' . _("No words in your personal dictionary.") . '

'; - } else { - $msg .= '
" - . sprintf( _("%s dictionary"), $langs[$i] ) . '
' - . '
' - . '' - . '' - . '' - . '' - . "' + . '' - . "\n"; + $msg .= "
\n"; } + $msg .= '
\n"; - $words_ary=explode("\n", $lang_words); - /** - * There are two lines we need to remove: - * 1st: # Language - * last: # End - */ - array_pop($words_ary); - array_shift($words_ary); - /** - * Do some fancy stuff to separate the words into three - * columns. - */ - for ($j=0; $j\n"; - } - $msg .= " $words_ary[$j]
"; + if (!isset($msg) || !$msg) { + $msg = $pre_msg; + } + $msg .= "
" + . sprintf( _("%s dictionary"), $lang ) . '
' + . '' + . '' + . '' + . '' + . '' + . "
\n"; + /** + * Do some fancy stuff to separate the words into three + * columns. + */ + for ($j=0; $j\n"; } - $msg .= '
" - . '' - . '

' - . "
" + . '' + . '

' + . "
'; - } - sqspell_makePage(_("Edit your Personal Dictionary"), null, $msg); } +/** + * Check if all dictionaries were empty. + */ +if (! isset($msg)) { + $msg = '

' . _("No words in your personal dictionary.") . '

'; +} else { + $msg .= ''; +} +sqspell_makePage(_("Edit your Personal Dictionary"), null, $msg); /** * For Emacs weenies: * Local variables: * mode: php * End: + * vim: syntax=php */ - -?>