also fix calls to deprecated ajaxResponse class to use egw_json_response singleton, should be fixed in code for current apps

This commit is contained in:
Ralf Becker 2013-08-25 15:14:19 +00:00
parent 38798b872d
commit 46f81649eb
2 changed files with 11 additions and 34 deletions

View File

@ -81,7 +81,7 @@ class notifications_ajax {
/**
* the xml response object
*
* @var xajaxResponse
* @var egw_json_response
*/
private $response;
@ -90,10 +90,7 @@ class notifications_ajax {
*
*/
public function __construct() {
if(class_exists('xajaxResponse'))
{
$this->response = new xajaxResponse();
}
$this->response = egw_json_response::get();
$this->recipient = (object)$GLOBALS['egw']->accounts->read($GLOBALS['egw_info']['user']['account_id']);
$this->config = (object)config::read(self::_appname);

View File

@ -590,26 +590,16 @@ class egw_json_response
/**
* Deprecated legacy xajax wrapper functions for the new egw_json interface
*/
class xajaxResponse extends egw_json_response
class xajaxResponse
{
public function addScript($script)
public function __call($name, $args)
{
$this->script($script);
if (substr($name, 0, 3) == 'add')
{
$name = substr($name, 3);
$name[0] = strtolower($name[0]);
}
public function addAlert($message)
{
$this->alert($message, '');
}
public function addAssign($id, $key, $value)
{
$this->assign($id, $key, $value);
}
public function addRedirect($url)
{
$this->redirect($url);
return call_user_func_array(array(egw_json_response::get(), $name), $args);
}
public function addScriptCall($func)
@ -617,17 +607,7 @@ class xajaxResponse extends egw_json_response
$args = func_get_args();
$func = array_shift($args);
$this->apply($func, $args);
}
public function addIncludeCSS($url)
{
$this->includeCSS($url);
}
public function addIncludeScript($url)
{
$this->includeScript($url);
return call_user_func(array(egw_json_response::get(), 'apply'), $func, $args);
}
public function getXML()