8 * This module changes the international dictionaries selection
9 * for the user. Called after LANG_SETUP module.
11 * @author Konstantin Riabitsev <icon at duke.edu>
12 * @copyright 1999-2020 The SquirrelMail Project Team
13 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
16 * @subpackage squirrelspell
19 sqgetGlobalVar('smtoken', $submitted_token, SQ_POST, '');
20 sm_validate_security_token($submitted_token, -1, TRUE);
22 global $SQSPELL_APP_DEFAULT;
24 if (! sqgetGlobalVar('use_langs',$use_langs,SQ_POST)) {
25 $use_langs = array($SQSPELL_APP_DEFAULT);
28 if (! sqgetGlobalVar('lang_default',$lang_default,SQ_POST)) {
29 $lang_default = $SQSPELL_APP_DEFAULT;
33 * Rebuild languages. Default language is first one.
35 $new_langs = array($lang_default);
36 foreach ($use_langs as $lang) {
37 if (! in_array($lang,$new_langs)) {
42 if (sizeof($new_langs)>1) {
44 foreach( $new_langs as $a) {
45 $dsp_string .= _(sm_encode_html_special_chars(trim($a))) . _(", ");
47 // remove last comma and space
48 $dsp_string = substr( $dsp_string, 0, -2 );
50 // i18n: first %s is comma separated list of languages, second %s - default language.
51 // Language names are translated, if they are present in squirrelmail.po file.
52 // make sure that you don't use html codes in language name translations
54 . sprintf(_("Settings adjusted to: %s with %s as default dictionary."),
55 '<strong>'.sm_encode_html_special_chars($dsp_string).'</strong>',
56 '<strong>'.sm_encode_html_special_chars(_($lang_default)).'</strong>')
60 * Only one dictionary is selected.
63 . sprintf(_("Using %s dictionary for spellcheck." ), '<strong>'.sm_encode_html_special_chars(_($new_langs[0])).'</strong>')
68 sqspell_saveSettings($new_langs);
70 sqspell_makePage(_("International Dictionaries Preferences Updated"),