[Mapbender-commits] r6915 - in trunk/mapbender: http/classes http/php resources/db/pgsql/UTF-8/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Sep 10 07:22:39 EDT 2010


Author: armin11
Date: 2010-09-10 11:22:39 +0000 (Fri, 10 Sep 2010)
New Revision: 6915

Added:
   trunk/mapbender/http/php/mod_interfaceWms4Kml.php
   trunk/mapbender/http/php/mod_showMetadata.php
Modified:
   trunk/mapbender/http/classes/class_metadata_new.php
   trunk/mapbender/http/php/mod_getServiceDisclaimer.php
   trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql
Log:
Some changes thru merging with Geoportal.rlp. New draft for module to show mapbender metadata from db. Solve security problem for integration of wms layer in google earth. KML is not longer saved to session, but generated dynamically.

Modified: trunk/mapbender/http/classes/class_metadata_new.php
===================================================================
--- trunk/mapbender/http/classes/class_metadata_new.php	2010-09-07 19:42:09 UTC (rev 6914)
+++ trunk/mapbender/http/classes/class_metadata_new.php	2010-09-10 11:22:39 UTC (rev 6915)
@@ -616,7 +616,7 @@
 				$this->wmsJSON->wms->srv[$j]->layer[0]->id = (integer)$subLayers[$rootIndex]['layer_id'];
 				$this->wmsJSON->wms->srv[$j]->layer[0]->title = $subLayers[$rootIndex]['layer_title'];
 				$this->wmsJSON->wms->srv[$j]->layer[0]->abstract = $subLayers[$rootIndex]['layer_abstract'];
