diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-09-17 09:14:13 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-09-17 09:14:13 +0000 |
| commit | e3c8f42f788ab48ec500c436d99b56878ad2ff0f (patch) | |
| tree | 1d72da1e27a09633a086ba0f0775af2daeb6e94e /roundcubemail/program/steps/utils | |
| parent | 2537ca59833f0d30115b735f6a24255beb5094c8 (diff) | |
- Fix list_cols is not updated after column dragging (#1486999)
- Improved save-pref action and moved to separate file in utils task directory
- Improved http_post/http_request to support first argument in form 'task/action'
git-svn-id: https://svn.roundcube.net/trunk@3971 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/utils')
| -rw-r--r-- | roundcubemail/program/steps/utils/save_pref.inc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/utils/save_pref.inc b/roundcubemail/program/steps/utils/save_pref.inc new file mode 100644 index 000000000..25f12df3b --- /dev/null +++ b/roundcubemail/program/steps/utils/save_pref.inc @@ -0,0 +1,45 @@ +<?php +/* + + +-----------------------------------------------------------------------+ + | program/steps/utils/save_pref.inc | + | | + | This file is part of the RoundCube Webmail client | + | Copyright (C) 2005-2010, RoundCube Dev. - Switzerland | + | Licensed under the GNU GPL | + | | + | PURPOSE: | + | Save preferences setting in database | + | | + +-----------------------------------------------------------------------+ + | Author: Aleksander Machniak <alec@alec.pl> | + +-----------------------------------------------------------------------+ + + $Id: html2text.inc 3780 2010-06-23 09:55:08Z alec $ + +*/ + +$name = get_input_value('_name', RCUBE_INPUT_POST); +$value = get_input_value('_value', RCUBE_INPUT_POST); + +// save preference value +$RCMAIL->user->save_prefs(array($name => $value)); + +// update also session if requested +if ($sessname = get_input_value('_session', RCUBE_INPUT_POST)) { + // Support multidimensional arrays... + $vars = explode('/', $sessname); + + // ... up to 3 levels + if (count($vars) == 1) + $_SESSION[$vars[0]] = $value; + else if (count($vars) == 2) + $_SESSION[$vars[0]][$vars[1]] = $value; + else if (count($vars) == 3) + $_SESSION[$vars[0]][$vars[1]][$vars[2]] = $value; +} + +$OUTPUT->reset(); +$OUTPUT->send(); + + |
