From 0c3daf5de1be52ce392b531a6f86bbfe60820b4d Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Thu, 4 Jan 2007 16:36:33 +0000 Subject: [PATCH] new ajax server method for storing prefs --- preferences/inc/class.ajaxpreferences.inc.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 preferences/inc/class.ajaxpreferences.inc.php diff --git a/preferences/inc/class.ajaxpreferences.inc.php b/preferences/inc/class.ajaxpreferences.inc.php new file mode 100644 index 0000000000..33d5ca8869 --- /dev/null +++ b/preferences/inc/class.ajaxpreferences.inc.php @@ -0,0 +1,35 @@ + + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id$ + */ + class ajaxpreferences + { + function ajaxpreferences(){} + + /** + * storeEGWPref + * + * @param mixed $repository egroupware preferences repository + * @param mixed $key key to preference + * @param mixed $value new value + * @access public + * @return mixed returns null when no erro, else return error message. + */ + function storeEGWPref($repository,$key,$value) + { + $response =& new xajaxResponse(); + $GLOBALS['egw']->preferences->read_repository(); + $GLOBALS['egw']->preferences->change($repository,$key,$value); + $GLOBALS['egw']->preferences->save_repository(True); + return $response->getXML(); + } + } +?>