svn commit: r270 - trunk/mapbender/http/javascripts/mod_sandclock2.php

vera_schulze at osgeo.org vera_schulze at osgeo.org
Fri May 12 08:28:29 EDT 2006


Author: vera_schulze
Date: 2006-05-12 12:28:29+0000
New Revision: 270

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

Log:
Code cleaning ready

Modified: trunk/mapbender/http/javascripts/mod_sandclock2.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_sandclock2.php?view=diff&rev=270&p1=trunk/mapbender/http/javascripts/mod_sandclock2.php&p2=trunk/mapbender/http/javascripts/mod_sandclock2.php&r1=269&r2=270
==============================================================================
--- trunk/mapbender/http/javascripts/mod_sandclock2.php	(original)
+++ trunk/mapbender/http/javascripts/mod_sandclock2.php	2006-05-12 12:28:29+0000
@@ -1,19 +1,39 @@
 <?php
-#$Id: mod_sandclock2.php,v 1.6 2005/09/13 18:16:42 bjoern_heuser Exp $
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_sandclock2.php,v 1.6 2005/09/13 18:16:42 bjoern_heuser Exp $
+# $Id$
+# http://www.mapbender.org/index.php/mod_sandclock2.php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# 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.
+
 
 $gui_id = $_REQUEST["gui_id"];
 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 = 'sandclock2' AND fkey_gui_id = '".$gui_id."'";
-$res = db_query($sql);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'sandclock2' AND fkey_gui_id = $1";
+$v = array($gui_id);
+$t = array('s');
+$res = db_query($sql, $v, $t);
 $cnt = 0;
 while($row = db_fetch_array($res)){ 
-   $e_target = db_result($res,0,"e_target");
-   $cnt++;
+	$e_target = db_result($res,0,"e_target");
+	$cnt++;
+}
+if($cnt > 1){
+	echo "alert('sandclock2: ID not unique!');";
 }
-if($cnt > 1){ echo "alert('sandclock2: ID not unique!');";}
 echo "var mod_sandclock_target = '".$e_target."';";
 ?>
 var mod_sandclock_maxWait = 1000 * 60;
@@ -26,45 +46,43 @@
 
 
 function mod_sandclock(start,myMapId){
-   var ind = getMapObjIndexByName(mod_sandclock_target);
-   if(start){  
-      mod_sandclock_count = mod_sandclock_maxWait; 
-      var temp = "<img src='"+mod_sandclock_img.src+"'>";
-      writeTag(mod_sandclock_target, "sandclock", temp);
-            
-      mb_arrangeElement(mod_sandclock_target, "sandclock", (mb_mapObj[ind].width/2 - 16), (mb_mapObj[ind].height/2 - 16));
-      
-      var dim = mod_sandclock_getWSize();
-      document.getElementById("sandclock2").style.width = dim[0];
-      document.getElementById("sandclock2").style.height = dim[1];
-   }
-
-   // check images:
-   aktiv = setTimeout("mod_sandclock('','"+myMapId+"')",100);
-   mod_sandclock_count -= 1000;
-
-   var allMaps = window.frames[mod_sandclock_target].document.getElementsByName("mapimage");
-   var cnt = 1;
-   for(var i=0; i<allMaps.length; i++){
-      if(allMaps[i].complete == true){
-         cnt++;
-         
-      }         
-   }   
-   if((mod_sandclock_count <= 0 || cnt >= allMaps.length) && mod_sandclock_count < (mod_sandclock_maxWait - mod_sandclock_minWait)){
-      clearTimeout(aktiv);
-      writeTag(mod_sandclock_target, "sandclock", "");
-      document.getElementById("sandclock2").style.width = 1;
-      document.getElementById("sandclock2").style.height = 1;      
-   }
-    
+	var ind = getMapObjIndexByName(mod_sandclock_target);
+	if(start){  
+		mod_sandclock_count = mod_sandclock_maxWait; 
+		var temp = "<img src='"+mod_sandclock_img.src+"'>";
+		writeTag(mod_sandclock_target, "sandclock", temp);
+
+		mb_arrangeElement(mod_sandclock_target, "sandclock", (mb_mapObj[ind].width/2 - 16), (mb_mapObj[ind].height/2 - 16));
+
+		var dim = mod_sandclock_getWSize();
+		document.getElementById("sandclock2").style.width = dim[0];
+		document.getElementById("sandclock2").style.height = dim[1];
+	}
+
+	// check images:
+	aktiv = setTimeout("mod_sandclock('','"+myMapId+"')",100);
+	mod_sandclock_count -= 1000;
+
+	var allMaps = window.frames[mod_sandclock_target].document.getElementsByName("mapimage");
+	var cnt = 1;
+	for(var i=0; i<allMaps.length; i++){
+		if(allMaps[i].complete == true){
+			cnt++;
+		}         
+	}   
+	if((mod_sandclock_count <= 0 || cnt >= allMaps.length) && mod_sandclock_count < (mod_sandclock_maxWait - mod_sandclock_minWait)){
+		clearTimeout(aktiv);
+		writeTag(mod_sandclock_target, "sandclock", "");
+		document.getElementById("sandclock2").style.width = 1;
+		document.getElementById("sandclock2").style.height = 1;      
+	}
 }
 function mod_sandclock_getWSize(){
-   if(ie){
-      var dim = new Array(window.document.body.offsetWidth,  window.document.body.offsetHeight);
-   }
-   else{
-      var dim = new Array(window.innerWidth, window.innerHeight);
-   }
-   return dim;
-}
+	if(ie){
+		var dim = new Array(window.document.body.offsetWidth,  window.document.body.offsetHeight);
+	}
+	else{
+		var dim = new Array(window.innerWidth, window.innerHeight);
+	}
+	return dim;
+}
\ No newline at end of file




More information about the Mapbender_commits mailing list