svn commit: r128 - trunk/mapbender/http/php

arnulf at osgeo.org arnulf at osgeo.org
Sun Apr 23 05:41:41 EDT 2006


Author: arnulf
Date: 2006-04-23 09:41:40+0000
New Revision: 128

Modified:
   trunk/mapbender/http/php/mb_getGUIs.php
   trunk/mapbender/http/php/mb_listGUIs.php   (contents, props changed)

Log:
cleaned, added SVN headers

Modified: trunk/mapbender/http/php/mb_getGUIs.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mb_getGUIs.php?view=diff&rev=128&p1=trunk/mapbender/http/php/mb_getGUIs.php&p2=trunk/mapbender/http/php/mb_getGUIs.php&r1=127&r2=128
==============================================================================
--- trunk/mapbender/http/php/mb_getGUIs.php	(original)
+++ trunk/mapbender/http/php/mb_getGUIs.php	2006-04-23 09:41:40+0000
@@ -1,7 +1,7 @@
 <?php
 # $Id$
 # Copyright (C) 2002 CCGIS 
-#
+# 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2, or (at your option)
@@ -18,49 +18,44 @@
 
 #returns an array of all guis of the user
 function mb_getGUIs($mb_user_id){
-   $arrayGuis = array();
-   
-   if(isset($mb_user_id)){
-	  $sql_groups = "SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = " . $mb_user_id;
-	  $res_groups = db_query($sql_groups);
-	  $cnt_groups = 0;
-	  while(db_fetch_row($res_groups)){
-	    $mb_user_groups[$cnt_groups] = db_result($res_groups,$cnt_groups,"fkey_mb_group_id");
-	    $cnt_groups++;
-	  }
-
-	  $count_g = 0;
-	  
-	  if($cnt_groups > 0){
-	  $sql_g = "SELECT DISTINCT gui.gui_id FROM gui JOIN gui_mb_group ";     
-	  $sql_g .= " ON gui.gui_id = gui_mb_group.fkey_gui_id WHERE( gui_mb_group.fkey_mb_group_id IN (";  
-	  for($i=0; $i<count($mb_user_groups);$i++){
-	       if($i > 0){$sql_g .= ",";}
-	       $sql_g .= $mb_user_groups[$i];
-	   }
-	   $sql_g .= "))";
-	   $res_g = db_query($sql_g);
-	 
-	   while(db_fetch_row($res_g)){
-	      $arrayGuis[$count_g] = db_result($res_g, $count_g, "gui_id");
-	      $count_g++;
-	   }
-	  }
-	  
-	  $sql_guis = "SELECT DISTINCT gui.gui_id FROM gui JOIN gui_mb_user ";  
-	  $sql_guis .= "ON gui.gui_id = gui_mb_user.fkey_gui_id WHERE (gui_mb_user.fkey_mb_user_id = ".$mb_user_id.") ";
-	  $sql_guis .= " AND gui.gui_public = 1";  
-	  
-	  $res_guis = db_query($sql_guis);
-	  $count_guis = 0;
-	  while(db_fetch_row($res_guis)){
-	   if( !in_array(db_result($res_guis,$count_guis,"gui_id"),$arrayGuis)){
-	      $arrayGuis[$count_g] = db_result($res_guis,$count_guis,"gui_id");
-	      $count_g++;
-	   }
-	   $count_guis++;
-	  }
-  }
-  return $arrayGuis;
-}       
+	$arrayGuis = array();
+	if(isset($mb_user_id)){
+		$sql_groups = "SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = " . $mb_user_id;
+		$res_groups = db_query($sql_groups);
+		$cnt_groups = 0;
+		while(db_fetch_row($res_groups)){
+			$mb_user_groups[$cnt_groups] = db_result($res_groups,$cnt_groups,"fkey_mb_group_id");
+			$cnt_groups++;
+		}
+		$count_g = 0;
+		if($cnt_groups > 0){
+			$sql_g = "SELECT DISTINCT gui.gui_id FROM gui JOIN gui_mb_group ";     
+			$sql_g .= " ON gui.gui_id = gui_mb_group.fkey_gui_id WHERE( gui_mb_group.fkey_mb_group_id IN (";  
+			for($i=0; $i<count($mb_user_groups);$i++){
+				if($i > 0){$sql_g .= ",";}
+				$sql_g .= $mb_user_groups[$i];
+			}
+			$sql_g .= "))";
+			$res_g = db_query($sql_g);
+			while(db_fetch_row($res_g)){
+				$arrayGuis[$count_g] = db_result($res_g, $count_g, "gui_id");
+				$count_g++;
+			}
+		}
+		$sql_guis = "SELECT DISTINCT gui.gui_id FROM gui JOIN gui_mb_user ";  
+		$sql_guis .= "ON gui.gui_id = gui_mb_user.fkey_gui_id WHERE (gui_mb_user.fkey_mb_user_id = ".$mb_user_id.") ";
+		$sql_guis .= " AND gui.gui_public = 1";  
+		
+		$res_guis = db_query($sql_guis);
+		$count_guis = 0;
+		while(db_fetch_row($res_guis)){
+			if( !in_array(db_result($res_guis,$count_guis,"gui_id"),$arrayGuis)){
+				$arrayGuis[$count_g] = db_result($res_guis,$count_guis,"gui_id");
+				$count_g++;
+			}
+			$count_guis++;
+		}
+	}
+	return $arrayGuis;
+}
 ?>

