[Mapbender-commits] r10170 - in trunk/mapbender/http: classes javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jul 1 02:28:03 PDT 2019


Author: armin11
Date: 2019-07-01 02:28:03 -0700 (Mon, 01 Jul 2019)
New Revision: 10170

Modified:
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/http/javascripts/mod_termsOfUse.php
   trunk/mapbender/http/php/mod_getWmcDisclaimer.php
Log:
Better termsofuse module

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2019-07-01 08:25:34 UTC (rev 10169)
+++ trunk/mapbender/http/classes/class_iso19139.php	2019-07-01 09:28:03 UTC (rev 10170)
@@ -922,7 +922,7 @@
 					$iso19139Hash[36]['value'] = $iso19139Hash[36]['value'][0];
 				}
 				if (!is_null($iso19139Hash[36]['value'])) {
-					$html .= $t_a."<b>".$iso19139Hash[36]['html']."</b>: ".$t_b."<img width=120 height=120 src = '".$iso19139Hash[36]['value']."'>".$t_c;//preview
+					$html .= $t_a."<b>".$iso19139Hash[36]['html']."</b>: ".$t_b."<img width=\"120\" height=\"120\" src = '".$iso19139Hash[36]['value']."'>".$t_c;//preview
 				}
 			}
 			//resource identifier

Modified: trunk/mapbender/http/javascripts/mod_termsOfUse.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_termsOfUse.php	2019-07-01 08:25:34 UTC (rev 10169)
+++ trunk/mapbender/http/javascripts/mod_termsOfUse.php	2019-07-01 09:28:03 UTC (rev 10170)
@@ -37,7 +37,7 @@
 function mod_copyright(){
 	var myMapObj = Mapbender.modules[mod_copyright_target];
 
-	var str_c = "<div style='z-index:110;font-family:" + mod_copyright_font + ";font-size:" + mod_copyright_fontsize + ";color:" + mod_copyright_color2 + ";position:absolute;bottom:5px;right:5px'><a style='color:black;' href='../php/mod_getWmcDisclaimer.php?id=current' target='_blank'><?php echo _mb('Terms of use');?></a></div>";
+	var str_c = "<div style='z-index:110;font-family:" + mod_copyright_font + ";font-size:" + mod_copyright_fontsize + ";color:" + mod_copyright_color2 + ";position:absolute;bottom:5px;right:5px'><a style='color: blue;text-decoration: underline;' href='../php/mod_getWmcDisclaimer.php?id=current' target='_blank'><?php echo _mb('Terms of use');?></a></div>";
 	
 	var map_el = myMapObj.getDomElement();
 	if(!map_el.ownerDocument.getElementById(myMapObj.elementName+"_copyright")){

Modified: trunk/mapbender/http/php/mod_getWmcDisclaimer.php
===================================================================
--- trunk/mapbender/http/php/mod_getWmcDisclaimer.php	2019-07-01 08:25:34 UTC (rev 10169)
+++ trunk/mapbender/http/php/mod_getWmcDisclaimer.php	2019-07-01 09:28:03 UTC (rev 10170)
@@ -16,7 +16,7 @@
 //id - wmc id
 //languageCode - language parameter 'de', 'en', 'fr' 
 //$wmsServiceDisclaimerUrl = "";
-
+$admin = new administration();
 //initialize variables
 $hostName = $_SERVER['HTTP_HOST'];
 //$userId = PUBLIC_USER;
@@ -24,15 +24,19 @@
 $withHeader = false;
 //TODO give requesting hostname to this script
 if (isset($_REQUEST["id"]) & $_REQUEST["id"] != "") {
-	//validate to integer 
-	$testMatch = $_REQUEST["id"];
-	$pattern = '/^[\d]*$/';		
- 	if (!preg_match($pattern,$testMatch)){ 
-		echo 'id is not valid.<br/>'; 
-		die(); 		
- 	}
-	$id = (integer)$testMatch;
-	$testMatch = NULL;	
+	if ($_REQUEST["id"] == "current") {
+		$id = "current";
+	} else { 
+		//validate to integer 
+		$testMatch = $_REQUEST["id"];
+		$pattern = '/^[\d]*$/';		
+	 	if (!preg_match($pattern,$testMatch)){ 
+			echo 'id is not valid.<br/>'; 
+			die(); 		
+	 	}
+		$id = (integer)$testMatch;
+		$testMatch = NULL;
+	}	
 }
 
 if (isset($_REQUEST["withHeader"]) & $_REQUEST["withHeader"] != "") {
@@ -94,9 +98,23 @@
 
 //javascript:openwindow("../php/mod_showMetadata.php?resource=layer&layout=tabs&redirectToMetadataUrl=1&id=20655");
 //Generate wmc document by id
+
 $wmcFactory = new WmcFactory;
-$e = new mb_notice("mod_getWmcDisclaimer.php: wmcid: ".$id);
-$wmcObj = $wmcFactory->createFromDb($id);
+if ($id !== "current") {
+	//$e = new mb_notice("mod_getWmcDisclaimer.php: wmcid: ".$id);
+	$wmcObj = $wmcFactory->createFromDb($id);
+} else {
+	//read wmc from session if available and fill the needed fields from wmc object
+	$wmcDocSession = false;
+	//check if wmc filename is in session - TODO only if should be loaded from session not else! (Module loadWMC)
+	if(Mapbender::session()->get("mb_wmc")) {
+    		$wmc_filename = Mapbender::session()->get("mb_wmc");
+    		//$time_start = microtime();
+    		//load it from whereever it has been stored
+    		$wmcDocSession = $admin->getFromStorage($wmc_filename, TMP_WMC_SAVE_STORAGE);
+		$wmcObj = $wmcFactory->createFromXml($wmcDocSession);
+	}
+}
 //generate HTML Header
 if ($withHeader){
 		//e.g. tabs and their content



More information about the Mapbender_commits mailing list