function menu_execute_page_request

6.x menu.inc menu_execute_page_request($path = "")
4.x menu.inc menu_execute_page_request()
5.x menu.inc menu_execute_page_request()
1 call to menu_execute_page_request()
index.php in ./index.php
The primary entry point for FlightPath.

File

includes/menu.inc, line 113

Code

function menu_execute_page_request() {
  $path = $_GET ["q"];

  //If the path is blank, figure out what the "font page" is, and use that path.
  if ($path == "") {
    $path = variable_get("front_page", "main");
  }

  if ($router_item = menu_get_item($path)) {

    // Let's save the router item in the GLOBALS array, so we can use information from it
    // throughout FlightPath, if we need to.
    $GLOBALS ["fp_current_menu_router_item"] = $router_item;

    // If the menu item contains a "redirect", then we should perform
    // an fp_goto to that immediately.
    if (isset($router_item ["page_settings"]["redirect"])) {
      $p = $router_item ["page_settings"]["redirect"]["path"];
      $q = $router_item ["page_settings"]["redirect"]["query"];
      fp_goto($p, $q);
      return;
    }

    // Let's figure out if the user has access to this menu item or not.  
    if (menu_check_user_access($router_item)) {
      if ($router_item ['file'] != "") {
        require_once ($router_item ['file']);
      }
      $page = array();
      $page ["content"] = call_user_func_array($router_item ['page_callback'], $router_item ['page_arguments']);
      $page ["path"] = $path;
      $page ["title"] = $router_item ["title"];
      $page ["router_item"] = $router_item;

      return $page;

    }
    else {
      return MENU_ACCESS_DENIED;
    }
  }
  return MENU_NOT_FOUND;
}