Modified: trunk/mapbender/http/php/mb_listGUIs.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mb_listGUIs.php?view=diff&rev=128&p1=trunk/mapbender/http/php/mb_listGUIs.php&p2=trunk/mapbender/http/php/mb_listGUIs.php&r1=127&r2=128
==============================================================================
--- trunk/mapbender/http/php/mb_listGUIs.php	(original)
+++ trunk/mapbender/http/php/mb_listGUIs.php	2006-04-23 09:41:40+0000
@@ -1,6 +1,5 @@
 <?php
-# $Id: mb_listGUIs.php,v 1.13 2005/11/18 14:23:58 astrid_emde Exp $
-# $Header: /cvsroot/mapbender/mapbender/http/php/mb_listGUIs.php,v 1.13 2005/11/18 14:23:58 astrid_emde Exp $
+# $Id$
 # Copyright (C) 2002 CCGIS 
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +16,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-
 # list of user-guis after login:
 function mb_listGUIs($arrayGUIs){
 	echo "<form name='listGUIsForm' target='_blank'>";
@@ -26,44 +24,37 @@
 	echo "</td><td>";
 	
 	if (count($arrayGUIs)>0){
-	   $sql_list_guis = "SELECT DISTINCT gui_id,gui_name,gui_description FROM gui WHERE gui_id IN (";
-	   for($i=0; $i<count($arrayGUIs); $i++){
-	      if($i>0){$sql_list_guis .= ",";}
-	      $sql_list_guis .= "'". $arrayGUIs[$i]."'";
-	   }
-	
-	   $sql_list_guis .= ") ORDER BY gui_name";
-	   $res_list_guis = db_query($sql_list_guis);
-
+		$sql_list_guis = "SELECT DISTINCT gui_id,gui_name,gui_description FROM gui WHERE gui_id IN (";
+		for($i=0; $i<count($arrayGUIs); $i++){
+			if($i>0){$sql_list_guis .= ",";}
+			$sql_list_guis .= "'". $arrayGUIs[$i]."'";
+		}
+		$sql_list_guis .= ") ORDER BY gui_name";
+		$res_list_guis = db_query($sql_list_guis);
 		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>";
-	   $cnt_list_guis = 0;
-	
-	   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>";
-	      echo "</tr>";
-	      $cnt_list_guis++;
-	   }   
-
-	}else{
+		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>";
+		$cnt_list_guis = 0;
+		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>";
+			echo "</tr>";
+			$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>" ;
-	   	echo "<td><br>There are no guis available for this user</td></tr>";
+		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>" ;
+		echo "<td><br>There are no guis available for this user</td></tr>";
 		echo "</table>";
-
 	}
-
 	echo "</form>";
-
 }
-
 ?>




More information about the Mapbender_commits mailing list