svn commit: r212 - trunk/mapbender/http/javascripts/mod_navFrame.php

vera_schulze at osgeo.org vera_schulze at osgeo.org
Tue May 9 09:49:31 EDT 2006


Author: vera_schulze
Date: 2006-05-09 13:49:30+0000
New Revision: 212

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

Log:
Code cleaning ready, 1 db_prep_query, 1 comment left

Modified: trunk/mapbender/http/javascripts/mod_navFrame.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_navFrame.php?view=diff&rev=212&p1=trunk/mapbender/http/javascripts/mod_navFrame.php&p2=trunk/mapbender/http/javascripts/mod_navFrame.php&r1=211&r2=212
==============================================================================
--- trunk/mapbender/http/javascripts/mod_navFrame.php	(original)
+++ trunk/mapbender/http/javascripts/mod_navFrame.php	2006-05-09 13:49:30+0000
@@ -1,6 +1,6 @@
 <?php
-#$Id: mod_navFrame.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_navFrame.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# $Id$
+# http://www.mapbender.org/index.php/mod_navFrame.php
 # Copyright (C) 2002 CCGIS 
 #
 # This program is free software; you can redistribute it and/or modify
@@ -22,12 +22,14 @@
 require_once("../../conf/mapbender.conf");
 $con = db_connect($DBSERVER,$OWNER,$PW);
 db_select_db(DB,$con);
-$sql = "SELECT e_target,e_src FROM gui_element WHERE e_id = 'navFrame' AND fkey_gui_id = '".$gui_id."'";
-$res = db_query($sql);
+$sql = "SELECT e_target,e_src FROM gui_element WHERE e_id = 'navFrame' 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++;
+	$e_target = $row["e_target"];
+	$cnt++;
 }
 echo "var mod_navFrame_target = '".$e_target."';";
 if($cnt > 1){ echo "alert('navFrame: ID not unique!');";}
@@ -35,34 +37,35 @@
 ?>
 var mod_navFrame_ext = 10;
 mb_registerSubFunctions("mod_navFrame_arrange()");
+
 function  mod_navFrame_arrange(){
-   var el = document.getElementById(mod_navFrame_target).style;
-   var ext = mod_navFrame_ext;
-   var myLeft = parseInt(el.left);
-   var myTop = parseInt(el.top);
-   var myWidth = parseInt(el.width);
-   var myHeight = parseInt(el.height);
-   //left,top,width,height
-   mod_navFrame_pos("mbN",(myLeft),(myTop - ext),(myWidth),(ext));
-   document.getElementById("arrow_n").style.left = myWidth/2 - document.getElementById("arrow_n").width/2;   
-   mod_navFrame_pos("mbNE",(myLeft + myWidth),(myTop - ext),(ext),(ext));
-   mod_navFrame_pos("mbE",(myLeft + myWidth),(myTop),(ext),(myHeight));
-   document.getElementById("arrow_e").style.top = myHeight/2 - document.getElementById("arrow_n").height/2;
-   mod_navFrame_pos("mbSE",(myLeft + myWidth),(myTop + myHeight),(ext),(ext));
-   mod_navFrame_pos("mbS",(myLeft),(myTop + myHeight),(myWidth),(ext));
-   document.getElementById("arrow_s").style.left = myWidth/2 - document.getElementById("arrow_s").width/2;
-   mod_navFrame_pos("mbSW",(myLeft - ext),(myTop + myHeight),(ext),(ext));
-   mod_navFrame_pos("mbW",(myLeft - ext),(myTop),(ext),(myHeight));
-   document.getElementById("arrow_w").style.top = myHeight/2 - document.getElementById("arrow_w").height/2;
-   mod_navFrame_pos("mbNW",(myLeft - ext),(myTop -ext),(ext),(ext));   
+	var el = document.getElementById(mod_navFrame_target).style;
+	var ext = mod_navFrame_ext;
+	var myLeft = parseInt(el.left);
+	var myTop = parseInt(el.top);
+	var myWidth = parseInt(el.width);
+	var myHeight = parseInt(el.height);
+	//left,top,width,height
+	mod_navFrame_pos("mbN",(myLeft),(myTop - ext),(myWidth),(ext));
+	document.getElementById("arrow_n").style.left = myWidth/2 - document.getElementById("arrow_n").width/2;   
+	mod_navFrame_pos("mbNE",(myLeft + myWidth),(myTop - ext),(ext),(ext));
+	mod_navFrame_pos("mbE",(myLeft + myWidth),(myTop),(ext),(myHeight));
+	document.getElementById("arrow_e").style.top = myHeight/2 - document.getElementById("arrow_n").height/2;
+	mod_navFrame_pos("mbSE",(myLeft + myWidth),(myTop + myHeight),(ext),(ext));
+	mod_navFrame_pos("mbS",(myLeft),(myTop + myHeight),(myWidth),(ext));
+	document.getElementById("arrow_s").style.left = myWidth/2 - document.getElementById("arrow_s").width/2;
+	mod_navFrame_pos("mbSW",(myLeft - ext),(myTop + myHeight),(ext),(ext));
+	mod_navFrame_pos("mbW",(myLeft - ext),(myTop),(ext),(myHeight));
+	document.getElementById("arrow_w").style.top = myHeight/2 - document.getElementById("arrow_w").height/2;
+	mod_navFrame_pos("mbNW",(myLeft - ext),(myTop -ext),(ext),(ext));   
 }
 function mod_navFrame(val){
- mb_panMap(mod_navFrame_target,val);  
+	mb_panMap(mod_navFrame_target,val);  
 }
 function mod_navFrame_pos(el,left,top,width,height){
 //alert(el + " , " +left + " , " +top + " , " +width + " , " +height)
-   document.getElementById(el).style.left = left;
-   document.getElementById(el).style.top = top;
-   document.getElementById(el).style.width = width;
-   document.getElementById(el).style.height = height;
+	document.getElementById(el).style.left = left;
+	document.getElementById(el).style.top = top;
+	document.getElementById(el).style.width = width;
+	document.getElementById(el).style.height = height;
 }




More information about the Mapbender_commits mailing list