new JSON response method "message" to call egw.message eg. in a popup, by using the context from the egw.json call

This commit is contained in:
Ralf Becker
2018-06-05 12:29:23 +02:00
parent 6f7050d036
commit 430368eab9
2 changed files with 34 additions and 0 deletions

View File

@ -368,6 +368,17 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
throw 'Invalid parameters';
}, null, 'alert');
// Regisert the "message" plugin
json.registerJSONPlugin(function(type, res, req) {
//Check whether all needed parameters have been passed and call the alertHandler function
if ((typeof res.data.message != 'undefined'))
{
req.egw.message(res.data.message, res.data.type);
return true;
}
throw 'Invalid parameters';
}, null, 'message');
// Register the "assign" plugin
json.registerJSONPlugin(function(type, res, req) {
//Check whether all needed parameters have been passed and call the alertHandler function