function twitter_bootstrap_modal_delivery_callback in Twitter Bootstrap Modal 7.3
Returns only content part of page for Delibery Callback function.
3 string references to 'twitter_bootstrap_modal_delivery_callback'
- twitter_bootstrap_modal_carousel_menu in twitter_bootstrap_modal_carousel/
twitter_bootstrap_modal_carousel.module - Implementation of hook_menu().
- twitter_bootstrap_modal_menu in ./
twitter_bootstrap_modal.module - Implementation of hook_menu().
- twitter_bootstrap_modal_nivo_menu in twitter_bootstrap_modal_nivo/
twitter_bootstrap_modal_nivo.module - Implementation of hook_menu().
File
- ./
twitter_bootstrap_modal.module, line 84 - Generates a Twitter Bootstrap Modal.
Code
function twitter_bootstrap_modal_delivery_callback($page_callback_result) {
if (isset($page_callback_result) && is_null(drupal_get_http_header('Content-Type'))) {
drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
}
// Send appropriate HTTP-Header for browsers and search engines.
global $language;
drupal_add_http_header('Content-Language', $language->language);
// Menu status constants are integers; page content is a string or array.
if (is_int($page_callback_result)) {
// @todo: Break these up into separate functions?
switch ($page_callback_result) {
case MENU_NOT_FOUND:
drupal_add_http_header('Status', '404 Not Found');
print t("Page not found");
break;
case MENU_ACCESS_DENIED:
drupal_add_http_header('Status', '403 Forbidden');
print t("Access denied");
break;
case MENU_SITE_OFFLINE:
print t('Site under maintenance');
break;
}
}
elseif (isset($page_callback_result)) {
$html = is_string($page_callback_result) ? $page_callback_result : drupal_render($page_callback_result);
$render_string = theme('twitter_bootstrap_modal_modal', array(
'site_name' => variable_get('site_name', "Default site name"),
'render_string' => $html,
));
print $render_string;
// Perform end-of-request tasks.
drupal_page_footer();
}
}