From 614c642a4ba8b050ecb26d25d349077f6192aa8d Mon Sep 17 00:00:00 2001 From: alecpl Date: Fri, 17 Sep 2010 09:14:13 +0000 Subject: - 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' --- program/steps/utils/save_pref.inc | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 program/steps/utils/save_pref.inc (limited to 'program/steps/utils') diff --git a/program/steps/utils/save_pref.inc b/program/steps/utils/save_pref.inc new file mode 100644 index 000000000..25f12df3b --- /dev/null +++ b/program/steps/utils/save_pref.inc @@ -0,0 +1,45 @@ + | + +-----------------------------------------------------------------------+ + + $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(); + + -- cgit v1.2.3