fsf changes, meant to be rebased on upstream
[squirrelmail.git] / plugins / squirrelspell / modules / change_main_options.mod
1 <?php
2 /**
3 * change_main_options.mod
4 * -----------------------
5 * Squirrelspell module
6 *
7 * Copyright (c) 1999-2021 The SquirrelMail Project Team
8 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 *
10 * This module changes the international dictionaries selection
11 * for the user. Called after LANG_SETUP module.
12 *
13 * @author Paul Lesniewski <paul@squirrelmail.org>
14 * @version $Id: lang_change.mod 14642 2017-01-27 20:31:33Z pdontthink $
15 * @package plugins
16 * @subpackage squirrelspell
17 */
18
19 if (!sqgetGlobalVar('smtoken',$submitted_token, SQ_POST)) {
20 $submitted_token = '';
21 }
22 sm_validate_security_token($submitted_token, -1, TRUE);
23
24 $main_options_changed_message = '<p><strong>';
25
26 if (sqgetGlobalVar('sqspell_show_button', $sqspell_show_button, SQ_POST)
27 && !empty($sqspell_show_button))
28 {
29 $sqspell_show_button = 1;
30 $main_options_changed_message .= sprintf(_("Settings changed: Set to show \"%s\" button"), _("Check Spelling"));
31 }
32 else
33 {
34 $sqspell_show_button = 0;
35 $main_options_changed_message .= sprintf(_("Settings changed: Set to hide \"%s\" button"), _("Check Spelling"));
36 }
37
38 $main_options_changed_message .= '</strong></p>';
39
40 setPref($data_dir, $username, 'sqspell_show_button', $sqspell_show_button);
41
42 // so far the only thing this file does is change a checkbox,
43 // so for now we can skip the confirmation page and just reload
44 // the changed main options page (with a simple confirmation message)
45 //
46 require(SM_PATH . 'plugins/squirrelspell/modules/options_main.mod');
47
48 /**
49 * For Emacs weenies:
50 * Local variables:
51 * mode: php
52 * End:
53 * vim: syntax=php
54 */
55