[Mapbender-commits] r3311 - in branches/2.5/http: classes php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Dec 15 05:27:01 EST 2008


Author: christoph
Date: 2008-12-15 05:27:01 -0500 (Mon, 15 Dec 2008)
New Revision: 3311

Modified:
   branches/2.5/http/classes/class_wms.php
   branches/2.5/http/php/mod_editGuiWms.php
Log:
http://trac.osgeo.org/mapbender/ticket/346

Modified: branches/2.5/http/classes/class_wms.php
===================================================================
--- branches/2.5/http/classes/class_wms.php	2008-12-15 10:23:19 UTC (rev 3310)
+++ branches/2.5/http/classes/class_wms.php	2008-12-15 10:27:01 UTC (rev 3311)
@@ -71,6 +71,24 @@
 	function wms() {
 	}
 
+	public static function getConjunctionCharacter ($url) {
+		if (mb_strpos($url, "?") !== false) { 
+			if (mb_substr($url, mb_strlen($url)-1, 1) == "?") { 
+				return "";
+			}
+			else if (mb_substr($url, mb_strlen($url)-1, 1) == "&"){
+				return "";
+			}
+			else {
+				return "&";
+			}
+		}
+		else {
+			return "?";
+		}
+		return "";
+	}
+
 	function createObjFromXML($url){
 
 		$x = new connector($url);
@@ -1919,4 +1937,4 @@
 		//var_dump($this);
 	}
 }
-?>
\ No newline at end of file
+?>

Modified: branches/2.5/http/php/mod_editGuiWms.php
===================================================================
--- branches/2.5/http/php/mod_editGuiWms.php	2008-12-15 10:23:19 UTC (rev 3310)
+++ branches/2.5/http/php/mod_editGuiWms.php	2008-12-15 10:27:01 UTC (rev 3311)
@@ -19,6 +19,7 @@
 
 import_request_variables("PG");
 require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
+require_once(dirname(__FILE__)."/../classes/class_wms.php");
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
@@ -490,8 +491,13 @@
 echo "<tr>";
 echo "<td colspan='2'>";
 echo "<a href='".$wms_getcapabilities[0];
-if( $wms_version[0] == "1.0.0"){ echo "&WMTVER=". $wms_version[0]."&REQUEST=capabilities";}
-else{echo "&VERSION=". $wms_version[0]."&REQUEST=GetCapabilities&SERVICE=WMS";}
+echo wms::getConjunctionCharacter($wms_getcapabilities[0]);
+if ($wms_version[0] == "1.0.0") { 
+	echo "WMTVER=". $wms_version[0]."&REQUEST=capabilities";
+}
+else {
+	echo "VERSION=". $wms_version[0]."&REQUEST=GetCapabilities&SERVICE=WMS";
+}
 echo "' style='font-size:14px' target='_blank'>LINK: Capabilities</a>";
 echo "</td>";
 echo "<td align = right>WMS ID: " . $wms_id[0] . "</td>";
@@ -745,4 +751,4 @@
 }
 ?>
 </body>
-</html>
\ No newline at end of file
+</html>



More information about the Mapbender_commits mailing list