change_main_options.mod 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * change_main_options.mod
  4. * -----------------------
  5. * Squirrelspell module
  6. *
  7. * Copyright (c) 1999-2025 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. if (!sqgetGlobalVar('smtoken',$submitted_token, SQ_POST)) {
  19. $submitted_token = '';
  20. }
  21. sm_validate_security_token($submitted_token, -1, TRUE);
  22. $main_options_changed_message = '<p><strong>';
  23. if (sqgetGlobalVar('sqspell_show_button', $sqspell_show_button, SQ_POST)
  24. && !empty($sqspell_show_button))
  25. {
  26. $sqspell_show_button = 1;
  27. $main_options_changed_message .= sprintf(_("Settings changed: Set to show \"%s\" button"), _("Check Spelling"));
  28. }
  29. else
  30. {
  31. $sqspell_show_button = 0;
  32. $main_options_changed_message .= sprintf(_("Settings changed: Set to hide \"%s\" button"), _("Check Spelling"));
  33. }
  34. $main_options_changed_message .= '</strong></p>';
  35. setPref($data_dir, $username, 'sqspell_show_button', $sqspell_show_button);
  36. // so far the only thing this file does is change a checkbox,
  37. // so for now we can skip the confirmation page and just reload
  38. // the changed main options page (with a simple confirmation message)
  39. //
  40. require(SM_PATH . 'plugins/squirrelspell/modules/options_main.mod');
  41. /**
  42. * For Emacs weenies:
  43. * Local variables:
  44. * mode: php
  45. * End:
  46. * vim: syntax=php
  47. */