[Mapbender-commits] r7540 - in trunk/mapbender/http: classes javascripts plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Feb 7 05:43:04 EST 2011


Author: armin11
Date: 2011-02-07 02:43:03 -0800 (Mon, 07 Feb 2011)
New Revision: 7540

Modified:
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/javascripts/geometry.js
   trunk/mapbender/http/plugins/mb_metadata_edit.php
   trunk/mapbender/http/plugins/mb_metadata_server.php
   trunk/mapbender/http/plugins/mb_metadata_wfs_edit.php
Log:
Allow to set network_access metadata in metadata editor

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2011-02-06 17:01:06 UTC (rev 7539)
+++ trunk/mapbender/http/classes/class_wms.php	2011-02-07 10:43:03 UTC (rev 7540)
@@ -2082,6 +2082,9 @@
 		}
 	}
 	function updateObjInDB($myWMS){
+		if (!isset($this->wms_network_access) || ($this->wms_network_access == '')) {
+			$this->wms_network_access = intval('0');
+		}
 		$admin = new administration();
 		db_begin();
 		
@@ -2098,14 +2101,15 @@
 		$sql .= "wms_supportsld = $10, ";
 		$sql .= "wms_userlayer = $11, ";
 		$sql .= "wms_userstyle = $12, ";
-		$sql .= "wms_remotewfs = $13 ";
-		$sql .= " WHERE wms_id = $14";
+		$sql .= "wms_remotewfs = $13, ";
+		$sql .= "wms_network_access = $14 ";
+		$sql .= " WHERE wms_id = $15";
 	
 		$v = array($this->wms_version,$this->wms_getcapabilities,
 			$this->wms_getmap,$this->wms_getfeatureinfo,$this->wms_getlegendurl,
 			$admin->char_encode($this->wms_getcapabilities_doc),$this->wms_upload_url,Mapbender::session()->get("mb_user_id"),strtotime("now"),
-			$this->wms_supportsld,$this->wms_userlayer,$this->wms_userstyle,$this->wms_remotewfs,$myWMS);
-		$t = array('s','s','s','s','s','s','s','i','i','s','s','s','s','i');
+			$this->wms_supportsld,$this->wms_userlayer,$this->wms_userstyle,$this->wms_remotewfs,$this->wms_network_access, $myWMS);
+		$t = array('s','s','s','s','s','s','s','i','i','s','s','s','s','i','i');
 	
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
@@ -2128,14 +2132,15 @@
 			$sql .= "country = $12, ";
 			$sql .= "contactvoicetelephone = $13, ";
 			$sql .= "contactfacsimiletelephone = $14, ";
-			$sql .= "contactelectronicmailaddress = $15 ";
-			$sql .= " WHERE wms_id = $16";
+			$sql .= "contactelectronicmailaddress = $15, ";
+			$sql .= "wms_network_access = $16 ";
+			$sql .= " WHERE wms_id = $17";
 		
 			$v = array($this->wms_title,$this->wms_abstract,$this->fees,$this->accessconstraints,
 				$this->contactperson,$this->contactposition,$this->contactorganization,$this->address,
 				$this->city,$this->stateorprovince,$this->postcode,$this->country,$this->contactvoicetelephone,
-				$this->contactfacsimiletelephone,$this->contactelectronicmailaddress,$myWMS);
-			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i');
+				$this->contactfacsimiletelephone,$this->contactelectronicmailaddress,$this->wms_network_access,$myWMS);
+			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i');
 			$res = db_prep_query($sql,$v,$t);
 			if(!$res){
 				db_rollback();	
@@ -2736,6 +2741,7 @@
 			$this->postcode = $row2["postcode"];
 			$this->country = $row2["country"];
 			$this->contactelectronicmailaddress = $row2["contactelectronicmailaddress"];
+			$this->wms_network_access = $row2["wms_network_access"];
 			
 			#some default
 			$this->gui_wms_visible = 1;

Modified: trunk/mapbender/http/javascripts/geometry.js
===================================================================
--- trunk/mapbender/http/javascripts/geometry.js	2011-02-06 17:01:06 UTC (rev 7539)
+++ trunk/mapbender/http/javascripts/geometry.js	2011-02-07 10:43:03 UTC (rev 7540)
@@ -1862,7 +1862,7 @@
 						"fill": col,
 						"stroke": col,
 						"stroke-width": lineWidth,
-						"fill-opacity": 0.5
+						"fill-opacity": 0.1
 					});
 				}
 				else {

Modified: trunk/mapbender/http/plugins/mb_metadata_edit.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_edit.php	2011-02-06 17:01:06 UTC (rev 7539)
+++ trunk/mapbender/http/plugins/mb_metadata_edit.php	2011-02-07 10:43:03 UTC (rev 7540)
@@ -56,6 +56,10 @@
 		</select>
     	<img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Auswahl von vordefinierten Lizenzen hinsichtlich Gebühren und Zugriffsbeschränkungen.");?>'}" src="../img/questionmark.png" alt="" />
 	</p>
+	<p>
+		<label for="wms_network_access"><?php echo _mb("Restricted Network Access (Registry)");?>:</label>
+      		<input name="wms_network_access" id="wms_network_access" type="checkbox"/>
+	</p>
 </fieldset>
 <fieldset>
 	<legend><?php echo _mb("WMS Provider Section (OWS)");?></legend>

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2011-02-06 17:01:06 UTC (rev 7539)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2011-02-07 10:43:03 UTC (rev 7540)
@@ -97,7 +97,8 @@
 			"country", 
 			"contactelectronicmailaddress",
 			"wms_timestamp", 
-			"wms_timestamp_create"
+			"wms_timestamp_create",
+			"wms_network_access"
 		);
 
 		$resultObj = array();
@@ -152,7 +153,7 @@
 			$resultObj["wms_termsofuse"] = null;
 		}
 		
-
+		$resultObj['wms_network_access'] = $resultObj['wms_network_access'] == 1 ? true : false;
 		$ajaxResponse->setResult($resultObj);
 		$ajaxResponse->setSuccess(true);
 
@@ -340,7 +341,8 @@
 			"postcode", 
 			"country", 
 			"contactelectronicmailaddress",
-			"wms_termsofuse"
+			"wms_termsofuse",
+			"wms_network_access"
 		);
 		foreach ($columns as $c) {
 			$value = $data->wms->$c;
@@ -411,9 +413,12 @@
 				}
 			}
 		}
-
+		if ($wms->wms_network_access == "on") {
+			$wms->wms_network_access = intval('1');
+		} else {
+			$wms->wms_network_access = intval('0');
+		}
 		$wms->updateObjInDB($wmsId);
-
 		
 		$ajaxResponse->setMessage("Updated WMS metadata for ID " . $wmsId);
 		$ajaxResponse->setSuccess(true);		

Modified: trunk/mapbender/http/plugins/mb_metadata_wfs_edit.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wfs_edit.php	2011-02-06 17:01:06 UTC (rev 7539)
+++ trunk/mapbender/http/plugins/mb_metadata_wfs_edit.php	2011-02-07 10:43:03 UTC (rev 7540)
@@ -115,4 +115,8 @@
       	<td><input readonly="readonly" name="wfs_timestamp" id="wfs_timestamp"/>
       	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
+<p>
+	  	<label for="wfs_network_access"><?php echo _mb("Restricted Network Access (Registry)");?>:</label>
+      	<input name="wfs_network_access" id="wfs_network_access" type="checkbox"/>
+	</p>
 </fieldset>



More information about the Mapbender_commits mailing list