[Mapbender-commits] r3421 - branches/beck_dev/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jan 12 02:21:08 EST 2009


Author: beck
Date: 2009-01-12 02:21:06 -0500 (Mon, 12 Jan 2009)
New Revision: 3421

Modified:
   branches/beck_dev/http/php/mb_listGUIs.php
Log:


Modified: branches/beck_dev/http/php/mb_listGUIs.php
===================================================================
--- branches/beck_dev/http/php/mb_listGUIs.php	2009-01-08 15:18:07 UTC (rev 3420)
+++ branches/beck_dev/http/php/mb_listGUIs.php	2009-01-12 07:21:06 UTC (rev 3421)
@@ -1,5 +1,5 @@
 <?php
-# $Id: mb_listGUIs.php 2602 2008-07-08 12:33:55Z christoph $
+# $Id: mb_listGUIs.php 3411 2009-01-07 13:08:15Z astrid_emde $
 # http://www.mapbender.org/index.php/mb_listGUIs.php
 # Copyright (C) 2002 CCGIS 
 #
@@ -20,42 +20,59 @@
 # list of user-guis after login:
 function mb_listGUIs($arrayGUIs){
 	echo "<form name='listGUIsForm' target='_blank'>";
-	echo "<table width = '50%' ><tr><td>";
-	echo "<h2><font align='left' color='#000000'>Ma</font><font color='#0000CE'>p</font><font color='#C00000'>b</font><font color='#000000'>ender GUI list </font> </h2>";
-	echo "</td><td>";
+	echo "<table width = '50%' ><tr><td id='head_border'>";
+	echo "<h2><font align='left' color='#000000'>xxxxx Categories Ma</font><font color='#0000CE'>p</font><font color='#C00000'>b</font><font color='#000000'>ender GUI list </font> </h2>";
+	echo "</td><td id='head_border'>";
 	
 	if (count($arrayGUIs)>0){
 		$v = array();
 		$t = array();
-		$sql_list_guis = "SELECT DISTINCT gui_id,gui_name,gui_description FROM gui WHERE gui_id IN (";
+
+		$sql_list_guis = "SELECT DISTINCT gui_id,gui_name,gui_description, ggc.*,gc.category_name,gc.category_description FROM gui g ";
+		$sql_list_guis .= "Left JOIN gui_gui_category ggc ON ";
+		$sql_list_guis .= "g.gui_id = ggc.fkey_gui_id ";
+		$sql_list_guis .= "Left Join gui_category gc On (ggc.fkey_gui_category_id = gc.category_id) ";
+		$sql_list_guis .= "WHERE gui_id IN (";
+
 		for($i=0; $i<count($arrayGUIs); $i++){
 			if($i>0){$sql_list_guis .= ",";}
 			$sql_list_guis .= "$".($i+1);
 			array_push($v,$arrayGUIs[$i]);
 			array_push($t,'s');
 		}
-		$sql_list_guis .= ") ORDER BY gui_name";
+
+		$sql_list_guis .= ") ORDER BY gc.category_name, gui_name";
+		
 		$res_list_guis = db_prep_query($sql_list_guis,$v,$t);
-		if ($_SESSION["mb_user_name"] != "test" && $_SESSION["mb_user_name"] != "demo" && $_SESSION["mb_user_name"] != "guest") {
-			echo "<a href=\"../php/mod_editSelf.php?".SID."\" class='list_guis' target=_blank>Change personal settings</a>";
-		}
-		echo "</td><td align = 'right'>";
+
 		echo "<a href=\"../php/mod_logout.php?".SID."\"><img src =\"../img/button_gray/logout_off.png\" border='0' onmouseover='this.src=\"../img/button_gray/logout_over.png\"' onmouseout='this.src=\"../img/button_gray/logout_off.png\"' title=\"Logout\"></a>";
 		echo "</td></tr></table>";
-		echo "<table width='50%' class='list_guis' border='1' cellpadding='3' rules='rows'><tr style='background-color:#F0F0F0;' width='80px'><td ><b>GUI name</b></td><td><b>GUI description</b></td></tr>";
+		
+		
+#echo "<table width='50%' class='list_guis' border='1' cellpadding='3' rules='rows'><tr='background-color:#F0F0F0;' width='80px'><td ><b>GUI name</b></td><td><b>GUI description</b></td></tr>";
 		$cnt_list_guis = 0;
+		$tempCategory = '';
+		$table_rows = array();
+
 		while($row = db_fetch_array($res_list_guis)){
-			echo "<tr ";
-			if(($cnt_list_guis % 2) == 0){ echo " style='background-color:#ffffff;' ";}
-			echo ">";
-			echo "<td><b><a href='index.php?".strip_tags (SID)."&gui_id=".$row["gui_id"]."'>".$row["gui_name"]."</a><b></td>";
-			echo "<td>".$row["gui_description"]."</td>";
+				if($tempCategory != $row["category_name"]){
+				$tempCategory = $row["category_name"];
+				if ($cnt_list_guis != 0){echo "</table>";}
+					echo "<p>".$tempCategory;
+					echo "<br><label><em>".$row["category_description"]."</em></label></p>";
+					echo "<table class='list_guis' cellpadding='3'>"; # rules='rows'
+					echo "<tr><th class='th_gui' >GUI name</th><th class='th_gui_description'>GUI description</th></tr>";
+				}
+			
+			echo "<tr>";
+			echo "<td class='td_gui' ><b><a href='index.php?".strip_tags (SID)."&gui_id=".$row["gui_id"]."'>".$row["gui_name"]."</a><b></td>";
+			echo "<td class='td_gui_description'><a href='index.php?".strip_tags (SID)."&gui_id=".$row["gui_id"]."'>".$row["gui_description"]."</a></td>";
 			echo "</tr>";
+			array_push($table_rows,"table_row_".$cnt_list_guis);
 			$cnt_list_guis++;
 		}
 	}
 	else{
-		echo "<a href=\"../php/mod_editSelf.php?".SID."\" class='list_guis' target=_blank>Change personal settings</a>";
 		echo "</td><td align = 'right'>";
 		echo "<a href=\"../php/mod_logout.php?".SID."\"><img src =\"../img/button_gray/logout_off.png\" border='0' onmouseover='this.src=\"../img/button_gray/logout_over.png\"' onmouseout='this.src=\"../img/button_gray/logout_off.png\"' title=\"Logout\"></a>";
 		echo "</td><tr>" ;
@@ -65,3 +82,26 @@
 	echo "</form>";
 }
 ?>
+
+<script type="text/javascript">
+function toggleDescription() {
+	var thsDescription = document.getElementsByTagName('th');
+	var tdsDescription = document.getElementsByTagName('td');
+	
+	for(var i = 0; i < thsDescription.length; i++) {
+		if(thsDescription[i].className == 'th_gui_description') {
+			var visibility = thsDescription[i].style.visibility;
+			thsDescription[i].style.visibility = (visibility == 'hidden') ? 'visible' : 'hidden';
+		}
+	}
+	
+	for(var i = 0; i < tdsDescription.length; i++) {
+		if(tdsDescription[i].className == 'td_gui_description') {
+			var visibility = tdsDescription[i].style.visibility;
+			tdsDescription[i].style.visibility = (visibility == 'hidden') ? 'visible' : 'hidden';
+		}
+	}
+}
+</script>
+
+<p><a href="#" onclick="toggleDescription();">Beschreibungen ein-/ausblenden</a></p>
\ No newline at end of file



More information about the Mapbender_commits mailing list