本文整理汇总了PHP中menu_execute_active_handler函数的典型用法代码示例。如果您正苦于以下问题:PHP menu_execute_active_handler函数的具体用法?PHP menu_execute_active_handler怎么用?PHP menu_execute_active_handler使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了menu_execute_active_handler函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* {@inheritdoc}
*
* @api
*/
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
{
if (false === $this->booted) {
$this->boot();
}
return menu_execute_active_handler();
}
示例2: callbackAction
/**
* @param null $path
* @param bool $deliver
* @return object|Response
* @Route("/{path}", name="controller", defaults={"deliver" = true}, requirements={"path" = ".+"})
* @throws \Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
*/
public function callbackAction($path = null, $deliver = true)
{
menu_set_active_item($path);
$page_callback_result = menu_execute_active_handler($path, $deliver);
if (is_int($page_callback_result)) {
switch ($page_callback_result) {
case MENU_NOT_FOUND:
// Print a 404 page.
throw new NotFoundHttpException();
break;
case MENU_ACCESS_DENIED:
// Print a 403 page.
throw new AccessDeniedHttpException();
break;
case MENU_SITE_OFFLINE:
// Print a 503 page.
throw new ServiceUnavailableHttpException();
break;
}
} elseif (!$deliver) {
$content = drupal_render($page_callback_result);
return new Response($content);
} else {
$response = $this->get('bangpound_drupal.response');
$response->setContent($page_callback_result);
return $response;
}
}
示例3: setUp
function setUp()
{
// simulate that drupal is serving a webpage. False indicates that we don't actually print html.
// this is required to gather all drupal css & js files.
$page = menu_execute_active_handler('node', FALSE);
$this->html_page = drupal_render_page($page);
}
示例4: drupal_page_header
<?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();
示例5: drupal_bootstrap
<?php
// $Id: index.php,v 1.90 2006/01/27 18:51:51 dries 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.
*/
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$return = menu_execute_active_handler();
switch ($return) {
case MENU_NOT_FOUND:
drupal_not_found();
break;
case MENU_ACCESS_DENIED:
drupal_access_denied();
break;
case MENU_SITE_OFFLINE:
drupal_site_offline();
break;
default:
// Print any value (including an empty string) except NULL or undefined:
if (isset($return)) {
print theme('page', $return);
}
break;
}
drupal_page_footer();
示例6: error_reporting
<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
/**
* @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.
*
* All Drupal code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
/**
* Root directory of Drupal installation.
*/
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
menu_execute_active_handler();
示例7: get_layer_data
function get_layer_data($layer_tablename, $row_id, $point, $tabexists) {
/* Code to retrieve layer data to display on the page */
if($point != NULL) {
$query_on='POINT';
}
else {
$query_on='ID';
}
$layer_id=0;
list($layer_id, $layer_tablename, $layer_summary_columns)=get_layer_summary_columns($layer_tablename);
switch($query_on) {
case 'POINT':
$query="SELECT " . AUTO_DBCOL_PREFIX . "id," . AUTO_DBCOL_PREFIX . "layer_id, %s," . AUTO_DBCOL_PREFIX . "nid FROM \"%s\" where ST_Contains(" . AUTO_DBCOL_PREFIX . "topology,GeomFromText('%s', (select srid from geometry_columns where f_table_name = '%s')))";
$query_args=array(str_replace("'", '"', $layer_summary_columns), $layer_tablename, $point, $layer_tablename);
break;
case 'ID':
$query="SELECT " . AUTO_DBCOL_PREFIX . "id," . AUTO_DBCOL_PREFIX . "layer_id, %s," . AUTO_DBCOL_PREFIX . "nid FROM \"%s\" where " . AUTO_DBCOL_PREFIX . "id = %d";
$query_args=array(str_replace("'", '"', $layer_summary_columns), $layer_tablename, $row_id);
break;
}
$result_category=db_query($query, $query_args);
if(!$result_category) {
//Error occured
$errmsgstr=$GLOBALS['errmsgstr'];
die('Error fetching feature info. ' . $errmsgstr);
}
else {
$global_resource_mapping=getResourceTableMapping($layer_tablename);
$col_info=getDBColDesc($layer_tablename, $layer_summary_columns);
$ret_access=menu_execute_active_handler("node/add/node-mlocate-feature/popup");
$details_lnk="";
if($category_obj=db_fetch_object($result_category)) {
$class=$category_obj;
$ifr_src="";
$html="";
$html.='<div id="attribute_div" style="font:arial;display:block;"><table style="border-collapse:separate;">';
foreach($class as $key=>$value) {
switch($key) {
case AUTO_DBCOL_PREFIX . 'id':
break;
case AUTO_DBCOL_PREFIX . 'layer_id':
break;
case AUTO_DBCOL_PREFIX . 'location':
break;
case AUTO_DBCOL_PREFIX . 'topology':
break;
case AUTO_DBCOL_PREFIX . 'created_by':
$html.="<tr><td><b>Created By: </b></td><td>" . getUserLink($value) . "</td></tr>";
break;
case AUTO_DBCOL_PREFIX . 'modified_by':
$html.="<tr><td><b>Modified By: </b></td><td>" . getUserLink($value) . "</td></tr>";
break;
case AUTO_DBCOL_PREFIX . 'status':
$html.="<tr><td><b>Status: </b></td><td>" . (($value == 1) ? "Active" : "In-active") . "</td></tr>";
break;
case AUTO_DBCOL_PREFIX . 'nid':
if($value == 0) {
if(is_int($ret_access)) {
switch($ret_access) {
case MENU_ACCESS_DENIED:
global $user;
if($user->uid < 1) {
$details_type="add";
$details_lnk="{$base_path}node/add/node-mlocate-feature/popup?layer_tablename={$layer_tablename}&point_id={$row_id}";
}
break;
}
}
else {
$details_type="add";
$details_lnk="{$base_path}node/add/node-mlocate-feature/popup?layer_tablename={$layer_tablename}&point_id={$row_id}";
}
}
else {
$ifr_src="{$base_path}node/{$value}/popup";
$details_type="more";
$details_lnk=$ifr_src;
$nid=$value;
}
break;
default : if(array_key_exists($key, $global_resource_mapping)) {
$href="{$base_path}ml_orchestrator.php?action=getResourceTableEntry&resource_tablename=" . $global_resource_mapping[$key]['resource_tablename'] . "&resource_column=" . $global_resource_mapping[$key]['resource_column'] . "&value={$value}";
$html.="<tr><td><b title='" . $col_info[$key] . "'>" . ($col_info[$key] == "" ? $key : $col_info[$key]) . ": </b></td><td>" . ($value == '' ? ' ' : "<a id='a_{$value}' name='' href='{$href}'onClick='javascript:showAjaxLinkPopup(this.href, this.name);return false;'>" . str_replace(" ", " ", $value) . "</a>") . "</td></tr>";
}
//.........这里部分代码省略.........