public static function deliverRawHtmlPage($result)
 {
     if (is_int($result)) {
         drupal_deliver_html_page($result);
         return;
     }
     // Emit the correct charset HTTP header, but not if the page callback
     // result is NULL, since that likely indicates that it printed something
     // in which case, no further headers may be sent, and not if code running
     // for this page request has already set the content type header.
     if (isset($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);
     if (isset($result)) {
         print render($result);
     }
     drupal_page_footer();
 }
Beispiel #2
0
<?php

// $Id: index.php,v 1.82.4.1 2006/10/18 20:14:08 killes Exp $
/**
 * @file
 * The PHP page that serves all page requests on a Drupal installation.
 *
 * The routines here dispatch control to the appropriate handler, which then
 * prints the appropriate page.
 */
include_once 'includes/bootstrap.inc';
drupal_page_header();
include_once 'includes/common.inc';
fix_gpc_magic();
/*
Disabled by AstBill Team - Uvaraj 
Not compatible med AstBill. 
Fix to come soon.*/
//drupal_check_token();
$status = menu_execute_active_handler();
switch ($status) {
    case MENU_NOT_FOUND:
        drupal_not_found();
        break;
    case MENU_ACCESS_DENIED:
        drupal_access_denied();
        break;
}
drupal_page_footer();
 /**
  * Performs end-of-request tasks.
  *
  * This function sets the page cache if appropriate, and allows modules to
  * react to the closing of the page by calling hook_exit().
  *
  * This is just a wrapper around drupal_page_footer() so extending classes can
  * override this method if necessary.
  *
  * @see drupal_page_footer().
  */
 protected static function pageFooter()
 {
     drupal_page_footer();
 }
 /**
  * Performs end-of-request tasks.
  *
  * This function sets the page cache if appropriate, and allows modules to
  * react to the closing of the page by calling hook_exit().
  *
  * This is just a wrapper around drupal_page_footer() so extending classes can
  * override this method if necessary.
  *
  * @see drupal_page_footer().
  */
 public static function pageFooter() {
   drupal_page_footer();
 }
 /**
  * Delivery callback; transfer the file inline.
  *
  * @param mixed $file
  */
 public static function deliverFileTransfer($file)
 {
     if (is_int($file)) {
         drupal_deliver_html_page($file);
         return;
     } elseif (!is_object($file) || !is_file($file->uri) || !is_readable($file->uri)) {
         drupal_deliver_html_page(MENU_NOT_FOUND);
         return;
     }
     // @todo Figure out if any other headers should be added.
     $headers = array('Content-Type' => mime_header_encode($file->filemime), 'Content-Disposition' => 'inline', 'Content-Length' => $file->filesize);
     // Let other modules alter the download headers.
     //drupal_alter('file_download_headers', $headers, $file);
     // Let other modules know the file is being downloaded.
     module_invoke_all('file_transfer', $file->uri, $headers);
     foreach ($headers as $name => $value) {
         drupal_add_http_header($name, $value);
     }
     $fd = fopen($file->uri, 'rb');
     if ($fd !== FALSE) {
         while (!feof($fd)) {
             print fread($fd, DRUPAL_KILOBYTE);
         }
         fclose($fd);
     } else {
         watchdog('favicon', 'Unable to open @uri for reading.', array('@uri' => $file->uri));
         drupal_deliver_html_page(MENU_NOT_FOUND);
         return;
     }
     // Perform end-of-request tasks.
     if (static::canCacheFile($file)) {
         drupal_page_footer();
     } else {
         drupal_exit();
     }
 }