function media_gallery_lightbox_page_deliver in Media Gallery 7.2
Same name and namespace in other branches
- 7 media_gallery.pages.inc \media_gallery_lightbox_page_deliver()
Menu page delivery callback; print content for a lightbox.
This overrides drupal_deliver_html_page() for pages displayed within the lightbox, in order to skip printing any HTML except the main page content.
1 call to media_gallery_lightbox_page_deliver()
- media_gallery_lightbox_delivery_callback in ./
media_gallery.module - Menu page delivery callback. This is a delegate function. In case, the user has no access to the menu item, the menu system does not load the specified file and therefore can not use the custom deliver function.
1 string reference to 'media_gallery_lightbox_page_deliver'
- media_gallery_lightbox_delivery_callback in ./
media_gallery.module - Menu page delivery callback. This is a delegate function. In case, the user has no access to the menu item, the menu system does not load the specified file and therefore can not use the custom deliver function.
File
- ./
media_gallery.pages.inc, line 119 - Common pages for the Media Gallery module.
Code
function media_gallery_lightbox_page_deliver($page_content) {
// Display an error message if something went wrong.
if (!isset($page_content) || is_int($page_content)) {
if (is_int($page_content) && $page_content == MENU_ACCESS_DENIED) {
watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
$content = array(
'#markup' => t('You are not authorized to access this page.'),
);
}
else {
$content = array(
'#markup' => t('An unexpected error occurred. Please try again later.'),
);
}
}
elseif (is_string($page_content)) {
$content = array(
'#markup' => $page_content,
);
}
else {
$content = $page_content;
}
// Render the main page content, and nothing else. We don't want to call
// drupal_render_page() because the results of this function are inserted
// into a <div> on the parent page, so we can't print a full HTML document.
// If we inserted them into an iframe within the lightbox, things would be
// different, but we don't want to do that because displaying the page in an
// iframe results in reduced functionality (you don't get the colorbox
// plugin's autoresizing behavior).
print drupal_render($content);
// Perform end-of-request tasks.
drupal_page_footer();
}