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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jul 20 05:50:54 EDT 2009


Author: mifan
Date: 2009-07-20 05:50:54 -0400 (Mon, 20 Jul 2009)
New Revision: 4389

Modified:
   branches/mifan_dev/mapbender/http/php/mod_loadCatalogToGUI.php
Log:
load catalog to GUI

Modified: branches/mifan_dev/mapbender/http/php/mod_loadCatalogToGUI.php
===================================================================
--- branches/mifan_dev/mapbender/http/php/mod_loadCatalogToGUI.php	2009-07-20 09:25:29 UTC (rev 4388)
+++ branches/mifan_dev/mapbender/http/php/mod_loadCatalogToGUI.php	2009-07-20 09:50:54 UTC (rev 4389)
@@ -28,7 +28,7 @@
 <?php
 echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
 ?>
-<title>Link Catalog to GUI</title>
+<title>Load WMS from Catalog</title>
 <?php
 include '../include/dyn_css.php';
 ?>
@@ -78,8 +78,8 @@
   	-->
 </style>
 <script language="JavaScript">
-function validate(vals){
-   if(vals == 'guiList'){
+function validate(wert){
+   if(wert == 'guiList'){
       var listIndex = document.form1.guiList.selectedIndex;
       if(listIndex<0){
 		   alert("Please select a GUI.");
@@ -87,7 +87,7 @@
       }
       else{
          var gui_id=document.form1.guiList.options[listIndex].value;
-			document.form1.action='../php/mod_loadCatalog.php<?php echo SID;?>';
+			document.form1.action='../php/mod_loadwms.php<?php echo SID;?>';
 			document.form1.submit();
       }
    }
@@ -189,7 +189,7 @@
 echo "<td>";
 if (count($ownguis)>0){
 	echo"GUI";
-	echo"<br>";
+	echo"<br/>";
 	 
 	$sql = "SELECT * FROM gui WHERE gui_id IN (";
 	$v = $ownguis;
@@ -218,16 +218,16 @@
 	
 	$arrayGUIs=$_SESSION["mb_user_guis"];
 	echo count($arrayGUIs);
-	echo "</select><br><br>";
+	echo "</select><br/><br/>";
 	
 	echo "</td>";
 	echo "<td>";
-	echo"WMS";
-	echo"<br>";
+	echo "Catalog";
+	echo "<br/>";
 	if(isset($guiList) && $guiList!=""){
-		$sql = "SELECT DISTINCT wms_id, wms.wms_title, gui_wms_position FROM gui_wms ";
-		$sql .= "JOIN 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";
+		$sql = "SELECT DISTINCT cat_id, cat_title FROM gui_cat ";
+		$sql .= "JOIN gui ON gui_cat.fkey_gui_id = gui.gui_id JOIN cat ON gui_cat.fkey_cat_id=cat.cat_id ";
+		$sql .= "AND gui_cat.fkey_gui_id=gui.gui_id WHERE gui.gui_name = $1";
 		$v = array($guiList);
 		$t = array('s');
 		$res = db_prep_query($sql,$v,$t);	
@@ -235,9 +235,9 @@
 		echo"<select size='8' name='wmsList' style='width:200px'>";
 	
 		while($row = db_fetch_array($res)){
-			if ($row["wms_title"]!=""){
-				echo "<option value='".$row["wms_id"]."' ";
-				echo ">".$row["wms_title"]."</option>";
+			if ($row["cat_title"]!=""){
+				echo "<option value='".$row["cat_id"]."' ";
+				echo ">".$row["cat_title"]."</option>";
 			}
 			$count++;
 		}
@@ -249,9 +249,9 @@
 	echo "</td>";
 	echo "<tr></table><br>";
 	
-	echo"<div class='text1'>Load WMS</div>";
-	$sql = "SELECT DISTINCT wms.wms_id,wms.wms_title,wms.wms_abstract,wms.wms_owner FROM gui_wms JOIN wms ON ";
-	$sql .= "wms.wms_id = gui_wms.fkey_wms_id WHERE gui_wms.fkey_gui_id IN(";
+	echo"<div class='text1'>Load Catalog</div>";
+	$sql = "SELECT DISTINCT cat.cat_id,cat.cat_title,cat.cat_abstract,cat.cat_owner FROM gui_cat JOIN cat ON ";
+	$sql .= "cat.cat_id = gui_cat.fkey_cat_id WHERE gui_cat.fkey_gui_id IN(";
 	$v = $arrayGUIs;
 	$t = array();
 	for ($i = 1; $i <= count($arrayGUIs); $i++){
@@ -261,19 +261,19 @@
 		$sql .= "$" . $i;
 		array_push($t, "s");
 	}
-	$sql .= ") ORDER BY wms.wms_title";
+	$sql .= ") ORDER BY cat.cat_title";
 	$res = db_prep_query($sql, $v, $t);
 	echo "<select class='select1' name='wmsID' size='20' onchange='submit()'>";
 	$cnt = 0;
 	while($row = db_fetch_array($res)){
-		echo "<option value='".$row["wms_id"]."' ";
-		if($row["wms_owner"] == $_SESSION["mb_user_id"]){
+		echo "<option value='".$row["cat_id"]."' ";
+		if($row["cat_owner"] == $_SESSION["mb_user_id"]){
 			echo "style='color:green' ";	
 		}
 		else{
 			echo "style='color:red' ";
 		}
-		if(isset($wmsID) && $wmsID == $row["wms_id"]){
+		if(isset($wmsID) && $wmsID == $row["cat_id"]){
 			echo "selected";
 			$wms_getcapabilities = $row["wms_getcapabilities"];
 		}



More information about the Mapbender_commits mailing list