[mapguide-commits] r9403 - sandbox/jng/fusion_entrypoint_refactor/Oem/fusionMG/templates/mapguide
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Jul 26 09:36:24 PDT 2018
Author: jng
Date: 2018-07-26 09:36:24 -0700 (Thu, 26 Jul 2018)
New Revision: 9403
Removed:
sandbox/jng/fusion_entrypoint_refactor/Oem/fusionMG/templates/mapguide/index.php
Log:
Remove the index.php entry point. This is already in the respective cms_refactor sandbox branch of Fusion and was never intended to be committed here.
Deleted: sandbox/jng/fusion_entrypoint_refactor/Oem/fusionMG/templates/mapguide/index.php
===================================================================
--- sandbox/jng/fusion_entrypoint_refactor/Oem/fusionMG/templates/mapguide/index.php 2018-07-26 16:23:26 UTC (rev 9402)
+++ sandbox/jng/fusion_entrypoint_refactor/Oem/fusionMG/templates/mapguide/index.php 2018-07-26 16:36:24 UTC (rev 9403)
@@ -1,73 +0,0 @@
-<?php
-
-require_once("../../layers/MapGuide/php/Common.php");
-require_once('../../common/php/Utilities.php');
-
-if (InitializationErrorOccurred())
-{
- DisplayInitializationErrorHTML();
- exit;
-}
-
-$locale = GetDefaultLocale();
-$params = $_GET;
-
-if (!array_key_exists("template", $params))
-{
- echo "<p>Missing required parameter: template</p>";
- exit;
-}
-if (!array_key_exists("ApplicationDefinition", $params))
-{
- echo "<p>Missing required parameter: ApplicationDefinition</p>";
- exit;
-}
-
-$bDebug = (array_key_exists("debug", $params) && $params["debug"] == "1");
-
-$templateName = strtolower($params["template"]);
-$appDef = $params["ApplicationDefinition"];
-$templatePath = dirname(__FILE__)."/$templateName/index.templ";
-
-if (!file_exists($templatePath)) {
- echo "<p>Template ($templateName) not found</p>";
- exit;
-}
-
-//Requests to this script can be made from anywhere, so disable XML entity loading to
-//guard against malicious XML
-libxml_disable_entity_loader(true);
-
-try {
- $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
- $appDefId = new MgResourceIdentifier($appDef);
- $content = $resourceService->GetResourceContent($appDefId);
-
- $document = new DOMDocument();
- $document->loadXML($content->ToString());
-
- $root = $document->documentElement;
- $json = '{"' . $root->tagName . '":' . xml2json($root) . '}';
-
- $scriptName = "fusionSF-compressed";
- if ($bDebug) {
- $scriptName = "fusion";
- }
-
- $content = file_get_contents($templatePath);
-
- $content = str_replace("%__LIB_BASE__%", "../../lib", $content);
- $content = str_replace("%__TEMPLATE_BASE__%", "$templateName", $content);
- $content = str_replace("%__FUSION_SCRIPT__%", $scriptName, $content);
- $content = str_replace("%__SCRIPTS__%", "<!-- TODO: Inject Google Maps script if required -->", $content);
- $content = str_replace("%__APPDEF_JSON__%", $json, $content);
-
- header("Content-Type: text/html");
- echo $content;
-} catch (MgException $ex) {
- $initializationErrorMessage = $ex->GetExceptionMessage();
- $initializationErrorDetail = $ex->GetDetails();
- $initializationErrorStackTrace = $ex->GetStackTrace();
- DisplayInitializationErrorHTML();
-}
-?>
\ No newline at end of file
More information about the mapguide-commits
mailing list