fsf changes, meant to be rebased on upstream
[squirrelmail.git] / plugins / squirrelspell / modules / lang_setup.mod
CommitLineData
849bdf42 1<?php
4b4abf93 2
d112ed5a 3/**
4 * lang_setup.mod
d112ed5a 5 *
4b4abf93 6 * Squirrelspell module
d112ed5a 7 *
91e0dccc 8 * This module displays available dictionaries to the user and lets
9 * him/her choose which ones s/he wants to check messages with.
d112ed5a 10 *
4b4abf93 11 * @author Konstantin Riabitsev <icon at duke.edu>
c997cbe6 12 * @copyright 1999-2021 The SquirrelMail Project Team
4b4abf93 13 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
44d661aa 14 * @version $Id$
15 * @package plugins
16 * @subpackage squirrelspell
d112ed5a 17 */
91e0dccc 18
d112ed5a 19global $SQSPELL_APP;
91e0dccc 20
d112ed5a 21$msg = '<p>'
22 . _("Please check any available international dictionaries which you would like to use when spellchecking:")
23 . '</p>'
24 . '<form method="post">'
04fa3c41 25 . '<input type="hidden" name="MOD" value="lang_change" />'
9c0ecb48 26 . '<input type="hidden" name="smtoken" value="' . sm_generate_security_token() . '" />'
d112ed5a 27 . '<blockquote><p>';
28/**
29 * Present a nice listing.
30 */
7996c920 31$langs = sqspell_getSettings();
d4e2e61a 32$add = '<p><label for="lang_default">'
d112ed5a 33 . _("Make this dictionary my default selection:")
d4e2e61a 34 . "</label> <select name=\"lang_default\" id=\"lang_default\">\n";
c71c845c 35foreach ($SQSPELL_APP as $avail_lang => $ignore){
d112ed5a 36 $msg .= "<input type=\"checkbox\" name=\"use_langs[]\" "
d4e2e61a 37 . "value=\"$avail_lang\" id=\"use_langs_$avail_lang\"";
d112ed5a 38 if (in_array($avail_lang, $langs)) {
5f75494f 39 $msg .= ' checked="checked"';
d112ed5a 40 }
d4e2e61a 41 $msg .= ' /> <label for="use_langs_' . $avail_lang . '">'
42 . _($avail_lang) . "</label><br />\n";
d112ed5a 43 $add .= "<option";
44 if ($avail_lang==$langs[0]) {
5f75494f 45 $add .= ' selected="selected"';
d112ed5a 46 }
47 $add .= " value=\"$avail_lang\" >" . _($avail_lang) . "</option>\n";
48}
49$msg .= "</p>\n" . $add . "</select>\n";
91e0dccc 50$msg .= "</p></blockquote><p><input type=\"submit\" value=\" "
e9eecda9 51 . _("Make these changes") . " \" /></p></form>";
91e0dccc 52sqspell_makePage(_("Add International Dictionaries"), null, $msg);
d112ed5a 53
54/**
55 * For Emacs weenies:
56 * Local variables:
57 * mode: php
58 * End:
2b6b400e 59 * vim: syntax=php
d112ed5a 60 */