index.php

  1. <?php
  2. // $Id: index.php,v 1.94 2007/12/26 08:46:48 dries Exp $
  3. /**
  4.  * @file
  5.  * The PHP page that serves all page requests on a Drupal installation.
  6.  *
  7.  * The routines here dispatch control to the appropriate handler, which then
  8.  * prints the appropriate page.
  9.  *
  10.  * All Drupal code is released under the GNU General Public License.
  11.  * See COPYRIGHT.txt and LICENSE.txt.
  12.  */
  13. require_once './includes/bootstrap.inc';
  14. drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
  15. $return menu_execute_active_handler();
  16. // Menu status constants are integers; page content is a string.
  17. if (is_int($return)) {
  18.   switch ($return) {
  19.     case MENU_NOT_FOUND:
  20.       drupal_not_found();
  21.       break;
  22.     case MENU_ACCESS_DENIED:
  23.       drupal_access_denied();
  24.       break;
  25.     case MENU_SITE_OFFLINE:
  26.       drupal_site_offline();
  27.       break;
  28.   }
  29. }
  30. elseif (isset($return)) {
  31.   // Print any value (including an empty string) except NULL or undefined:
  32.   print theme('page'$return);
  33. }
  34. drupal_page_footer();