1 system.module | system_page_delivery_callback_alter(&$delivery_callback, $page_output) |
Implements hook_page_delivery_callback_alter().
Enables the ability to display arbitrary pages as dialogs based on the HTTP request header.
File
- core/
modules/ system/ system.module, line 1164 - Configuration system that lets administrators modify the workings of the site.
Code
function system_page_delivery_callback_alter(&$delivery_callback, $page_output) {
// For all ajax.js initiated requests, deliver as JSON.
if (backdrop_is_ajax()) {
$delivery_callback = 'ajax_deliver';
}
// For links with the data-dialog attribute, deliver as dialog JSON.
elseif (backdrop_is_dialog()) {
$delivery_callback = 'ajax_deliver_dialog';
}
// If the page response is a set of AJAX commands, deliver as JSON.
elseif (isset($page_output['#type']) && $page_output['#type'] === 'ajax') {
$delivery_callback = 'ajax_deliver';
}
}