egroupware/preferences/inc/class.ajaxpreferences.inc.php

37 lines
977 B
PHP
Raw Normal View History

<?php
/**
2013-05-10 19:21:14 +02:00
* EGroupware - set presonal preferences via ajax
*
* @package preferences
* @copyright Lingewoud B.V.
* @link http://www.egroupware.org
* @author Pim Snel <pim-AT-lingewoud-DOT-nl>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/**
* Script which is called to store prefs using AJAX
*/
class ajaxpreferences
{
/**
* storeEGWPref
*
2013-05-10 19:21:14 +02:00
* @param mixed $appname appname
* @param mixed $key name of preference
* @param mixed $value new value
* @access public
* @return mixed returns null when no erro, else return error message.
*/
2013-05-10 19:21:14 +02:00
function storeEGWPref($appname,$key,$value)
{
$response = new xajaxResponse();
$GLOBALS['egw']->preferences->read_repository();
2013-05-10 19:21:14 +02:00
$GLOBALS['egw']->preferences->add($appname,$key,$value);
$GLOBALS['egw']->preferences->save_repository(True);
2013-05-10 19:21:14 +02:00
//$response->addAlert(__METHOD__."('$appname','$key','$value')");
return $response->getXML();
}
}