[Mapbender-commits] r3675 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Mar 12 08:52:41 EDT 2009


Author: astrid_emde
Date: 2009-03-12 08:52:41 -0400 (Thu, 12 Mar 2009)
New Revision: 3675

Modified:
   trunk/mapbender/http/php/mb_listGUIs.php
Log:
back to simple status of css - LArs will have a look

Modified: trunk/mapbender/http/php/mb_listGUIs.php
===================================================================
--- trunk/mapbender/http/php/mb_listGUIs.php	2009-03-12 12:51:53 UTC (rev 3674)
+++ trunk/mapbender/http/php/mb_listGUIs.php	2009-03-12 12:52:41 UTC (rev 3675)
@@ -21,20 +21,20 @@
 	if(count($arrayGUIs) === 0) {
 		echo "<h1>Error</h1>";
 		echo "<p>There are no GUIs available for this user.</p>";
-		printf("<p><a href=\"../php/mod_logout.php?%s\"><img src=\"../img/button_gray/logout_off.png\" onmouseover=\"this.src='../img/button_gray/logout_over.png'\" onmouseout=\"this.src='../img/button_gray/logout_off.png'\" alt=\"Logout\" title=\"Logout\"></a></p>",SID);
+		printf("<p><a href=\"../php/mod_logout.php?%s\"><img src=\"../img/button_gray/logout_off.png\" onmouseover=\"this.src='../img/button_gray/logout_over.png'\" onmouseout=\"this.src='../img/button_gray/logout_off.png'\" title=\"Logout\"></a></p>",SID);
+		
 		return;
 	}
 	
 	$v = array();
 	$t = array();
 
-	$sql  = "SELECT DISTINCT gui_id,gui_name,gui_description, ggc.*,gc.category_name,gc.category_description, gc.category_id ";
+	$sql  = "SELECT DISTINCT gui_id,gui_name,gui_description, ggc.*,gc.category_name,gc.category_description ";
 	$sql .= "FROM gui g ";
 	$sql .= "LEFT JOIN gui_gui_category ggc ON g.gui_id = ggc.fkey_gui_id ";
 	$sql .= "LEFT JOIN gui_category gc ON (ggc.fkey_gui_category_id = gc.category_id) ";
 	$sql .= "WHERE gui_id IN (";
 
-
 	for($i = 0; $i < count($arrayGUIs); $i++) {
 		if($i > 0) {
 			$sql .= ",";
@@ -45,66 +45,41 @@
 		array_push($v,$arrayGUIs[$i]);
 		array_push($t,'s');
 	}
-
-	$sql .= ") ORDER BY gc.category_id, gui_name";
-
- 	$result = db_prep_query($sql,$v,$t);
 	
+	$sql .= ") ORDER BY gc.category_name, gui_name";
+		
+	$result = db_prep_query($sql,$v,$t);
+	
 	$category = NULL;
-
-	echo "<h1 class='listGuisHeader'>Available application(s)</h1>\n";
-	printf("<p class='logoutButton'><a href=\"../php/mod_logout.php?%s\"><img src=\"../img/button_gray/logout_off.png\" onmouseover=\"this.src='../img/button_gray/logout_over.png'\" onmouseout=\"this.src='../img/button_gray/logout_off.png'\" title=\"Logout\" alt=\"Logout\" /></a></p>\n",SID);
-
-	echo "<div id='menu'>\n";
-	echo "<ul class=\"gui_list\">\n";
-
-
-	$num =  pg_numrows($result);
- 
-	for ($j = 0; $j < $num; $j++) {
-		$row = pg_fetch_array ($result, $j);  	
-
-		if ($category !== $row["category_name"]) {
+echo "<h1><font align='left' color='#000000'>Ma</font><font color='#0000CE'>p</font><font color='#C00000'>b</font><font color='#000000'>ender </font> - "._mb('available Applications')."</h1>";
+	printf("<p><a href=\"../php/mod_logout.php?%s\"><img src=\"../img/button_gray/logout_off.png\" onmouseover=\"this.src='../img/button_gray/logout_over.png'\" onmouseout=\"this.src='../img/button_gray/logout_off.png'\" title=\"Logout\"></a></p>",SID);
+	
+	$total_guis = 0;
+	while($row = db_fetch_array($result)){
+		if($category !== $row["category_name"]) {
 			$category = $row["category_name"];
-        			
-			if (strlen($row["category_name"]) > 0) {		  
-  			
-				printf("\t<li class=\"gui_category\" id=\"%s\"><h2>%s</h2>",$row["category_name"],$row["category_name"]);			  
+			
+			echo "</ul>";
+			
+			if(strlen($row["category_name"]) > 0) {
+				printf("<h2 class=\"gui_category\">%s</h2>",$row["category_name"]);
+			}else{
+				printf("<h2 class=\"gui_category\">%s</h2>","Applcations");
 			}
-			else {
-				//$category="NULL";	  
-				printf("\t<li class=\"gui_category\" ><h2>Application(s) without category</h2>");			  
-			}
-        
 			if(strlen($row["category_description"]) > 0) {
-				printf("<label for=\"%s\" class=\"gui_category_description\">%s</label>\n",$row["category_name"],$row["category_description"]);
-				echo "\t\t<ul>\n";
+				printf("<p class=\"gui_category_description\"><em>%s</em></p>",$row["category_description"]);
+			}else{
+				printf("<p class=\"gui_category_description\"><em>%s</em></p>","Applications without category connection");
 			}
-			else {
-				echo "\n\t\t<ul>\n";		
-			} 
+			
+			echo "<ul class=\"gui_list\">";
 		}
-  		
-		$url = sprintf("index.php?%s&amp;gui_id=%s",strip_tags(SID),$row["gui_id"]);
 		
-		if (($j % 2) == 0) {
-			$class= "class='alternate' ";
-		}
-  		else {
-  			$class="class='normal'";
-		}
-		//printf("\t\t<li id=\"%s\" %s onclick=\"location.href='%s'\" ><a href=\"%s\">%s</a><label for=\"%s\">%s</label></li>\n",$row["gui_name"],$class,$url,$url,$row["gui_name"],$row["gui_name"],$row["gui_description"]);
-     
-		printf("\t\t<li id=\"%s\" %s onclick=\"location.href='%s'\" ><a href=\"%s\">%s</a> \n\t\t\t <ul><li>%s</li></ul></li>\n",$row["gui_name"],$class,$url,$url,$row["gui_name"],$row["gui_description"]);
-
-		//checks next category or last category
-		$nextrow = pg_fetch_array ($result, $j+1); 
-		if(($category !== $nextrow["category_name"]) ||($num==$j+1)) {
-			echo "\t\t</ul>\n";
-			echo "\t</li>\n"; 
-		}
+		$class = ($total_guis %2 === 0) ? " class=\"alternate\"" : NULL;
+		$url   = sprintf("index.php?%s&gui_id=%s",strip_tags(SID),$row["gui_id"]);
+		printf("<li%s onclick=\"location.href='%s'\"><strong><a href=\"%s\">%s</a></strong><br /><em>%s</em></li>",$class,$url,$url,$row["gui_name"],$row["gui_description"]);
+		
+		$total_guis++;
 	}
-	echo "</ul>\n";
-	echo "</div>\n";
 }
 ?>
\ No newline at end of file



More information about the Mapbender_commits mailing list