예제 #1
0
 /**
  * {@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
0
 /**
  * @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
0
 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
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();
예제 #5
0
<?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
0
<?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
0
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 == '' ? '&nbsp;' : "<a id='a_{$value}' name='' href='{$href}'onClick='javascript:showAjaxLinkPopup(this.href, this.name);return false;'>" . str_replace(" ", "&nbsp;", $value) . "</a>") . "</td></tr>";
          }
          else {
            $html.="<tr><td><b title='" . $col_info[$key] . "'>" . ($col_info[$key] == "" ? $key : $col_info[$key]) . ": </b></td><td>" . ($value == '' ? '&nbsp;' : $value) . "</td></tr>";
          }
          break;
        }
      }
      $html.='</table></div>';
      if($details_lnk != "") {
        if($details_type == 'add') {
          $html='<div style="padding: 4px;"><a href="javascript:popupTabClicked(\'divPopupPane\',\'ulPopupUIMenu\',\'layerAddDetails\',\'' . $details_lnk . '\');">Add Details <img src="' . base_path() . check_url(path_to_theme()) . '/images/icons/add-details.png" alt="Add Details"></a></div>' . $html;
        }
      }

      if($tabsexist == NULL) {
        $tabs="<div id='tabs-wrapper' class='clear-block'>";
        $tabs.="<ul class='tabs primary' id='layerPopupTabs'>";
        $querystr="action=getLayerData";
        $querystr.="&layer_tablename=" . $layer_tablename;

        if($query_on == 'POINT') {
          $querystr.="&point=" . $point;
        }
        elseif($query_on == 'ID') {
          $querystr.="&id=" . $row_id;
        }

        $tabs.="<li id='layerSummary' class='active'><a href='javascript:popupTabClicked(\"divPopupPane\",\"ulPopupUIMenu\",\"layerSummary\",\"{$base_path}ml_orchestrator.php?{$querystr}&tabsexist=1\");'>Summary</a>";
        if($query_on == 'ID') {
          if(!is_int($ret_access)) {
            $tabs.="<li id='layerEdit'><a href='javascript:popupTabClicked(\"divPopupPane\",\"ulPopupUIMenu\",\"layerEdit\",\"{$base_path}ml_orchestrator.php?action=getLayerTableSchema&layer_id={$layer_id}&id={$row_id}\");'>Edit summary</a>";
          }
          $sql="select link_tablename from \"Meta_LinkTable\" where layer_id = %d";
          $result=db_query($sql, $layer_id);
          if($result) {
            $tablenames=array();
            while($obj=db_fetch_object($result)) {
              $tablenames[]=$obj->link_tablename;
            }
            if(count($tablenames) > 0) {
              $lnk="{$base_path}ml_orchestrator.php?action=getLinkTableEntry&layer_id={$layer_id}&row_id={$row_id}";
              $tabs.="<li id='layerLinkInfo'><a href='javascript:popupTabClicked(\"divPopupPane\",\"ulPopupUIMenu\",\"layerLinkInfo\",\"{$lnk}\");'>Linked Data</a>";
            }
          }
        }

        if($details_lnk != "") {
          if($details_type == 'add') {
          }
          else {
            $tabs.="<li id='layerDetails'><a href='javascript:popupTabClicked(\"divPopupPane\",\"ulPopupUIMenu\",\"layerDetails\",\"{$details_lnk}\");'>Details</a>";
            $tabs.="<li id='layerComments'><a href='javascript:popupTabClicked(\"divPopupPane\",\"ulPopupUIMenu\",\"layerComments\",\"{$base_path}comment/reply/{$nid}#comment-form\");'>Comments</a>";
          }
        }

        $tabs.="</ul>";
        $tabs.="</div>";
        echo $tabs;
        $html="<div id='divLayerPopup'>" . $html . "</div>";
      }

      if($query_on == 'POINT') {
        $query="SELECT " . AUTO_DBCOL_PREFIX . "id FROM \"%s\" where ST_Contains(" . AUTO_DBCOL_PREFIX . "topology,GeomFromText('%s', (select srid from geometry_columns where f_table_name = '%s')))";
        $query_args=array($layer_tablename, $point, $layer_tablename);
        $result_category=db_query($query, $query_args);
        if(!$result_category) {
          //Error occured
          die(return_error('Error fetching layer data'));
        }
        else {
          while($obj=db_fetch_object($result_category))
            $html.='|' . $obj-> {
              AUTO_DBCOL_PREFIX . 'id'
            };
        }
      }

      echo $html;
    }
  }
}