[Mapbender-commits] r4298 - branches/mifan_dev/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jul 3 15:37:38 EDT 2009


Author: mifan
Date: 2009-07-03 15:37:38 -0400 (Fri, 03 Jul 2009)
New Revision: 4298

Modified:
   branches/mifan_dev/mapbender/http/php/mod_loadCatalogCapabilities.php
Log:
more admin func. to add catalogs

Modified: branches/mifan_dev/mapbender/http/php/mod_loadCatalogCapabilities.php
===================================================================
--- branches/mifan_dev/mapbender/http/php/mod_loadCatalogCapabilities.php	2009-07-03 19:31:07 UTC (rev 4297)
+++ branches/mifan_dev/mapbender/http/php/mod_loadCatalogCapabilities.php	2009-07-03 19:37:38 UTC (rev 4298)
@@ -65,3 +65,111 @@
   	}
   	-->
 </style>
+
+<script language="JavaScript">
+function validate(wert){
+	if(wert == 'guiList'){
+		var listIndex = document.form1.guiList.selectedIndex;
+		if(listIndex<0){
+			alert("Please select a GUI.");
+			return false;
+		}
+		else{
+			var gui_id=document.form1.guiList.options[listIndex].value;
+			document.form1.action = '../php/mod_loadwms.php?<?php echo $urlParameters ?>';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+</head>
+<body>
+
+<?php
+
+//Get GUIs for present user
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"],true);
+
+echo "<form name='form1' action='" . $self ."' method='post'>";
+echo "<table cellpadding='0' cellspacing='0' border='0'>";
+echo "<tr>";
+echo "<td>";
+if (count($ownguis)>0){
+	echo"GUI";
+	echo"<br>";
+	$v = array();
+	$t = array();
+	$sql = "SELECT * FROM gui WHERE gui_id IN ("; 
+	for($i=0; $i<count($ownguis); $i++){
+		if($i>0){ $sql .= ",";}
+		$sql .= "$".($i+1);
+		array_push($v,$ownguis[$i]);
+		array_push($t,'s');
+	}
+	$sql .= ") ORDER BY gui_name";
+	$res = db_prep_query($sql,$v,$t);
+	echo"<select size='8' name='guiList' style='width:200px' onClick='submit()'>";
+	while($row = db_fetch_array($res)){
+		echo "<option value='".$row["gui_id"]."' ";
+		if($guiList && $guiList == $row["gui_name"]){
+			echo "selected";
+		}
+		echo ">".$row["gui_name"]."</option>";
+	} 
+	$arrayGUIs=$_SESSION["mb_user_guis"];
+	echo count($arrayGUIs);
+	echo "</select><br><br>";
+	echo "</td>";
+	echo "<td>";
+	echo"CATALOG";
+	echo"<br>";
+	
+	//Change to catalog tables: mif
+	if(isset($guiList) && $guiList!=""){
+		$sql = "SELECT DISTINCT wms.wms_title,gui_wms_position from gui_wms JOIN ";
+		$sql .= "gui on gui_wms.fkey_gui_id = gui.gui_id JOIN wms ON gui_wms.fkey_wms_id = wms.wms_id ";
+		$sql .= "and gui_wms.fkey_gui_id = gui.gui_id where gui.gui_name = $1 order by gui_wms_position";
+		$v = array($guiList);
+		$t = array('s');
+		$res = db_prep_query($sql,$v,$t);
+		$count=0;
+		echo"<select size='8' name='wmsList' style='width:200px'>";
+	
+		while($row = db_fetch_array($res)){
+			if ($row["wms_title"]!=""){
+				echo "<option value='' ";
+				echo ">".$row["wms_title"]."</option>";
+			}
+			$count++;
+		}
+	    echo "</select><br><br>";
+	}
+	else{
+		echo"<select size='8' name='wmsList' style='width:200px' on Click='submit()'>";
+		echo "</select><br><br>";
+	}
+	echo "</td>";
+	echo "<tr></table><br>";
+	echo "Add the following REQUEST to the Online Resource URL to obtain the Capabilities document:<br>";
+	echo "<i>(Triple click to select and copy)</i><br>"; 
+	echo "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1<br>";
+	echo "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0<br>";
+	echo "REQUEST=capabilities&WMTVER=1.0.0<br><br>";
+	echo "Link to Catalog Capabilities URL:<br>";
+	
+	if (isset($xml_file)){
+		echo"<input type='text' name='xml_file' size='50' value='".$xml_file."'>";
+	}else{
+		echo"<input type='text' name='xml_file' size='50' value='http://'>";
+	}
+	echo"<input type='button' name='loadCap' value='Load' onClick='validate(\"guiList\")'>";
+	echo "</form>";
+}
+else{
+	echo "There are no guis available for this user. Please create a gui first.";
+}
+?>
+</body>
+</html>
\ No newline at end of file



More information about the Mapbender_commits mailing list