-				$this->wmsJSON->wms->srv[$j]->layer[0]->mdLink = "http://".$this->hostName."/mapbender/x_geoportal/mod_layerMetadata.php?id=".(integer)$subLayers[$rootIndex]['layer_id'];
+				$this->wmsJSON->wms->srv[$j]->layer[0]->mdLink = "http://".$this->hostName."/mapbender/php/mod_showMetadata.php?resource=layer&id=".(integer)$subLayers[$rootIndex]['layer_id'];
 				$this->wmsJSON->wms->srv[$j]->layer[0]->previewURL = "http://".$this->hostName."/mapbender/x_geoportal/mod_layerPreview.php?id=".(integer)$subLayers[$rootIndex]['layer_id'];
 				if ($subLayers[$rootIndex]['layer_name'] == ''){
 					$this->wmsJSON->wms->srv[$j]->layer[0]->loadable = 0;

Modified: trunk/mapbender/http/php/mod_getServiceDisclaimer.php
===================================================================
--- trunk/mapbender/http/php/mod_getServiceDisclaimer.php	2010-09-07 19:42:09 UTC (rev 6914)
+++ trunk/mapbender/http/php/mod_getServiceDisclaimer.php	2010-09-10 11:22:39 UTC (rev 6915)
@@ -4,7 +4,7 @@
 //
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
 require_once(dirname(__FILE__)."/../classes/class_json.php");
-require_once(dirname(__FILE__)."/../classes/class_administration.php"); //TODO: include some class which can do the db connects
+//require_once(dirname(__FILE__)."/../classes/class_administration.php"); //TODO: include some class which can do the db connects
 
 //function to parse urls as links
 function display_text($string) {
@@ -18,6 +18,8 @@
 $type = "wms";
 $id = 1;
 $languageCode = "de";
+$withHeader = false;
+$asTable = false;
 //parse request parameters
 //
 if (isset($_REQUEST["id"]) & $_REQUEST["id"] != "") {
@@ -53,6 +55,39 @@
 	$languageCode = $testMatch;
 	$testMatch = NULL;
 }
+//
+if (isset($_REQUEST["withHeader"]) & $_REQUEST["withHeader"] != "") {
+	//validate to wms, wfs
+	$testMatch = $_REQUEST["withHeader"];	
+ 	if (!($testMatch == 'true' or $testMatch == 'false')){ 
+		echo 'type: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		die(); 		
+ 	}
+	if ($testMatch == 'true'){ 
+		$withHeader = true;		
+ 	} else {
+		$withHeader = false;
+	}
+	$testMatch = NULL;
+}
+//
+if (isset($_REQUEST["asTable"]) & $_REQUEST["asTable"] != "") {
+	//validate to wms, wfs
+	$testMatch = $_REQUEST["asTable"];	
+ 	if (!($testMatch == 'true' or $testMatch == 'false')){ 
+		echo 'type: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		die(); 		
+ 	}
+	if ($testMatch == 'true'){ 
+		$asTable = true;		
+ 	} else {
+		$asTable = false;
+	}
+	$testMatch = NULL;
+}
+
+
+
 $htmlHeader = array();
 
 switch($languageCode){
@@ -61,7 +96,7 @@
 			$htmlHeader['discPrivacyHeader'] = 'Datenschutzhinweis';
 			$htmlHeader['accessConstraintsHeader'] = 'Beschränkungen des öffentlichen Zugangs';
 			$htmlHeader['feesHeader'] = 'Angaben zu Kosten/Gebühren/Lizenzen';
-			$htmlHeader['licences'] = '<b>"."Lizenz:"."</b><br>';
+			$htmlHeader['licences'] = '<b>Lizenz:</b><br>';
 			$htmlHeader['networkAccess'] = 'Der Dienst ist <b>nicht im Internet</b> sondern nur in ausgewählten  Netzwerken (z.B. Intranets) verfügbar. Genauere Angaben erhalten Sie ggf. im folgenden Abschnitt.<br>';
 			$htmlHeader['logInformation'] = 'Die Zugriffe auf den Dienst werden vom Anbieter <b>nutzerbezogen</b> aufgezeichnet. Dies erfolgt entweder zur Abrechnung vertraglicher Vereinbarungen ';
 			$htmlHeader['logInformation'] .= 'oder aufgrund gesetzlicher Vorgaben.<br><b>Wenn Sie hiermit nicht einverstanden sein sollten, nutzen Sie diesen Dienst nicht!</b><br>';
@@ -70,6 +105,7 @@
 			$htmlHeader['priceInformation'][1] = ' Cent pro Megapixel</b> ';
 			$htmlHeader['priceInformation'][2] = ' für abgerufene Bildinformationen angegeben. Das Abrufen eines Kartenbildes in einer Standardauflösung von 600x400 Pixeln kostet dementsprechend <b>';
 			$htmlHeader['priceInformation'][3] = ' Euro</b>. Angaben zu eventuell möglichen Rabatten erhalten Sie über ';
+			$htmlHeader['noInformation'] = 'No informations about use constraints are available!';
 
 
        			break;
@@ -78,7 +114,7 @@
 			$htmlHeader['discPrivacyHeader'] = 'Note on protection of privacy';
 			$htmlHeader['accessConstraintsHeader'] = 'Constraints on public access';
 			$htmlHeader['feesHeader'] = 'Information about costs/fees/licences';
-			$htmlHeader['licences'] = '<b>"."Licence:"."</b><br>';
+			$htmlHeader['licences'] = '<b>Licence:</b><br>';
 			$htmlHeader['networkAccess'] = 'This Service is <b>not available via www</b> but only in special networks. Possibly you get further information about the network availability in the following paragraph.<br>';
 			$htmlHeader['logInformation'] = 'The access on this service is logged <b>user-related</b> by the provider. The logging is done to support automated settlement based on a contract ';
 			$htmlHeader['logInformation'] .= 'or to fulfill legal standards.<br><b>If you do not agree on this - please don\'t use this service!</b><br>';
@@ -87,7 +123,9 @@
 			$htmlHeader['priceInformation'][1] = ' (euro)cent per megapixel</b> ';
 			$htmlHeader['priceInformation'][2] = ' for retrieved picture data. The retrieving of a typical map with a standardized resolution of 600x400 px will cost <b>';
 			$htmlHeader['priceInformation'][3] = ' euro</b>. For information about possible discounts please contact ';
+			$htmlHeader['noInformation'] = 'Es sind keine Informationen über Nutzungsbedingungen verfügbar!';
 
+
            
         		break;
         		case 'fr':
@@ -95,7 +133,7 @@
 			$htmlHeader['discPrivacyHeader'] = 'Datenschutzhinweis';
 			$htmlHeader['accessConstraintsHeader'] = 'Beschränkungen des öffentlichen Zugangs';
 			$htmlHeader['feesHeader'] = 'Angaben zu Kosten/Gebühren/Lizenzen';
-			$htmlHeader['licences'] = '<b>"."Lizenz:"."</b><br>';
+			$htmlHeader['licences'] = '<b>Lizenz:</b><br>';
 			$htmlHeader['networkAccess'] = 'Der Dienst ist <b>nicht im Internet</b> sondern nur in ausgewählten  Netzwerken (z.B. Intranets) verfügbar. Genauere Angaben erhalten Sie ggf. im folgenden Abschnitt.<br>';
 			$htmlHeader['logInformation'] = 'Die Zugriffe auf den Dienst werden vom Anbieter <b>nutzerbezogen</b> aufgezeichnet. Dies erfolgt entweder zur Abrechnung vertraglicher Vereinbarungen ';
 			$htmlHeader['logInformation'] .= 'oder aufgrund gesetzlicher Vorgaben.<br><b>Wenn Sie hiermit nicht einverstanden sein sollten, nutzen Sie diesen Dienst nicht!</b><br>';
@@ -104,14 +142,16 @@
 			$htmlHeader['priceInformation'][1] = ' Cent pro Megapixel</b> ';
 			$htmlHeader['priceInformation'][2] = ' für abgerufene Bildinformationen angegeben. Das Abrufen eines Kartenbildes in einer Standardauflösung von 600x400 Pixeln kostet dementsprechend <b>';
 			$htmlHeader['priceInformation'][3] = ' Euro</b>. Angaben zu eventuell möglichen Rabatten erhalten Sie über ';
+			$htmlHeader['noInformation'] = 'No informations about use constraints are available!';
 
+
        			break;
      			default:
 			$htmlHeader['discHeader'] = 'Nutzungsbedingungen des angefragten Service';
 			$htmlHeader['discPrivacyHeader'] = 'Datenschutzhinweis';
 			$htmlHeader['accessConstraintsHeader'] = 'Beschränkungen des öffentlichen Zugangs';
 			$htmlHeader['feesHeader'] = 'Angaben zu Kosten/Gebühren/Lizenzen';
-			$htmlHeader['licences'] = '<b>"."Lizenz:"."</b><br>';
+			$htmlHeader['licences'] = '<b>Lizenz:</b><br>';
 			$htmlHeader['networkAccess'] = 'Der Dienst ist <b>nicht im Internet</b> sondern nur in ausgewählten  Netzwerken (z.B. Intranets) verfügbar. Genauere Angaben erhalten Sie ggf. im folgenden Abschnitt.<br>';
 			$htmlHeader['logInformation'] = 'Die Zugriffe auf den Dienst werden vom Anbieter <b>nutzerbezogen</b> aufgezeichnet. Dies erfolgt entweder zur Abrechnung vertraglicher Vereinbarungen ';
 			$htmlHeader['logInformation'] .= 'oder aufgrund gesetzlicher Vorgaben.<br><b>Wenn Sie hiermit nicht einverstanden sein sollten, nutzen Sie diesen Dienst nicht!</b><br>';
@@ -120,6 +160,8 @@
 			$htmlHeader['priceInformation'][1] = ' Cent pro Megapixel</b> ';
 			$htmlHeader['priceInformation'][2] = ' für abgerufene Bildinformationen angegeben. Das Abrufen eines Kartenbildes in einer Standardauflösung von 600x400 Pixeln kostet dementsprechend <b>';
 			$htmlHeader['priceInformation'][3] = ' Euro</b>. Angaben zu eventuell möglichen Rabatten erhalten Sie über ';
+			$htmlHeader['noInformation'] = 'No informations about use constraints are available!';
+
 		}	
 
 //parameters:	type	:wms, wfs, ... string
@@ -172,60 +214,102 @@
 
 
 if ((isset($row[$type.'_proxylog']) & $row[$type.'_proxylog'] != 0) or strtoupper($row['accessconstraints']) != "NONE" or strtoupper($row['fees']) != "NONE" or isset($row['termsofuse_id']) or (isset($row[$type.'_network_access']) & $row[$type.'_network_access'] != 0)) {
-
-//generate text for json object if restrictions exists
-
-echo "<h1>".$htmlHeader['discHeader']."</h1>";
-
-if (isset($row[$type.'_proxylog']) & $row[$type.'_proxylog'] != 0 )  {
-	$discPrivacy = $htmlHeader['logInformation'];
-	$discPrivacy .= "<a href=\"mailto:".$rowOwner['mb_user_email']."\">".$rowOwner['mb_user_email']."</a>";
-	echo "<h2>".$htmlHeader['discPrivacyHeader']."</h2>";
-	echo $discPrivacy."<br>";
-}
-
-
-if (strtoupper($row['accessconstraints']) != "NONE" or (isset($row[$type.'_network_access']) & $row[$type.'_network_access'] != 0) ) {
-	$accessConstraintsHeader = "Beschränkungen des öffentlichen Zugangs";
-	if (isset($row[$type.'_network_access']) & $row[$type.'_network_access'] != 0) {
-		$accessConstraints = $htmlHeader['networkAccess'];
+	//generate text for json object if restrictions exists
+	if ($withHeader) {
+		echo "<h1>".$htmlHeader['discHeader']."</h1>";
 	}
-	else {
-		$accessConstraints = "";
+	if ($asTable) {
+		$tableBegin =  "<table>\n";
+		$t_a = "\t<tr>\n\t\t<th>\n\t\t\t";
+		$t_b = "\n\t\t</th>\n\t\t<td>\n\t\t\t";
+		$t_c = "\n\t\t</td>\n\t</tr>\n";
+		$tableEnd = "</table>\n";
+		echo $tableBegin;
+		if (isset($row[$type.'_proxylog']) & $row[$type.'_proxylog'] != 0 )  {
+			$discPrivacy = $htmlHeader['logInformation'];
+			$discPrivacy .= "<a href=\"mailto:".$rowOwner['mb_user_email']."\">".$rowOwner['mb_user_email']."</a>";
+			echo $t_a.$htmlHeader['discPrivacyHeader'].$t_b.$discPrivacy.$t_c;
+		}
+		if (strtoupper($row['accessconstraints']) != "NONE" or (isset($row[$type.'_network_access']) & $row[$type.'_network_access'] != 0) ) {
+			$accessConstraintsHeader = $htmlHeader['accessConstraintsHeader'];
+			if (isset($row[$type.'_network_access']) & $row[$type.'_network_access'] != 0) {
+				$accessConstraints = $htmlHeader['networkAccess'];
+			}
+			else {
+				$accessConstraints = "";
+			}
+			$accessConstraints .= display_text($row['accessconstraints']);
+			echo $t_a.$htmlHeader['accessConstraintsHeader'].$t_b.$accessConstraints.$t_c;
+		}
+		if (isset($row['termsofuse_id']) or ($row['fees'] & strtoupper($row['fees']) != "NONE" & ($row['fees'] != '')) or ($type == "wms" & isset($row['wms_pricevolume']) & $row['wms_pricevolume'] != 0) ) {
+			$feesPart = $t_a.$htmlHeader['feesHeader'].$t_b;
+			if (isset($row['termsofuse_id'])) {
+				$fees = $htmlHeader['licences'];
+				#$fees .= $row['name']."<br>";
+				$fees .= "<a href='".$row['descriptionlink']."' target=_blank><img src='".$row['symbollink']."' ".$row['name']."></a><br>";
+				$fees .= $row['description']."<br>";
+				$feesPart .= $fees;
+			} else {
+				if (isset($row['fees']) & ((strtoupper($row['fees']) != 'NONE') or ($row['fees'] != ''))) {
+					$fees = display_text($row['fees']);
+					$feesPart .= $fees;
+				}
+			}
+			if ($type == "wms" & isset($row['wms_pricevolume']) & $row['wms_pricevolume'] != 0) {
+				$priceExample = (integer)$row['wms_pricevolume']*400*600/100000000;
+				$priceInformation = $htmlHeader['priceInformation'][0].(integer)$row['wms_pricevolume'];
+				$priceInformation .= $htmlHeader['priceInformation'][1].$htmlHeader['priceInformation'][2].$priceExample.$htmlHeader['priceInformation'][3]." <a href=\"mailto:".$rowOwner['mb_user_email']."\">".$rowOwner['mb_user_email']."</a><br>";	
+				$feesPart .= "<br>".$priceInformation.$t_c;
+			} else {
+				$feesPart .= $t_c;
+			}
+		}
+		echo $feesPart.$tableEnd;
+	} else {
+		//information is given in the standard way - not as a html table
+		if (isset($row[$type.'_proxylog']) & $row[$type.'_proxylog'] != 0 )  {
+			$discPrivacy = $htmlHeader['logInformation'];
+			$discPrivacy .= "<a href=\"mailto:".$rowOwner['mb_user_email']."\">".$rowOwner['mb_user_email']."</a>";
+			echo "<h2>".$htmlHeader['discPrivacyHeader']."</h2>";
+			echo $discPrivacy."<br>";
+		}
+		if (strtoupper($row['accessconstraints']) != "NONE" or (isset($row[$type.'_network_access']) & $row[$type.'_network_access'] != 0) ) {
+			$accessConstraintsHeader = $htmlHeader['accessConstraintsHeader'];
+			if (isset($row[$type.'_network_access']) & $row[$type.'_network_access'] != 0) {
+				$accessConstraints = $htmlHeader['networkAccess'];
+			}
+			else {
+				$accessConstraints = "";
+			}
+			$accessConstraints .= display_text($row['accessconstraints']);
+			echo "<h2>".$htmlHeader['accessConstraintsHeader']."</h2>";
+			echo $accessConstraints."<br>";
+		}
+		if (isset($row['termsofuse_id']) or (strtoupper($row['fees']) != "NONE") or ($type == "wms" & isset($row['wms_pricevolume']) & $row['wms_pricevolume'] != 0) ) {
+			echo "<h2>".$htmlHeader['feesHeader']."</h2>";
+			if (isset($row['termsofuse_id'])) {
+				$fees = $htmlHeader['licences'];
+				#$fees .= $row['name']."<br>";
+				$fees .= "<a href='".$row['descriptionlink']."' target=_blank><img src='".$row['symbollink']."' ".$row['name']."></a><br>";
+				$fees .= $row['description']."<br>";
+				echo $fees."<br>";
+			} else {
+				if (isset($row['fees']) & ((strtoupper($row['fees']) != 'NONE') or ($row['fees'] != ''))) {
+					$fees = display_text($row['fees']);
+					echo $fees."<br>";
+				}
+			}
+			if ($type == "wms" & isset($row['wms_pricevolume']) & $row['wms_pricevolume'] != 0) {
+				$priceExample = (integer)$row['wms_pricevolume']*400*600/100000000;
+				$priceInformation = $htmlHeader['priceInformation'][0].(integer)$row['wms_pricevolume'];
+				$priceInformation .= $htmlHeader['priceInformation'][1].$htmlHeader['priceInformation'][2].$priceExample.$htmlHeader['priceInformation'][3]." <a href=\"mailto:".$rowOwner['mb_user_email']."\">".$rowOwner['mb_user_email']."</a><br>";
+				echo $priceInformation."<br>";
+			}
+		}
 	}
-	$accessConstraints .= display_text($row['accessconstraints']);
-	echo "<h2>".$htmlHeader['accessConstraintsHeader']."</h2>";
-	echo $accessConstraints."<br>";
-}
-if (isset($row['termsofuse_id']) or strtoupper($row['fees']) != "NONE" or ($type == "wms" & isset($row['wms_pricevolume']) & $row['wms_pricevolume'] != 0) ) {
-
-echo "<h2>".$htmlHeader['feesHeader']."</h2>";
-if (isset($row['termsofuse_id'])) {
-
-	$fees = $htmlHeader['licences'];
-
-	#$fees .= $row['name']."<br>";
-	$fees .= "<a href='".$row['descriptionlink']."' target=_blank><img src='".$row['symbollink']."' ".$row['name']."></a><br>";
-	$fees .= $row['description']."<br>";
-	echo $fees."<br>";
 } else {
-	$fees = display_text($row['fees'])."<br>";
-	echo $fees."<br>";
+	//if nothing about restrictions is defined
+	echo $htmlHeader['noInformation'] ;
 }
-if ($type == "wms" & isset($row['wms_pricevolume']) & $row['wms_pricevolume'] != 0) {
-	$priceExample = (integer)$row['wms_pricevolume']*400*600/100000000;
 
-	$priceInformation = $htmlHeader['priceInformation'][0].(integer)$row['wms_pricevolume'];
-
-	$priceInformation .= $htmlHeader['priceInformation'][1].$htmlHeader['priceInformation'][2].$priceExample.$htmlHeader['priceInformation'][3]." <a href=\"mailto:".$rowOwner['mb_user_email']."\">".$rowOwner['mb_user_email']."</a><br>";
-
-	echo $priceInformation."<br>";
-
-	}
-}
-} else {
-//if nothing about restrictions is defined
-echo "No information for disclaimer available!";
-}
-
 ?>

Added: trunk/mapbender/http/php/mod_interfaceWms4Kml.php
===================================================================
--- trunk/mapbender/http/php/mod_interfaceWms4Kml.php	                        (rev 0)
+++ trunk/mapbender/http/php/mod_interfaceWms4Kml.php	2010-09-10 11:22:39 UTC (rev 6915)
@@ -0,0 +1,64 @@
+<?php
+# http://www.mapbender.org/index.php/Administration
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+require_once dirname(__FILE__) . "/../../core/globalSettings.php";
+if (isset($_REQUEST["id"]) & $_REQUEST["id"] != "") {
+	//validate to csv integer list
+	$testMatch = $_REQUEST["id"];
+	$pattern = '/^[\d,]*$/';		
+ 	if (!preg_match($pattern,$testMatch)){ 
+		echo 'id: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		die(); 		
+ 	}
+	$layerId = $testMatch;
+	$testMatch = NULL;
+}
+//dbselect for generate KML
+$sqlKML = "select wms.wms_getmap, wms.wms_version, layer.layer_name,layer.layer_title, layer_epsg.minx,layer_epsg.miny,layer_epsg.maxx,layer_epsg.maxy from wms, layer, layer_epsg, wms_format where layer.layer_id=$1 and layer.fkey_wms_id=wms.wms_id and layer.layer_id=layer_epsg.fkey_layer_id and layer_epsg.epsg='EPSG:4326' and wms.wms_id=wms_format.fkey_wms_id and wms_format.data_format like '%image/png%' LIMIT 1";
+$vKML = array($layerId);
+$tKML = array('i');
+$resKML = db_prep_query($sqlKML, $vKML, $tKML);
+$rowKML = db_fetch_array($resKML);
+
+if (!isset($rowKML['layer_name'])) {
+	echo "Layer with requested id doesn't exists in registry or layer has no name, so it can't be invoked by Google Earth!";
+	die();
+}
+$getmapurl = eregi_replace("&","&amp;", $rowKML['wms_getmap']);
+$kml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>".chr(13).chr(10);
+$kml.="<kml xmlns=\"http://earth.google.com/kml/2.2\">".chr(13).chr(10);
+$kml.="<GroundOverlay>".chr(13).chr(10);
+$kml.="<name>".$rowKML['layer_title']."</name>".chr(13).chr(10);
+$kml.="<Icon>".chr(13).chr(10);
+$kml.="<href>".$getmapurl."VERSION=".$rowKML['wms_version']."&amp;REQUEST=GetMap&amp;SRS=EPSG:4326&amp;WIDTH=512&amp;HEIGHT=512&amp;LAYERS=".$rowKML['layer_name']."&amp;STYLES=&amp;TRANSPARENT=TRUE&amp;BGCOLOR=0xffffff&amp;FORMAT=image/png&amp;</href>".chr(13).chr(10);
+$kml.="<RefreshMode>onExpire</RefreshMode>".chr(13).chr(10);
+$kml.="<viewRefreshMode>onStop</viewRefreshMode>".chr(13).chr(10);
+$kml.="<viewRefreshTime>1</viewRefreshTime>".chr(13).chr(10);
+$kml.="<viewBoundScale>0.87</viewBoundScale>".chr(13).chr(10);
+$kml.="</Icon>".chr(13).chr(10);
+$kml.="<LatLonBox>".chr(13).chr(10);
+$kml.="<north>".$rowKML['maxy']."</north>".chr(13).chr(10);
+$kml.="<south>".$rowKML['miny']."</south>".chr(13).chr(10);
+$kml.="<east>".$rowKML['maxx']."</east>".chr(13).chr(10);
+$kml.="<west>".$rowKML['minx']."</west>".chr(13).chr(10);
+$kml.="</LatLonBox>".chr(13).chr(10);
+$kml.="</GroundOverlay>".chr(13).chr(10);
+$kml.="</kml>".chr(13).chr(10);
+header("Content-Type: application/vnd.google-earth.kml+xml");
+header("Content-Disposition: attachment; filename=\"KML WMS Layer\"");
+echo $kml;
+?>

Added: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php	                        (rev 0)
+++ trunk/mapbender/http/php/mod_showMetadata.php	2010-09-10 11:22:39 UTC (rev 6915)
@@ -0,0 +1,520 @@
+<?php
+# $Id: mod_showMetadata.php 235 2010-09-08 08:34:48Z armin11 $
+# http://www.mapbender.org/index.php/Administration
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+require_once dirname(__FILE__) . "/../../core/globalSettings.php";
+require_once dirname(__FILE__) . "/../classes/class_user.php";
+
+//GET:
+//resource: wms, layer, wfs, featuretype, wfs-conf, wmc
+//id: integer
+//outputFormat: html, xml, georss, 
+//languageCode: de, en, fr
+
+//Parse REQUEST Parameters
+if (isset($_REQUEST["resource"]) & $_REQUEST["resource"] != "") {
+	//validate to csv integer list
+	$testMatch = $_REQUEST["resource"];
+	if (!($testMatch == 'wms' or $testMatch == 'layer' or $testMatch == 'wfs' or $testMatch == 'featuretype' or $testMatch == 'wfs-conf')){ 
+		echo 'resource: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		die(); 		
+ 	}
+	$resource = $testMatch;
+	$testMatch = NULL;
+}
+if (isset($_REQUEST["id"]) & $_REQUEST["id"] != "") {
+	//validate to csv integer list
+	$testMatch = $_REQUEST["id"];
+	$pattern = '/^[\d,]*$/';		
+ 	if (!preg_match($pattern,$testMatch)){ 
+		echo 'id: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		die(); 		
+ 	}
+	$id = $testMatch;
+	$testMatch = NULL;
+}
+if (isset($_REQUEST["outputFormat"]) & $_REQUEST["outputFormat"] != "") {
+	//validate to csv integer list
+	$testMatch = $_REQUEST["outputFormat"];
+	if (!($testMatch == 'iso19139' or $testMatch == 'html' or $testMatch == 'georss')){ 
+		echo 'outputFormat: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		die(); 		
+ 	}
+	$outputFormat = $testMatch;
+	$testMatch = NULL;
+}
+if (isset($_REQUEST["languageCode"]) & $_REQUEST["languageCode"] != "") {
+	//validate to csv integer list
+	$testMatch = $_REQUEST["languageCode"];
+	if (!($testMatch == 'de' or $testMatch == 'fr' or $testMatch == 'en')){ 
+		echo 'languageCode: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		die(); 		
+ 	}
+	$languageCode = $testMatch;
+	$testMatch = NULL;
+}
+
+$subscribe = intval($_GET["subscribe"]);
+
+//get language parameter out of mapbender session if it is set else set default language to de_DE
+if (isset($_SESSION['mb_lang']) and $_SESSION['mb_lang']!='') {
+	$e = new mb_exception("mod_showMetadata.php: language in session: ".$_SESSION['mb_lang']);
+	$language = $_SESSION["mb_lang"];
+} else {
+	$language = "de_DE";//use locale for compatibility with later mapbender version
+}
+
+//extract language code out of locale
+
+$langCode = explode("_", $language);
+
+$langCode = $langCode[0];
+
+#$langCode="de";
+
+$e = new mb_exception("mod_showMetadata.php: language: ".$langCode);
+
+//Array with translations:
+$translation['overview'] = 'Übersicht';
+$translation['properties'] = 'Eigenschaften';
+$translation['termsOfUse'] = 'Nutzungsbedingungen';
+$translation['contact'] = 'Kontakt';
+$translation['quality'] = 'Qualität';
+$translation['interfaces'] = 'Schnittstellen';
+$translation['metadata'] = 'Metadaten';
+$translation['kindOfResource'] = 'Art der Ressource';
+$translation['wms'] = 'Kartendienst';
+$translation['layer'] = 'Kartenebene';
+$translation['preview'] = 'Voransicht';
+$translation['resourceAbstract'] = 'Zusammenfassung';
+$translation['resourceTitle'] = 'Titel';
+$translation['metadataProvider'] = 'Veröffentlichende Stelle';
+$translation['serviceProvider'] = 'Dienstanbieter';
+$translation['contactPerson'] = 'Ansprechpartner';
+$translation['contactOrganization'] = 'Organisation';
+$translation['contactAddress'] = 'Adresse';
+$translation['email'] = 'Email';
+$translation['city'] = 'Ort';
+$translation['logo'] = 'Logo';
+$translation['status'] = 'Status';
+$translation['availability'] = 'Verfügbarkeit';
+$translation['statusRed'] = 'Probleme beim letzten Monitoring!';
+$translation['statusGreen'] = 'Letztes Monitoring OK';
+$translation['statusYellow'] = 'Dienstebeschreibung hat sich geändert!';
+$translation['queryableFalse'] = 'Ebene nicht abfragbar';
+$translation['queryableTrue'] = 'Ebene abfragbar';
+$translation['queryable'] = 'Abfragbarkeit';
+$translation['restrictedScale'] = 'Sichtbarkeit';
+$translation['minscale'] = 'Minimaler Maßstab';
+$translation['maxscale'] = 'Maximaler Maßstab';
+$translation['crs'] = 'Koordinatenreferenzsysteme (mit BBOX)';
+$translation['wgs84Bbox'] = 'Ausdehnung in geographischen Koordinaten';
+$translation['mapbenderCapabilities'] = 'Geoportal Capabilities';
+$translation['originalCapabilities'] = 'Original Capabilities';
+$translation['kml'] = 'KML';
+$translation['inspireMetadata'] = 'INSPIRE Service Metadaten';
+$translation['securedCapabilities'] = 'Secured Capabilities URL';
+$translation['capabilities'] = 'Link zum Capabilities Dokument';
+$translation['inspireMetadataValidation'] = 'Validierung gegen INSPIRE Geoportal';
+//Array with infos about the different elements which are shown in the tabs
+
+//Check if an id and a resource was given
+if (!isset($_REQUEST["id"]) or !isset($_REQUEST["resource"])) {
+	echo 'Not enough input parameters. resource and id must be given!<br/>'; 
+	die(); 	
+}
+
+//Read out information from mapbender database
+switch ($resource) {
+	case "wms":
+		//get root layer information
+		$sql = "SELECT layer_id FROM layer WHERE fkey_wms_id = $1 AND layer_pos = 0";
+		$v = array($id);
+		$t = array("i");
+		$res = db_prep_query($sql, $v, $t);
+		$row = db_fetch_array($res);
+		$layerId = $row["layer_id"];
+		$sql = "SELECT ";
+		$sql .= "layer.layer_id as contentid, layer.layer_title as contenttitle, layer.layer_abstract as contentabstract, layer.layer_pos as contentpos, layer.layer_parent as contentparent, ";
+		$sql .= "layer.layer_minscale as contentminscale, layer.layer_maxscale as contentmaxscale, layer.layer_queryable,";
+		$sql .= "wms.wms_title as servicetitle, wms.wms_abstract as serviceabstract, wms.wms_id as serviceid, wms.fees, wms.accessconstraints, wms.contactperson, wms.wms_getcapabilities,";
+		$sql .= "wms.contactposition, wms.contactorganization, wms.address, wms.city, wms_timestamp as timestamp, wms_owner as owner, wms.wms_owsproxy as owsproxy, wms.fkey_mb_group_id,";
+		$sql .= "wms.stateorprovince, wms.postcode, wms.contactvoicetelephone, wms.contactfacsimiletelephone, ";
+		$sql .= "wms.contactelectronicmailaddress, wms.country ";
+		$sql .= "FROM layer, wms WHERE layer.layer_id = $1 AND layer.fkey_wms_id = wms.wms_id LIMIT 1";
+		$v = array($layerId);
+		$t = array('i');
+		$serviceType = 'wms';
+		
+		break;
+	case "layer":
+		$layerId = $id;
+		$sql = "SELECT ";
+		$sql .= "layer.layer_id as contentid, layer.layer_title as contenttitle, layer.layer_abstract as contentabstract, layer.layer_pos as contentpos, layer.layer_parent as contentparent, ";
+		$sql .= "layer.layer_minscale as contentminscale, layer.layer_maxscale as contentmaxscale, layer.layer_queryable,";
+		$sql .= "wms.wms_title as servicetitle, wms.wms_abstract as serviceabstract, wms.wms_id as serviceid, wms.fees, wms.accessconstraints, wms.contactperson,  wms.wms_getcapabilities,";
+		$sql .= "wms.contactposition, wms.contactorganization, wms.address, wms.city, wms_timestamp as timestamp, wms_owner as owner, wms.wms_owsproxy as owsproxy, wms.fkey_mb_group_id,";
+		$sql .= "wms.stateorprovince, wms.postcode, wms.contactvoicetelephone, wms.contactfacsimiletelephone, ";
+		$sql .= "wms.contactelectronicmailaddress, wms.country ";
+		$sql .= "FROM layer, wms WHERE layer.layer_id = $1 AND layer.fkey_wms_id = wms.wms_id LIMIT 1";
+		$v = array($layerId);
+		$t = array('i');
+		$serviceType = 'wms';
+		break;
+	case "wfs":
+		echo 'Not yet implemented!'; 
+		$serviceType = 'wfs';
+		die(); 	
+		break;
+	case "featuretype":
+		echo 'Not yet implemented!'; 
+		$serviceType = 'wfs';
+		die(); 	
+		break;
+	case "wfs-conf":
+		echo 'Not yet implemented!'; 
+		$serviceType = 'wfs';
+		die(); 	
+		break;
+	case "wmc":
+		echo 'Not yet implemented!'; 
+		die(); 	
+		break;
+}
+//read resource information from database
+$res = db_prep_query($sql,$v,$t);
+$resourceMetadata = db_fetch_array($res);
+if (!isset($resourceMetadata['contentid']) or ($resourceMetadata['contentid'] == '')) {
+		echo 'No result for the requested id found in the registry!'; 
+		die(); 	
+}
+if($resourceMetadata['owsproxy']!='') {
+	$resourceSecured = true;
+}
+else {
+	$resourceSecured = false;
+}
+$serviceId = $resourceMetadata['serviceid'];
+
+//$e = new mb_exception("mod_showMetadata: fkey_mb_group_id from wms or wfs table: ".$resourceMetadata['fkey_mb_group_id']);
+if (!isset($resourceMetadata['fkey_mb_group_id']) or isnull($resourceMetadata['fkey_mb_group_id'])){
+	$e = new mb_notice("mod_showMetadata: fkey_mb_group_id not found!");
+	//Get information about owning user of the relation mb_user_mb_group - alternativly the defined fkey_mb_group_id from the service must be used!
+	$sqlDep = "SELECT mb_group_name as metdatapointofcontactorgname, mb_group_title as metdatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metdatapointofcontactorglogo, mb_group_address as metdatapointofcontactorgaddress, mb_group_email as metdatapointofcontactorgemail, mb_group_postcode as metdatapointofcontactorgpostcode, mb_group_city as metdatapointofcontactorgcity, mb_group_voicetelephone as metdatapointofcontactorgtelephone, mb_group_facsimiletelephone as metdatapointofcontactorgfax FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND b.mb_user_department = a.mb_group_description LIMIT 1";
+	$vDep = array($resourceMetadata['owner']);
+	$tDep = array('i');
+	$resDep = db_prep_query($sqlDep, $vDep, $tDep);
+	$metadataContactGroup = db_fetch_array($resDep);
+	$e = new mb_notice("mod_showMetadata: mb_group_id: ".$metadataContactGroup['mb_group_id']);
+	$e = new mb_notice("mod_showMetadata: mb_group_logo_path: ".$metadataContactGroup['metdatapointofcontactorglogo']);
+} else {
+	$e = new mb_notice("mod_showMetadata: fkey_mb_group_id found!");
+	$sqlDep = "SELECT mb_group_name as metdatapointofcontactorgname, mb_group_title as metdatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metdatapointofcontactorglogo, mb_group_address as metdatapointofcontactorgaddress, mb_group_email as metdatapointofcontactorgemail, mb_group_postcode as metdatapointofcontactorgpostcode, mb_group_city as metdatapointofcontactorgcity, mb_group_voicetelephone as metdatapointofcontactorgtelephone, mb_group_facsimiletelephone as metdatapointofcontactorgfax FROM mb_group WHERE mb_group_id = $1 LIMIT 1";
+	$vDep = array($resourceMetadata['fkey_mb_group_id']);
+	$tDep = array('i');
+	$resDep = db_prep_query($sqlDep, $vDep, $tDep);
+	$metadataContactGroup = db_fetch_array($resDep);
+}
+
+$e = new mb_exception("mod_showMetadata: mb_group_name: ".$metadataContactGroup['mb_group_name']);
+//db select for layer previews
+if ($resource == 'wms' or $resource == 'layer') {
+	$sqlP = "SELECT * FROM layer_preview WHERE fkey_layer_id = $1 LIMIT 1";
+	$vP = array($layerId);
+	$tP = array('i');
+	$resP = db_prep_query($sqlP, $vP, $tP);
+	$rowP = db_fetch_array($resP);
+	if ($rowP['layer_map_preview_filename'] != "") {
+		$resourceMetadata['preview'] = "<img src = '../x_geoportal/layer_preview/".$rowP['layer_map_preview_filename']."'>";
+	}
+	if ($rowP['layer_legend_preview_filename'] != "") {
+		$resourceMetadata['legend'] .= "<img src = '../x_geoportal/layer_preview/".$rowP['layer_legend_preview_filename']."'>";
+	}
+	
+}
+
+//db select for service quality
+if ($resource == 'wms' or $resource == 'layer') {
+	$sql = "SELECT availability, last_status FROM mb_wms_availability WHERE fkey_wms_id = $1";
+	$v = array($serviceId);
+	$t = array('i');
+	$res = db_prep_query($sql, $v, $t);
+	$serviceQuality = db_fetch_array($res);
+}
+//db select for content properties
+if ($resource == 'wms' or $resource == 'layer') {
+	//get bbox and crs codes for single layer - maybe some entries ;-)
+	$sql = "SELECT * FROM layer_epsg WHERE fkey_layer_id = $1";
+	$contentBboxes = array();
+	$v = array($layerId);
+	$t = array('i');
+	$res = db_prep_query($sql, $v, $t);
+	$j = 0;
+	while ($row = db_fetch_array($res)){
+		$contentBboxes[$j] = array();
+		$contentBboxes[$j]['epsg'] = $row['epsg'];
+		$contentBboxes[$j]['minx'] = $row['minx'];
+		$contentBboxes[$j]['miny'] = $row['miny'];
+		$contentBboxes[$j]['maxx'] = $row['maxx'];
+		$contentBboxes[$j]['maxy'] = $row['maxy'];
+		$j++;
+	}
+	$j = 0;
+}
+
+//generate HTML frame
+
+//Give out page
+
+//Array with structure of metadata
+
+//e.g. tabs and their content
+$html = '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.$langCode.'">';
+$html .= '<body>';
+$metadataStr .= '<head>' . 
+		'<title>'.$translation['metadata'].'</title>' . 
+		'<meta name="description" content="'.$translation['metadata'].'" xml:lang="'.$langCode.'" />'.
+		'<meta name="keywords" content="'.$translation['metadata'].'" xml:lang="'.$langCode.'" />'	.	
+		'<meta http-equiv="cache-control" content="no-cache">'.
+		'<meta http-equiv="pragma" content="no-cache">'.
+		'<meta http-equiv="expires" content="0">'.
+		'<meta http-equiv="content-language" content="'.$langCode.'" />'.
+		'<meta http-equiv="content-style-type" content="text/css" />'.
+		'<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">' . 	
+		'</head>';
+$html .= $metadataStr;
+//define the javascripts to include
+$html .= '<link type="text/css" href="../extensions/jquery-ui-1.8.1.custom/css/ui-lightness/jquery-ui-1.8.1.custom.css" rel="Stylesheet" />';	
+$html .= '<script type="text/javascript" src="../extensions/jquery-ui-1.8.1.custom/js/jquery-1.4.2.min.js"></script>';
+$html .= '<script type="text/javascript" src="../extensions/jquery-ui-1.8.1.custom/js/jquery-ui-1.8.1.custom.min.js"></script>';
+
+//define the javascript functions
+$html .= '<script type="text/javascript">';
+$html .= '	$(function() {';
+$html .= '		$("#accordion").accordion();';
+//$html .= '		$("#accordion").accordion({ autoHeight: false});';
+//$html .= '		$("#accordion").accordion({ autoHeight: false , clearStyle: true });';
+$html .= '	});';
+$html .= '	</script>';
+$html .= '<div class="demo">';
+$html .= '<div id="accordion">';
+
+//some placeholders
+$tableBegin =  "<table>\n";
+$t_a = "\t<tr>\n\t\t<th>\n\t\t\t";
+$t_b = "\n\t\t</th>\n\t\t<td>\n\t\t\t";
+$t_c = "\n\t\t</td>\n\t</tr>\n";
+$tableEnd = "</table>\n";
+
+//generate div tags for the content - the divs are defined in the array
+$html .= '<h3><a href="#">'.$translation["overview"].'</a></h3>';
+$html .= '<div style="height:300px">';
+$html .= '<p>';
+$html .= $tableBegin;
+$html .= $t_a.$translation['resourceTitle'].$t_b.displayText($resourceMetadata['contenttitle']).$t_c;
+$html .= $t_a.$translation['kindOfResource'].$t_b.displayText($translation[$resource]).$t_c;
+if (($resource == 'wms' or $resource == 'layer') and isset($resourceMetadata['preview'])) {
+	$html .= $t_a.$translation['preview'].$t_b.$resourceMetadata['preview'];
+	if (isset($resourceMetadata['legend'])) {
+		$html .= $resourceMetadata['legend'];
+	}
+	$html .= $t_c;
+}
+$html .= $t_a.$translation['resourceAbstract'].$t_b.displayText($resourceMetadata['contentabstract']).$t_c;
+
+$user = new User();
+//
+// Monitoring is only available if the user is allowed to access this service
+//
+
+if ($resource == 'wms' or $resource == 'layer'){
+	if ($user->isLayerAccessible($layerId)) {
+		if ($subscribe === 1) {
+			$user->addSubscription($resourceMetadata['serviceid']);
+		}
+		else if ($subscribe === 0) {
+			$user = new User();
+			$user->cancelSubscription($resourceMetadata['serviceid']);
+		}
+		$currentUser = new User();
+		$is_subscribed = $currentUser->hasSubscription($resourceMetadata['serviceid']);
+		$is_public = $currentUser->isPublic();
+		//show abo function to registred and authorized users
+		//if ($is_subscribed && !$is_public) {
+		if ($is_subscribed) {
+			$aboStr = "<tr><th>Abo</th><td><img src = '../img/mail_delete.png'>" . 
+					"<a href = '../php/mod_showMetadata.php?id=" . 
+					$layerId . "&resource=layer&user_id=" . $currentUser->id . "&subscribe=0'>" . 
+					_mb("Monitoring Abo l&ouml;schen") . "</a></td></tr>"; //TODO check wherefor user_id should be given as parameter?
+		}
+		//else if (!$is_subscribed && !$is_public) {
+		else if (!$is_subscribed) {
+			$aboStr = "<tr><th>Abo</th><td><img src = '../img/mail_send.png'>" . 
+					"<a href = '../php/mod_showMetadata.php?id=" . $layerId . 
+					"&resource=layer&user_id=" . $currentUser->id . "&subscribe=1'>" . 
+					_mb("Monitoring abonnieren") . "</a></td></tr>";
+		}
+	}
+	$html .= $aboStr;
+}
+
+$html .= $tableEnd;
+$html .= '</p>';
+$html .= '</div>';
+$html .= '<h3><a href="#">'.$translation["properties"].'</a></h3>';
+$html .= '<div style="height:300px">';
+$html .= '<p>';
+$html .= $tableBegin;
+
+if ($resource == 'wms' or $resource == 'layer'){
+	if ($resourceMetadata['layer_queryable'] == '1') {
+			$html .= $t_a.$translation['queryable'].$t_b.$translation['queryableTrue'].$t_c;	
+	} else {
+			$html .= $t_a.$translation['queryable'].$t_b.$translation['queryableFalse'].$t_c;
+	}
+}
+$epsgString = '';
+for ($j = 0; $j < count($contentBboxes); $j++) {
+		$epsgString .= $contentBboxes[$j]['epsg']." ";
+		if ($contentBboxes[$j]['epsg'] == 'EPSG:4326') {
+			$wgs84Bbox = $contentBboxes[$j]['minx'].",".$contentBboxes[$j]['miny'].",".$contentBboxes[$j]['maxx'].",".$contentBboxes[$j]['maxy'];
+		}
+}
+
+$html .= $t_a.$translation['crs'].$t_b.$epsgString.$t_c;
+if (isset($wgs84Bbox)) {
+	$html .= $t_a.$translation['wgs84Bbox'].$t_b.$wgs84Bbox.$t_c;
+}
+$html .= $tableEnd;
+$html .= $tableBegin;
+//Scales
+if (isset($resourceMetadata['contentminscale']) or isset($resourceMetadata['contentmaxscale'])){
+	$html .= '<h4>'.$translation['restrictedScale'].'</h4>';
+	if (isset($resourceMetadata['contentminscale']) & $resourceMetadata['contentminscale'] != '0' ) {
+		$html .= $t_a.$translation['maxscale'].$t_b. "1 : ".$resourceMetadata['contentminscale'].$t_c;	
+	}
+	if (isset($resourceMetadata['contentmaxscale']) & $resourceMetadata['contentmaxscale'] != '0') {
+		$html .= $t_a.$translation['minscale'].$t_b. "1 : ".$resourceMetadata['contentmaxscale'].$t_c;	
+	}
+}
+
+$html .= $tableEnd;
+$html .= '</p>';
+$html .= '</div>';
+
+$html .= '<h3><a href="#">'.$translation["contact"].'</a></h3>';
+
+$html .= '<div style="height:300px">';
+$html .= '<p>';
+
+$html .= '<h4>'.$translation['metadataProvider'].'</h4>';
+
+$html .= $tableBegin;
+if ($metadataContactGroup['metdatapointofcontactorglogo'] != '') {
+	$html .= $t_a.$translation['logo'].$t_b."<img src='".$metadataContactGroup['metdatapointofcontactorglogo']."'  height='30'>".$t_c;
+}
+$html .= $t_a.$translation['contactOrganization'].$t_b.displayText($metadataContactGroup['metdatapointofcontactorgtitle']).$t_c;
+$html .= $t_a.$translation['contactAddress'].$t_b.displayText($metadataContactGroup['metdatapointofcontactorgaddress']).$t_c;
+$html .= $t_a.$translation['city'].$t_b.displayText($metadataContactGroup['metdatapointofcontactorgpostcode'].' '.$metadataContactGroup['metdatapointofcontactorgcity']).$t_c;
+$html .= $t_a.$translation['email'].$t_b.displayText($metadataContactGroup['metdatapointofcontactorgemail']).$t_c;
+$html .= $tableEnd;
+
+$html .= '<h4>'.$translation['serviceProvider'].'</h4>';
+$html .= $tableBegin;
+$html .= $t_a.$translation['contactOrganization'].$t_b.displayText($resourceMetadata['contactorganization']).$t_c;
+$html .= $t_a.$translation['contactPerson'].$t_b.displayText($resourceMetadata['contactperson']).$t_c;
+$html .= $t_a.$translation['contactAddress'].$t_b.displayText($resourceMetadata['address']).$t_c;
+$html .= $t_a.$translation['contactCity'].$t_b.displayText($resourceMetadata['postcode'].' '.$resourceMetadata['city']).$t_c;
+$html .= $t_a.$translation['email'].$t_b.displayText($resourceMetadata['contactelectronicmailaddress']).$t_c;
+$html .= $tableEnd;
+
+$html .= '</p>';
+
+$html .= '</div>';
+
+$html .= '<h3><a href="#">'.$translation["termsOfUse"].'</a></h3>';
+$html .= '<div style="height:300px">';
+$html .= '<p>';
+$tou = file_get_contents("http://localhost/mapbender/php/mod_getServiceDisclaimer.php?type=".$serviceType."&id=".$serviceId."&languageCode=".$langCode."&asTable=true");
+$html .= $tou;
+$html .= '</p>';
+$html .= '</div>';
+
+$html .= '<h3><a href="#">'.$translation["quality"].'</a></h3>';
+$html .= '<div style="height:300px">';
+$html .= '<p>';
+$html .= $tableBegin;
+switch ($serviceQuality['last_status']) {
+	case '1':
+		$html .= $t_a.$translation['status'].$t_b.'Stable'.$t_c;
+		break;
+	case '0':
+		$html .= $t_a.$translation['status'].$t_b.'Not up to date'.$t_c;
+		break;
+	case '-1':
+		$html .= $t_a.$translation['status'].$t_b.'Service has Problems'.$t_c;
+		break;
+}
+if (isset($serviceQuality['availability'])) {
+	$html .= $t_a.$translation['availability'].$t_b.$serviceQuality['availability']." %".$t_c;
+}
+$html .= $tableEnd;
+$html .= '</p>';
+$html .= '</div>';
+$html .= '<h3><a href="#">'.$translation["interfaces"].'</a></h3>';
+$html .= '<div style="height:300px">';
+$html .= '<p>';
+
+/*$translation['mapbenderCapabilities'] = 'Geoportal Capabilities';
+$translation['originalCapabilities'] = 'Original Capabilities';
+$translation['kml'] = 'KML';
+$translation['inspireMetadata'] = 'INSPIRE Service Metadaten';
+$translation['securedCapabilities'] = 'Secured Capabilities URL';*/
+$html .= $tableBegin;
+$html .= $t_a.$translation['mapbenderCapabilities'].$t_b."<a href = '../php/wms.php?layer_id=".$layerId."&PHPSESSID=".session_id()."&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS' target=_blank>".$translation['capabilities']."</a>".$t_c;
+$html .= $t_a.$translation['originalCapabilities'].$t_b."<a href = '".$resourceMetadata['wms_getcapabilities']."&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS' target=_blank>".$translation['capabilities']."</a>".$t_c;
+$html .= $t_a.$translation['inspireMetadata'].$t_b."<a href='../php/mod_layerISOMetadata.php?SERVICE=WMS&outputFormat=iso19139&Id=".	$layerId."' target=_blank ><img src='../img/inspire_tr_36.png' title='".$translation['inspireMetadata']."' style='width:34px;height:34px' alt='' /></a>"."<a href='../php/mod_layerISOMetadata.php?SERVICE=WMS&outputFormat=iso19139&Id=".$layerId."&validate=true' target=_blank title='".$translation['inspireMetadataValidation']."'>".$translation['inspireMetadataValidation']."</a>";
+
+//if service is secured and http_auth is adjusted show secured url
+if ($resourceSecured) {
+	$securedLink = HTTP_AUTH_PROXY."/".$layerId."?REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS";
+	$html .= $t_a.$translation['securedCapabilities'].$t_b."<a href = '".$securedLink."' target=_blank>".$translation['capabilities']."</a>".$t_c;
+}
+//kml
+$html .= $t_a.$translation['kml'].$t_b."<a href='../php/mod_interfaceWms4Kml.php?id=".$layerId.">".$translation['kml']."-Datei</a>".$t_c;
+
+$html .= $tableEnd;
+$html .= '</p>';
+$html .= '</div>';
+
+$html .= '</div>'; //accordion
+$html .= '</div>'; //demo
+
+$html .= '</body>';
+$html .= '</html>';
+
+echo $html;
+
+//functions (from old metadata module):
+function displayText($string) {
+    $string = mb_eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
+    $string = mb_eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
+    $string = mb_eregi_replace("\n", "<br>", $string);
+    return $string;
+} 
+?>

Modified: trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql
===================================================================
--- trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql	2010-09-07 19:42:09 UTC (rev 6914)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql	2010-09-10 11:22:39 UTC (rev 6915)
@@ -2784,3 +2784,23 @@
 DELETE FROM gui_element_vars WHERE fkey_e_id = 'editGUI_WMS' AND var_name = 'css_file';
 DELETE FROM gui_element_vars WHERE fkey_e_id = 'EditWMSMetadata' AND var_name = 'file_css';
 
+
+-- add a column group to the service tables to allow special group relation for metadataPointOfContact - which can be another group than the one from the owner of the service. The fkey has explicitly no special constraint! 
+-- Column: fkey_mb_group_id
+
+-- ALTER TABLE wms DROP COLUMN fkey_mb_group_id;
+
+ALTER TABLE wms ADD COLUMN fkey_mb_group_id integer;
+ALTER TABLE wms ALTER COLUMN fkey_mb_group_id SET STORAGE PLAIN;
+
+-- Column: fkey_mb_group_id
+
+-- ALTER TABLE wms DROP COLUMN fkey_mb_group_id;
+
+ALTER TABLE wfs ADD COLUMN fkey_mb_group_id integer;
+ALTER TABLE wfs ALTER COLUMN fkey_mb_group_id SET STORAGE PLAIN;
+
+
+
+
+



More information about the Mapbender_commits mailing list