[Mapbender-commits] r5822 - branches/2.5/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Mar 22 09:15:33 EDT 2010


Author: christoph
Date: 2010-03-22 09:15:29 -0400 (Mon, 22 Mar 2010)
New Revision: 5822

Modified:
   branches/2.5/http/javascripts/mod_legend.php
Log:
set element ID hard wired, validation changed to "Permission"

Modified: branches/2.5/http/javascripts/mod_legend.php
===================================================================
--- branches/2.5/http/javascripts/mod_legend.php	2010-03-19 17:34:56 UTC (rev 5821)
+++ branches/2.5/http/javascripts/mod_legend.php	2010-03-22 13:15:29 UTC (rev 5822)
@@ -16,8 +16,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- 
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+
+$e_id = "legend";
+require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
@@ -33,9 +34,9 @@
 <?php
 include '../include/dyn_css.php';
 
-$sql = "SELECT DISTINCT e_target, e_width, e_height FROM gui_element WHERE e_id = '".$_REQUEST["e_id_css"]."' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
+$sql = "SELECT DISTINCT e_target, e_width, e_height FROM gui_element WHERE e_id = $1 AND fkey_gui_id = $2";
+$v = array($e_id, $gui_id);
+$t = array('s', 's');
 $res = db_prep_query($sql, $v, $t);
 $cnt = 0;
 while($row = db_fetch_array($res)){    
@@ -45,10 +46,10 @@
 if($cnt > 1){
 	echo "alert('legend: ID not unique!');";
 }
- 
-$sql2 = "SELECT e_left,e_top,e_width,e_height FROM gui_element WHERE e_id = '".$e_target."' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
+
+$sql2 = "SELECT e_left,e_top,e_width,e_height FROM gui_element WHERE e_id = $1 AND fkey_gui_id = $2";
+$v = array($e_target, $gui_id);
+$t = array('s','s');
 $res2 = db_prep_query($sql2, $v, $t);
 echo "<script type='text/javascript'>\n";
 echo "var mod_legend_target = '".$e_target."';\n";
@@ -131,11 +132,9 @@
 					else{
 						legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],layerStyle);
 					}
-					//console.log("layer_infos : %s",layerNames[j],"---",layerParent,"---",layerTitle,"---",layerStyle,"---",legendUrl);
 			         
 					if (legendUrl !== false){
 						
-//						console.log("legendUrl: %s, typeof(legendUrl): %s", legendUrl, typeof(legendUrl));
 //	 					if(layerParent == 0){
 		 					if(showlayertitle == 'true'){
 								str_tmp += "<div><span class='titles'>" + layerTitle+ "</span></div>";
@@ -162,7 +161,6 @@
 				str_tmp ='';
 			}		
 		}
-		//console.log("ind =%s",ind,"str =",str);
 	    if(str != ""){
 			parent.writeTag("legend", "leg", str);
 		}



More information about the Mapbender_commits mailing list