1){ // See if s/he wants more than one dictionary. if ($use_langs[0]!=$lang_default){ // See if we need to juggle the order of the dictionaries // to make the default dictionary first in line. if (in_array($lang_default, $use_langs)){ // see if the user was dumb and chose a default dictionary // to be something other than the ones he selected. $hold = array_shift($use_langs); $lang_string = join(", ", $use_langs); $lang_string = str_replace("$lang_default", "$hold", $lang_string); $lang_string = $lang_default . ", " . $lang_string; } else { // Yes, he is dumb. $lang_string = join(", ", $use_langs); } } else { // No need to juggle the order -- preferred is already first. $lang_string = join(", ", $use_langs); } } else { // Just one dictionary, please. $lang_string = $use_langs[0]; } $msg = "

Settings adjusted to: $lang_string with $lang_default as default dictionary.

"; } else { // No dictionaries selected. Use system default. $msg = "

Using $SQSPELL_APP_DEFAULT dictionary (system default) for spellcheck.

"; $lang_string = $SQSPELL_APP_DEFAULT; } $old_lang_string = join(", ", $langs); $words = str_replace("# LANG: $old_lang_string", "# LANG: $lang_string", $words); // write it down where the sun don't shine. sqspell_writeWords($words); sqspell_makePage("International Dictionaries Preferences Updated", null, $msg); ?>