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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Dec 15 05:23:19 EST 2008


Author: christoph
Date: 2008-12-15 05:23:19 -0500 (Mon, 15 Dec 2008)
New Revision: 3310

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

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2008-12-15 09:21:32 UTC (rev 3309)
+++ trunk/mapbender/http/classes/class_wms.php	2008-12-15 10:23:19 UTC (rev 3310)
@@ -72,6 +72,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 createOlObjFromWMS($base){
 	 	if(!$this->wms_title || $this->wms_title == ""){
 			echo "alert('Error: no valid capabilities-document !!');";

Modified: trunk/mapbender/http/php/mod_editGuiWms.php
===================================================================
--- trunk/mapbender/http/php/mod_editGuiWms.php	2008-12-15 09:21:32 UTC (rev 3309)
+++ trunk/mapbender/http/php/mod_editGuiWms.php	2008-12-15 10:23:19 UTC (rev 3310)
@@ -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">
 
@@ -484,8 +485,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>";



More information about the Mapbender_commits mailing list