[Mapbender-commits] r1837 - branches/mapbender_sld/http/include

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Nov 23 08:45:36 EST 2007


Author: christoph
Date: 2007-11-23 08:45:36 -0500 (Fri, 23 Nov 2007)
New Revision: 1837

Modified:
   branches/mapbender_sld/http/include/dyn_css.php
   branches/mapbender_sld/http/include/dyn_js.php
   branches/mapbender_sld/http/include/dyn_php.php
Log:
updated includes

Modified: branches/mapbender_sld/http/include/dyn_css.php
===================================================================
--- branches/mapbender_sld/http/include/dyn_css.php	2007-11-23 13:45:03 UTC (rev 1836)
+++ branches/mapbender_sld/http/include/dyn_css.php	2007-11-23 13:45:36 UTC (rev 1837)
@@ -110,8 +110,8 @@
 	$i=-1;
 	while($row = db_fetch_array($res))
 	{
-		if (strpos($row["var_name"], "[")) {
-			$arrayname = substr($row["var_name"], 0, strpos($row["var_name"], "["));
+		if (mb_strpos($row["var_name"], "[")) {
+			$arrayname = mb_substr($row["var_name"], 0, mb_strpos($row["var_name"], "["));
 			if (!in_array($arrayname, $arrays)) {
 				$i++;
 				$arrays[$i] = $arrayname;

Modified: branches/mapbender_sld/http/include/dyn_js.php
===================================================================
--- branches/mapbender_sld/http/include/dyn_js.php	2007-11-23 13:45:03 UTC (rev 1836)
+++ branches/mapbender_sld/http/include/dyn_js.php	2007-11-23 13:45:36 UTC (rev 1837)
@@ -27,8 +27,8 @@
 	echo "\n";
 	while($row = db_fetch_array($res))
 	{
-		if (strpos($row["var_name"], "[")) {
-			$arrayname = substr($row["var_name"], 0, strpos($row["var_name"], "["));
+		if (mb_strpos($row["var_name"], "[")) {
+			$arrayname = mb_substr($row["var_name"], 0, mb_strpos($row["var_name"], "["));
 			
 			if (!in_array($arrayname, $arrays)) {
 				$i++;

Modified: branches/mapbender_sld/http/include/dyn_php.php
===================================================================
--- branches/mapbender_sld/http/include/dyn_php.php	2007-11-23 13:45:03 UTC (rev 1836)
+++ branches/mapbender_sld/http/include/dyn_php.php	2007-11-23 13:45:36 UTC (rev 1837)
@@ -19,16 +19,21 @@
 
 if(isset($gui_id))
 {
-	$sql = "SELECT * FROM gui_element_vars WHERE fkey_gui_id = $1 and var_type='php_var'";
-	$v = array($gui_id);
-	$t = array('s');
+	$sql = "SELECT * FROM gui_element_vars WHERE fkey_gui_id = $1 and fkey_e_id = $2 and var_type='php_var' ORDER BY var_name";
+	$v = array($gui_id, $e_id);
+	$t = array('s', 's');
    	$res = db_prep_query($sql,$v,$t);
 
 	echo "\n";
 	while($row = db_fetch_array($res))
 	{
-		$$row["var_name"] = stripslashes($row["var_value"]);
-		echo "\n";
+		if (preg_match("/\w+\[\d+\]/", $row["var_name"])) {
+			$varname = mb_substr($row["var_name"], 0, mb_strpos($row["var_name"], "["));	
+			array_push($$varname, stripslashes($row["var_value"]));
+		}
+		else {
+			$$row["var_name"] = stripslashes($row["var_value"]);
+		}
 	}
 }
 ?>
\ No newline at end of file



More information about the Mapbender_commits mailing list