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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Aug 9 04:51:40 EDT 2007


Author: christoph
Date: 2007-08-09 04:51:40 -0400 (Thu, 09 Aug 2007)
New Revision: 1641

Modified:
   trunk/mapbender/http/php/mod_addWMSfromfilteredList_server.php
Log:
i18n of addWMSFromFilteredList

Modified: trunk/mapbender/http/php/mod_addWMSfromfilteredList_server.php
===================================================================
--- trunk/mapbender/http/php/mod_addWMSfromfilteredList_server.php	2007-08-09 08:49:25 UTC (rev 1640)
+++ trunk/mapbender/http/php/mod_addWMSfromfilteredList_server.php	2007-08-09 08:51:40 UTC (rev 1641)
@@ -41,12 +41,12 @@
 if ($command == "getGroups") {
 	$resultObj["group"] = array();
 	
-	$sql = "SELECT mb_group_id, mb_group_name, mb_group_description ";
+	$sql = "SELECT mb_group_id, mb_group_name, gettext($1, mb_group_description) as mb_group_description ";
 	$sql .= "FROM mb_group, mb_user_mb_group ";
-	$sql .= "WHERE fkey_mb_group_id = mb_group_id AND fkey_mb_user_id = $1 ";
+	$sql .= "WHERE fkey_mb_group_id = mb_group_id AND fkey_mb_user_id = $2 ";
 	$sql .= "ORDER BY mb_group_name";	
-	$v = array($userId);
-	$t = array("i");
+	$v = array($_SESSION["mb_lang"], $userId);
+	$t = array("s", "i");
 	$res = db_prep_query($sql, $v, $t);
 			
 	while($row = db_fetch_array($res)){
@@ -58,15 +58,15 @@
 
 	$resultObj["gui"] = array();
 	
-	$sql = "SELECT * FROM gui WHERE gui_id IN (";
-	$v = array();
-	$t = array();
+	$sql = "SELECT gui_id, gui_name, gettext($1, gui_description) as gui_description FROM gui WHERE gui_id IN (";
+	$v = array($_SESSION["mb_lang"]);
+	$t = array("s");
 	
 	for ($i = 0; $i < count($guiIdArray); $i++) {
 		if ($i > 0) { 
 			$sql .= ",";
 		}
-		$sql .= "$" . strval($i + 1);
+		$sql .= "$" . strval($i + 2);
 		array_push($v, $guiIdArray[$i]);
 		array_push($t, "s");
 	}
@@ -82,17 +82,17 @@
 else if ($command == "getAllWMS") {
 	$resultObj["wms"] = array();
 					 
-	$sql = "SELECT DISTINCT wms.wms_id, wms.wms_title, wms.wms_abstract, wms.wms_getcapabilities, wms.wms_version ";
+	$sql = "SELECT DISTINCT wms.wms_id, wms.wms_title, gettext($1, wms.wms_abstract) as wms_abstract, wms.wms_getcapabilities, wms.wms_version ";
 	$sql .= "FROM wms, gui_wms ";
 	$sql .= "WHERE wms.wms_id = gui_wms.fkey_wms_id AND gui_wms.fkey_gui_id IN (";
-	$v = array();
-	$t = array();
+	$v = array($_SESSION["mb_lang"]);
+	$t = array("s");
 	
 	for ($i = 0; $i < count($guiIdArray); $i++) {
 		if ($i > 0) {
 			$sql .= ",";
 		}
-		$sql .= "$" . strval($i + 1);
+		$sql .= "$" . strval($i + 2);
 		array_push($v, $guiIdArray[$i]);
 		array_push($t, "s");
 	}
@@ -108,11 +108,11 @@
 else if ($command == "getWMSByGroup") {
 	$resultObj["wms"] = array();
 	
-	$sql = "SELECT DISTINCT wms_id, wms_title, wms_abstract, wms_getcapabilities, wms_version ";
+	$sql = "SELECT DISTINCT wms_id, wms_title, gettext($1, wms_abstract) as wms_abstract, wms_getcapabilities, wms_version ";
 	$sql .= "FROM wms, gui_wms, gui_mb_group ";
-	$sql .= "WHERE wms.wms_id = gui_wms.fkey_wms_id AND gui_wms.fkey_gui_id = gui_mb_group.fkey_gui_id AND gui_mb_group.fkey_mb_group_id = $1";
-	$v = array($groupId);
-	$t = array("i");
+	$sql .= "WHERE wms.wms_id = gui_wms.fkey_wms_id AND gui_wms.fkey_gui_id = gui_mb_group.fkey_gui_id AND gui_mb_group.fkey_mb_group_id = $2";
+	$v = array($_SESSION["mb_lang"], $groupId);
+	$t = array("s", "i");
 	$res = db_prep_query($sql, $v, $t);
 	
 	while ($row = db_fetch_array($res)) {
@@ -123,10 +123,10 @@
 else if ($command == "getWMSByGUI") {
 	$resultObj["wms"] = array();
 
-	$sql = "SELECT DISTINCT wms_id, wms_title, wms_abstract, wms_getcapabilities, wms_version ";
-	$sql .= "FROM wms, gui_wms WHERE wms.wms_id = gui_wms.fkey_wms_id AND fkey_gui_id = $1";
-	$v = array($guiId);
-	$t = array("s");
+	$sql = "SELECT DISTINCT wms_id, wms_title, gettext($1, wms_abstract) as wms_abstract, wms_getcapabilities, wms_version ";
+	$sql .= "FROM wms, gui_wms WHERE wms.wms_id = gui_wms.fkey_wms_id AND fkey_gui_id = $2";
+	$v = array($_SESSION["mb_lang"], $guiId);
+	$t = array("s", "s");
 	$res = db_prep_query($sql, $v, $t);
 	
 	while ($row = db_fetch_array($res)) {



More information about the Mapbender_commits mailing list