[Mapbender-commits] r8514 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Nov 26 22:23:16 PST 2012


Author: armin11
Date: 2012-11-26 22:23:16 -0800 (Mon, 26 Nov 2012)
New Revision: 8514

Modified:
   trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php
Log:
Alter links to be relative

Modified: trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php	2012-11-26 20:38:37 UTC (rev 8513)
+++ trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php	2012-11-27 06:23:16 UTC (rev 8514)
@@ -28,7 +28,7 @@
 db_select_db(DB,$con);
 
 $admin = new administration();
-
+$mapbenderPath = MAPBENDER_PATH."/";
 //pull the needed things from tables datalink, md_metadata, layer, wms
 
  
@@ -106,7 +106,7 @@
 
 //some needfull functions to pull metadata out of the database!
 function fillISO19139($iso19139, $recordId) {
-	global $admin, $generateFrom, $wfsId;
+	global $admin, $generateFrom, $wfsId, $mapbenderPath;
 	//Pull download options for specific dataset from mapbender database and show them
 	$downloadOptionsConnector = new connector("http://localhost".$_SERVER['SCRIPT_NAME']."/../mod_getDownloadOptions.php?id=".$recordId);
 	//echo "http://localhost".$_SERVER['SCRIPT_NAME']."/../mod_getDownloadOptions.php?id=".$recordId;
@@ -724,7 +724,7 @@
 			$MD_BrowseGraphic=$iso19139->createElement("gmd:MD_BrowseGraphic");
 			$fileName=$iso19139->createElement("gmd:fileName");
 			$fileName_cs=$iso19139->createElement("gco:CharacterString");
-			$previewFilenameText = $iso19139->createTextNode("http://www.geoportal.rlp.de/mapbender/geoportal/preview/".$mapbenderMetadata['layer_id']."_layer_map_preview.jpg"); //TODO use constant for absolute path
+			$previewFilenameText = $iso19139->createTextNode($mapbenderPath."php/geoportal/preview/".$mapbenderMetadata['layer_id']."_layer_map_preview.jpg"); //TODO use constant for absolute path
 			$fileName_cs->appendChild($previewFilenameText);
 			$fileName->appendChild($fileName_cs);
 
@@ -979,13 +979,13 @@
 
 	switch ($generateFrom) {
 		case "wmslayer":
-			$gmd_URLText=$iso19139->createTextNode("http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_inspireDownloadFeed.php?id=".$recordId."&type=SERVICE&generateFrom=wmslayer&layerid=".$mapbenderMetadata['resourceId']);
+			$gmd_URLText=$iso19139->createTextNode($mapbenderPath."php/mod_inspireDownloadFeed.php?id=".$recordId."&type=SERVICE&generateFrom=wmslayer&layerid=".$mapbenderMetadata['resourceId']);
 		break;
 		case "dataurl":
-			$gmd_URLText=$iso19139->createTextNode("http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_inspireDownloadFeed.php?id=".$recordId."&type=SERVICE&generateFrom=dataurl&layerid=".$mapbenderMetadata['resourceId']);
+			$gmd_URLText=$iso19139->createTextNode($mapbenderPath."php/mod_inspireDownloadFeed.php?id=".$recordId."&type=SERVICE&generateFrom=dataurl&layerid=".$mapbenderMetadata['resourceId']);
 		break;
 		case "wfs":
-			$gmd_URLText=$iso19139->createTextNode("http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_inspireDownloadFeed.php?id=".$recordId."&type=SERVICE&generateFrom=wfs&wfsid=".$mapbenderMetadata['serviceId']);
+			$gmd_URLText=$iso19139->createTextNode($mapbenderPath."/php/mod_inspireDownloadFeed.php?id=".$recordId."&type=SERVICE&generateFrom=wfs&wfsid=".$mapbenderMetadata['serviceId']);
 		break;
 	}
 
@@ -1023,17 +1023,17 @@
 	switch ($mapbenderMetadata['mdOrigin']) {
 		case 'capabilities':
 			$operatesOn=$iso19139->createElement("srv:operatesOn");
-			$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$recordId);
+			$operatesOn->setAttribute("xlink:href", $mapbenderPath."php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$recordId);
 			$operatesOn->setAttribute("uuidref", $mapbenderMetadata['datasetId']);
 			$SV_ServiceIdentification->appendChild($operatesOn);
 		break;
 		case 'metador':
 			$operatesOn=$iso19139->createElement("srv:operatesOn");
 			if (defined('METADATA_DEFAULT_CODESPACE')) {
-				$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$recordId);
+				$operatesOn->setAttribute("xlink:href", $mapbenderPath."php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$recordId);
 				$operatesOn->setAttribute("uuidref", METADATA_DEFAULT_CODESPACE."#".$recordId);
 			} else {
-				$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$recordId);
+				$operatesOn->setAttribute("xlink:href", $mapbenderPath."php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$recordId);
 				$operatesOn->setAttribute("uuidref", "http://www.mapbender.org#".$recordId);
 			}
 					
@@ -1041,7 +1041,7 @@
 		break;
 		case 'external':
 			$operatesOn=$iso19139->createElement("srv:operatesOn");
-			$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$recordId);
+			$operatesOn->setAttribute("xlink:href", $mapbenderPath."php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$recordId);
 			$operatesOn->setAttribute("uuidref", $recordId);
 			$SV_ServiceIdentification->appendChild($operatesOn);
 		break;



More information about the Mapbender_commits mailing list