=== modified file 'includes/menu.inc' --- includes/menu.inc 2006-08-30 08:46:16 +0000 +++ includes/menu.inc 2006-09-01 17:30:30 +0000 @@ -382,16 +382,20 @@ function menu_set_location($location) { * here may, as a side effect, change the active menu item so that later * menu functions (that display the menus and breadcrumbs, for example) * act as if the user were in a different location on the site. + * + * @param $path + * A string representing the menu path to be executed. + * @return + * An simple array with the handler's $content as first element, and $show_blocks + * boolean as second element. */ -function menu_execute_active_handler() { +function menu_execute_active_handler($path = '') { if (_menu_site_is_offline()) { return MENU_SITE_OFFLINE; } $menu = menu_get_menu(); - // Determine the menu item containing the callback. - $path = $_GET['q']; while ($path && !isset($menu['callbacks'][$path])) { $path = substr($path, 0, strrpos($path, '/')); } @@ -414,8 +418,13 @@ function menu_execute_active_handler() { if (strlen($arg)) { $arguments = array_merge($arguments, explode('/', $arg)); } - - return call_user_func_array($menu['callbacks'][$path]['callback'], $arguments); + $return = call_user_func_array($menu['callbacks'][$path]['callback'], $arguments); + + // Unless otherwise specified, return an array with blocks enabled. + if (!is_array($return)) { + $return = array($return, TRUE); + } + return $return; } /** === modified file 'index.php' --- index.php 2006-01-27 18:51:51 +0000 +++ index.php 2006-09-01 17:32:40 +0000 @@ -12,8 +12,8 @@ require_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); -$return = menu_execute_active_handler(); -switch ($return) { +list($content, $show_blocks) = menu_execute_active_handler($_GET['q']); +switch ($content) { case MENU_NOT_FOUND: drupal_not_found(); break; @@ -24,9 +24,9 @@ drupal_site_offline(); break; default: - // Print any value (including an empty string) except NULL or undefined: - if (isset($return)) { - print theme('page', $return); + // Print any value (including an empty string) except NULL: + if ($content !== NULL) { + print theme('page', $content, $show_blocks); } break; }