You are here

function dialog_page_delivery_callback_alter in Dialog 7.2

Implements hook_page_delivery_callback_alter().

Enables the ability to display arbitrary pages as dialogs based upon query parameters.

File

./dialog.module, line 250
Provides an API for opening content in a dialog.

Code

function dialog_page_delivery_callback_alter(&$delivery_callback, $page_output = array()) {
  $content_type = dialog_get_content_type();

  // For all ajax.js initiated requests, deliver as JSON.
  if ($content_type == 'drupal_ajax') {
    $delivery_callback = 'ajax_deliver';
  }
  elseif ($content_type == 'drupal_dialog') {
    $delivery_callback = 'ajax_deliver_dialog';
  }
  elseif (isset($page_output['#type']) && $page_output['#type'] === 'ajax') {
    $delivery_callback = 'ajax_deliver';
  }
}