Apply ResponseMaker to backend AJAX and cms.page.display event
This commit is contained in:
parent
1df8e72e4a
commit
c5bd5f0e0a
|
|
@ -232,24 +232,24 @@ class Controller extends Extendable
|
||||||
* Execute AJAX event
|
* Execute AJAX event
|
||||||
*/
|
*/
|
||||||
if ($ajaxResponse = $this->execAjaxHandlers()) {
|
if ($ajaxResponse = $this->execAjaxHandlers()) {
|
||||||
return $ajaxResponse;
|
$result = $ajaxResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Execute postback handler
|
* Execute postback handler
|
||||||
*/
|
*/
|
||||||
if (
|
elseif (
|
||||||
($handler = post('_handler')) &&
|
($handler = post('_handler')) &&
|
||||||
($handlerResponse = $this->runAjaxHandler($handler)) &&
|
($handlerResponse = $this->runAjaxHandler($handler)) &&
|
||||||
$handlerResponse !== true
|
$handlerResponse !== true
|
||||||
) {
|
) {
|
||||||
return $handlerResponse;
|
$result = $handlerResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Execute page action
|
* Execute page action
|
||||||
*/
|
*/
|
||||||
$result = $this->execPageAction($action, $params);
|
else {
|
||||||
|
$result = $this->execPageAction($action, $params);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prepare and return response
|
* Prepare and return response
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ class Controller
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ($event = $this->fireSystemEvent('cms.page.display', [$url, $page, $result])) {
|
if ($event = $this->fireSystemEvent('cms.page.display', [$url, $page, $result])) {
|
||||||
return $event;
|
$result = $event;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue