[Mapbender-commits] r7920 - in trunk/mapbender: http/php resources/locale/de_DE/LC_MESSAGES

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jul 8 03:40:54 EDT 2011


Author: armin11
Date: 2011-07-08 00:40:54 -0700 (Fri, 08 Jul 2011)
New Revision: 7920

Modified:
   trunk/mapbender/http/php/mod_showMetadata.php
   trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
Log:
Some translations, new possibility to load viewer from metadata show module and some easier handling of capabilities urls from metadata show module.

Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php	2011-07-08 07:30:17 UTC (rev 7919)
+++ trunk/mapbender/http/php/mod_showMetadata.php	2011-07-08 07:40:54 UTC (rev 7920)
@@ -194,6 +194,8 @@
 		$translation['metadata from capabilities'] = "Metadaten von Service Capabilities";
 		$translation['added from registry'] = "Metadaten über Registry angereichert";
 		$translation['Coupled Metadata'] = "Verknüpfte Metadaten";
+		$translation['addLayerToMap'] = "Karte im eigenen Viewer anzeigen";
+		$translation['showMap'] = "Karte anzeigen";
 		break;
 	case "en":
 		$translation['overview'] = 'Overview';
@@ -266,6 +268,8 @@
 		$translation['metadata from capabilities'] = "metadata from capabilities";
 		$translation['added from registry'] = "added from registry";
 		$translation['Coupled Metadata'] = "Coupled Metadata";
+		$translation['addLayerToMap'] = "Show map in own viewer";
+		$translation['showMap'] = "Show map";
 		break;
 	default: #to english
 		$translation['overview'] = 'Overview';
@@ -338,6 +342,8 @@
 		$translation['metadata from capabilities'] = "metadata from capabilities";
 		$translation['added from registry'] = "added from registry";
 		$translation['Coupled Metadata'] = "Coupled Metadata";
+		$translation['addLayerToMap'] = "Show map in own viewer";
+		$translation['showMap'] = "Show map";
 }
 
 //Array with infos about the different elements which are shown in the tabs
@@ -597,8 +603,32 @@
 	$html .= '<link type="text/css" href="../extensions/jquery-ui-1.8.1.custom/css/custom-theme/jquery-ui-1.8.5.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>';
+//some js for dialog
+	//following is added to give a window with an interated link which can be included in external applications
+	$html .= '<script type="text/javascript">';
+	
+	$html .= 'showCapabilitiesUrl = function (url,title) {';
+		$html .= 'hideCapabilitiesUrl();';
+		$html .= 'var $capabilitiesUrlPopup = $(\'<div><input size="40" type="text" value="\' + url + \'"/></div>\');';
+		$html .= '$capabilitiesUrlPopup.dialog({';
+			$html .= 'title: title,';
+			$html .= 'bgiframe: true,';
+			$html .= 'autoOpen: true,';
+			$html .= 'resizable: false,';
+			$html .= 'modal: true,';
+			$html .= 'width: 400,';
+			$html .= 'height: 90,';
+			$html .= 'pos: [600,40]';
+		$html .= '});';
+	$html .= '};';
+	
+	$html .= 'hideCapabilitiesUrl = function () {';
+		$html .= 'if($(\'capabilitiesUrl.Popup\').size() > 0) {';
+			$html .= '$(\'capabilitiesUrl.Popup\').dialog(\'destroy\');';
+		$html .= '}';
+	$html .= '};';
+	$html .= '</script>';
 
-
 /*if ($metadataContactGroup['metadatapointofcontactorglogo'] != '') {
 	$html .= "<img src='".$metadataContactGroup['metadatapointofcontactorglogo']."'  height='30'>";
 }
@@ -730,13 +760,17 @@
 }
 
 $user = new User();
+$layerAccessibility = $user->isLayerAccessible ($layerId);
 
+
 //
+
+//
 // Monitoring is only available if the user is allowed to access this service
 //
 
 if ($resource == 'wms' or $resource == 'layer'){
-	if ($user->isLayerAccessible($layerId)) {		
+	if ($layerAccessibility) {		
 		$is_public = $user->isPublic();
 		//show abo function to registred and authorized users
 		if (!$is_public) {
@@ -760,6 +794,18 @@
 	$html .= $aboStr;
 }
 
+
+if ($layerAccessibility && WRAPPER_PATH != '' && ($resource == 'layer' or $resource == 'wms' )) {
+	$showMapUrl = $mapbenderBaseUrl.WRAPPER_PATH."?LAYER[zoom]=1&LAYER[id]=".$resourceMetadata['contentid'];
+	//$html .= $t_a.$translation['addLayerToMap'].$t_b."<a href='".$showMapUrl."' target='_blank'><img src='../img/osgeo_graphics/layer-wms-add.png'></a>".$t_c;
+	$html .= $t_a."<button onclick='window.open(\"".$showMapUrl."\", 
+  \"windowname1\", 
+  \"width=1024, height=768\");'
+   return false;><img src='../img/osgeo_graphics/layer-wms-add.png'>".$translation['showMap']."</button>".$t_b."".$t_c;
+	
+}
+
+
 $html .= $tableEnd;
 $html .= '</p>';
 $html .= '</div>';
@@ -1077,19 +1123,26 @@
 }
 
 if ($resource == 'wms' or $resource == 'layer'){
-	$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['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> <img src='../img/osgeo_graphics/geosilk/link.png' onclick='showCapabilitiesUrl(\"".$mapbenderBaseUrl.$_SERVER['PHP_SELF']."/../wms.php?layer_id=".$layerId."&PHPSESSID=".session_id()."&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS"."\",\"".$translation['mapbenderCapabilities']."\");'>".$t_c;
 $capUrl = $resourceMetadata['wms_getcapabilities'].getConjunctionCharacter($resourceMetadata['wms_getcapabilities']).'REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS';
-	$html .= $t_a.$translation['originalCapabilities'].$t_b."<a href = '".$capUrl."' target=_blank>".$translation['capabilities']."</a>".$t_c;
 
-	$html .= $t_a.$translation['inspireCapabilities'].$t_b."<a href = '../php/wms.php?layer_id=".$layerId."&PHPSESSID=".session_id()."&INSPIRE=1&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS' target=_blank>".$translation['capabilities']."</a>".$t_c;
+	//show only original url if the resource is not secured!
+	if (!$resourceSecured) {	
+		$html .= $t_a.$translation['originalCapabilities'].$t_b."<a href = '".$capUrl."' target=_blank>".$translation['capabilities']."</a>".$t_c;
+	}
+
+	$html .= $t_a.$translation['inspireCapabilities'].$t_b."<a href = '../php/wms.php?layer_id=".$layerId."&PHPSESSID=".session_id()."&INSPIRE=1&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS' target=_blank>".$translation['capabilities']."</a> <img src='../img/osgeo_graphics/geosilk/link.png' onclick='showCapabilitiesUrl(\"".$mapbenderBaseUrl.$_SERVER['PHP_SELF']."/../wms.php?layer_id=".$layerId."&PHPSESSID=".session_id()."&INSPIRE=1&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS"."\",\"".$translation['inspireCapabilities']."\");'>".$t_c;
+
 	$html .= $t_a.$translation['inspireMetadata'].$t_b."<a href='../php/mod_layerISOMetadata.php?SERVICE=WMS&outputFormat=iso19139&Id=".	$layerId."' target=_blank ><img style='border: none;' src='../img/inspire_tr_36.png' title='".$translation['inspireMetadata']."' style='width:34px;height:34px' alt='' /></a>".$t_c;
 	$html .= $t_a.$translation['inspireMetadataValidation'].$t_b."<a href='../php/mod_layerISOMetadata.php?SERVICE=WMS&outputFormat=iso19139&Id=".$layerId."&validate=true' target=_blank title='".$translation['inspireMetadataValidation']."'>".$translation['showInspireMetadataValidation']."</a>".$t_c;
 
 	//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;
+		$html .= $t_a.$translation['securedCapabilities'].$t_b."<a href = '".$securedLink."' target=_blank>".$translation['capabilities']."</a> <img src='../img/osgeo_graphics/geosilk/link.png' onclick='showCapabilitiesUrl(\"".$securedLink."\",\"".$translation['securedCapabilities']."\");'>".$t_c;
 	}
+
 	//kml
 	$html .= $t_a.$translation['kml'].$t_b."<a href='../php/mod_interfaceWms4Kml.php?id=".$layerId."'><img style='border: none;' src='../img/misc/kml_icon.gif' title='".$translation['kml']."' style='width:34px;height:34px' alt='' /></a>".$t_c;
 }

Modified: trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
===================================================================
--- trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2011-07-08 07:30:17 UTC (rev 7919)
+++ trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2011-07-08 07:40:54 UTC (rev 7920)
@@ -2620,6 +2620,9 @@
 msgid "Metadata point of contact email"
 msgstr "Metadatenkontakt E-Mail"
 
+msgid "Metadata point of contact name"
+msgstr "Name der Kontaktstelle für Metadaten"
+
 msgid "Metadata date"
 msgstr "Datum der Metadaten"
 



More information about the Mapbender_commits mailing list