You are here

function dialog_page_alter in Dialog 7

Implementation of hook_page_alter().

File

./dialog.module, line 20
The Dialog module provides an API for displaying and interacting with jQuery UI Dialog modals.

Code

function dialog_page_alter(&$page) {

  // Alter the current page to display as a dialog box if desired.
  if ($options = dialog_display()) {

    // Construct the contents of the dialog box.
    $content = render(drupal_set_page_content());

    // Cleanse the dialog options.
    if (!isset($options['title'])) {
      $options['title'] = drupal_get_title();
    }

    // Send over the commands.
    $commands = array();
    $commands[] = dialog_command_display($content, $options);
    ajax_render($commands);
  }
}