You are here

function wysiwyg_render_dialog_page in Wysiwyg 7.2

See also

drupal_render_page()

1 call to wysiwyg_render_dialog_page()
wysiwyg_deliver_dialog_page in ./wysiwyg.dialog.inc

File

./wysiwyg.dialog.inc, line 136
Wysiwyg dialog page handling functions.

Code

function wysiwyg_render_dialog_page($page) {
  $main_content_display =& drupal_static('system_main_content_added', FALSE);

  // Allow menu callbacks to return strings or arbitrary arrays to render.
  // If the array returned is not of #type page directly, we need to fill
  // in the page with defaults.
  if (is_string($page) || is_array($page) && (!isset($page['#type']) || $page['#type'] != 'page')) {
    drupal_set_page_content($page);
    $page = element_info('wysiwyg_dialog_page');
  }

  // Modules alter the $page as needed. Blocks are populated into regions like
  // 'sidebar_first', 'footer', etc.
  drupal_alter(array(
    'wysiwyg_dialog_page',
    'page',
  ), $page);

  // If no module has taken care of the main content, add it to the page now.
  // This allows the site to still be usable even if no modules that
  // control page regions (for example, the Block module) are enabled.
  if (!$main_content_display) {
    $page['content']['system_main'] = drupal_set_page_content();
  }
  return drupal_render($page);
}