svn commit: r282 - trunk/mapbender/http/javascripts/mod_setBackground.php

vera_schulze at osgeo.org vera_schulze at osgeo.org
Mon May 15 06:42:59 EDT 2006


Author: vera_schulze
Date: 2006-05-15 10:42:58+0000
New Revision: 282

Modified:
   trunk/mapbender/http/javascripts/mod_setBackground.php   (contents, props changed)

Log:
Code cleaning ready

Modified: trunk/mapbender/http/javascripts/mod_setBackground.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_setBackground.php?view=diff&rev=282&p1=trunk/mapbender/http/javascripts/mod_setBackground.php&p2=trunk/mapbender/http/javascripts/mod_setBackground.php&r1=281&r2=282
==============================================================================
--- trunk/mapbender/http/javascripts/mod_setBackground.php	(original)
+++ trunk/mapbender/http/javascripts/mod_setBackground.php	2006-05-15 10:42:58+0000
@@ -1,6 +1,6 @@
 <?php
-#$Id: mod_setBackground.php,v 1.10 2005/09/13 18:16:42 bjoern_heuser Exp $
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_setBackground.php,v 1.10 2005/09/13 18:16:42 bjoern_heuser Exp $
+# $Id$
+# http://www.mapbender.org/index.php/mod_setBackground.php
 # Copyright (C) 2002 CCGIS 
 #
 # This program is free software; you can redistribute it and/or modify
@@ -21,14 +21,18 @@
 require_once("../../conf/mapbender.conf");
 $con = db_connect($DBSERVER,$OWNER,$PW);
 db_select_db(DB,$con);
-$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'setBackground' AND fkey_gui_id = '".$gui_id."'";
-$res = db_query($sql);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'setBackground' AND fkey_gui_id = $1";
+$v = array($gui_id);
+$t = array('s');
+$res = db_prep_query($sql, $v, $t);
 $cnt = 0;
 while($row = db_fetch_array($res)){ 
 	$e_target = $row["e_target"];
 	$cnt++;
 }
-if($cnt > 1){ echo "alert('setBackground: ID not unique!');";}
+if($cnt > 1){
+	echo "alert('setBackground: ID not unique!');";
+}
 
 if(isset($_REQUEST["wms"])){
 	$wms = $_REQUEST["wms"];
@@ -45,7 +49,7 @@
 	var ind = document.setBackground.mod_setBackground_list.options[0].value;
 	var cnt = 0;
 	var selInd;
-	
+
 	document.setBackground.mod_setBackground_list.options[document.setBackground.mod_setBackground_list.length - 1] = null;
 	for(var i=0; i<wms.length; i++){
 		if(wms[i].gui_wms_visible == '0'){
@@ -62,7 +66,7 @@
 			cnt++;
 		}
 	}
-	if (cnt >0) {
+	if (cnt >0){
 		wms[ind].gui_wms_visible = 2;
 		document.setBackground.mod_setBackground_list.selectedIndex = selInd;
 	}




More information about the Mapbender_commits mailing list