[Mapbender-commits] r3394 - in trunk/mapbender/http: javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jan 2 10:13:16 EST 2009


Author: nimix
Date: 2009-01-02 10:13:16 -0500 (Fri, 02 Jan 2009)
New Revision: 3394

Modified:
   trunk/mapbender/http/javascripts/mapnf.php
   trunk/mapbender/http/javascripts/mod_zoomCoords.php
   trunk/mapbender/http/javascripts/ovnf.php
   trunk/mapbender/http/php/mod_zoomCoords.php
Log:
http://trac.osgeo.org/mapbender/ticket/360

Modified: trunk/mapbender/http/javascripts/mapnf.php
===================================================================
--- trunk/mapbender/http/javascripts/mapnf.php	2009-01-02 14:20:26 UTC (rev 3393)
+++ trunk/mapbender/http/javascripts/mapnf.php	2009-01-02 15:13:16 UTC (rev 3394)
@@ -1 +1,22 @@
+<?php 
+# $Id:$
+# http://www.mapbender.org/Mapbender_without_iframes
+# 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.
+
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+?>
 mb_registerMapObj('', 'mapframe1', null,500, 500);
\ No newline at end of file

Modified: trunk/mapbender/http/javascripts/mod_zoomCoords.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_zoomCoords.php	2009-01-02 14:20:26 UTC (rev 3393)
+++ trunk/mapbender/http/javascripts/mod_zoomCoords.php	2009-01-02 15:13:16 UTC (rev 3394)
@@ -1,133 +1,107 @@
 <?php
 #$Id$
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_zoomCoords.php,v 1.10 2006/03/09 08:57:13 uli_rothstein Exp $
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+# http://www.mapbender.org/Mapbender_without_iframes
+# 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.
 
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+include(dirname(__FILE__)."/../include/dyn_js.php");
 ?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta name="author-mail" content="info at ccgis.de">
-<meta name="author" content="U. Rothstein">
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>Zoom to Coordinate</title>
-<style type="text/css">
-	    <!--
+try{
+	if (zoomCoords_permanentHighlight){}
+}
+catch(e){
+	zoomCoords_permanentHighlight = 'false';
+}
 
-	    body{
-	    	font-family : Arial, Helvetica, sans-serif;
-	    	font-size: 11px;
-	    }
-	    .labelx{
-	    	position: absolute;
-	    	left: 5px;
-	    	top:5px;
-	    	color: Gray;
-	    }
-	    .labely{
-	    	position: absolute;
-	    	left: 80px;
-	    	top:5px;
-	    	color: Gray;
-	    }
-	    .textx{
-	    	position: absolute;
-	    	left:5px;
-	    	top:20px;
-	    	color: Gray;
-	    	width:65px;
-         border: solid thin;
-         height:20px;
-	    }
-	    .texty{
-	    	position: absolute;
-	    	left:80px;
-	    	top:20px;
-         color: Gray;
-	    	width:65px;
-         border: solid thin;
-         height:20px;
-	    }
-       .send{
-  	    	position: absolute;
-	    	left:150px;
-	    	top:20px;
-         color: Gray;
-         border: solid thin;
-         height:20px;
-       }
-	    -->
-</style>
-<?php
-echo '<script type="text/javascript">';
-echo "var mod_zoomCoords_target = '".$e_target[0]."';";
-echo "var target = mod_zoomCoords_target.split(',')";
-echo "</script>";
-?>
-<script type="text/javascript">
-<!--
+var mod_zoomCoords_target = '<?php echo $e_target[0];?>';
+mod_zoomCoords_target = mod_zoomCoords_target.split(',');
+
 function zoomCoordinate(x,y){
    x=x.replace(",",".");
    y=y.replace(",",".");
    
-   document.form1.X.value=x;
-   document.form1.Y.value=y;
-   
+   document.zoomCoordsForm.X.value=x;
+   document.zoomCoordsForm.Y.value=y;
+	  
    if (isNaN(x)==true || isNaN(y)==true){
-       alert ("Bitte geben Sie eine Zahl ein.");
+       alert ("<?php echo _mb("Please type a number.");?>");
    }else{
-      parent.zoom(target[0],true, 1.0,x,y);
+   
+	   if(zoomCoords_permanentHighlight =='true'){
+		   setPermanentMarker(x,y);
+	   }
+  		hideHighlight()
+      	zoom(mod_zoomCoords_target[0],true, 1.0,x,y);
    }
 }
 
 function highlight(x, y){
-   
-   x=x.replace(",",".");
-   y=y.replace(",",".");
-   
-   document.form1.X.value=x;
-   document.form1.Y.value=y;
-  
-   
-   if (isNaN(x)==true || isNaN(y)==true){
-     
-   }
-   else{
-      parent.mb_showHighlight(target[0],x,y);
-      parent.mb_showHighlight(target[1],x,y);
-   }
+	if(x!='' && y!=''){   
+	   x=x.replace(",",".");
+	   y=y.replace(",",".");
+	   
+	   document.zoomCoordsForm.X.value=x;
+	   document.zoomCoordsForm.Y.value=y;
+	  
+	   
+	   if (isNaN(x)==true || isNaN(y)==true){
+	     
+	   }
+	   else{
+			for(var i=0;i<mod_zoomCoords_target.length;i++){
+				mb_showHighlight(mod_zoomCoords_target[i],x,y);
+			}
+	   }
+	}
 }
 
 
 function hideHighlight(){
-   parent.mb_hideHighlight(target[0]);
-   parent.mb_hideHighlight(target[1]);
+	for(var i=0;i<mod_zoomCoords_target.length;i++){
+		mb_hideHighlight(mod_zoomCoords_target[i]);
+	}
 }
 
-// -->
-</script>
-</head>
-<body bgcolor='#ffffff' onload=''>
+function setPermanentMarker(x,y){
+ 	mod_permanentHighlight_x = parseFloat(x);
+   	mod_permanentHighlight_y = parseFloat(y);
+   	mod_permanentHighlight_text = x + ' / '+ y;
+  
+   	mod_permanentHighlight_init();
+}
 
-<?php
-echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+parent.eventInitMap.register(function zoomCoorsInit(){
+	var el = document.getElementById("zoomCoords");
+	if(el){
+		el.innerHTML="<?php
+echo "<form style='font-family : Arial, Helvetica, sans-serif;font-size: 11px;' name='zoomCoordsForm' action='" . $PHP_SELF . "?".SID."' method='post'>";
 #coordinates
    
    # Deutsche Version
 
    # English Version
-      echo "<span class='labelx'>Longitude:</span>";
-      echo "<span class='labely'>Latitude:</span>";
-      echo "<input class='textx' type='text' name='X'>";
-      echo "<input class='texty' type='text' name='Y'>";
-      echo "<input class='send' type='button' value='ok' onclick='zoomCoordinate(document.form1.X.value, document.form1.Y.value); highlight(document.form1.X.value, document.form1.Y.value)' onmouseover='highlight(document.form1.X.value, document.form1.Y.value)' onmouseout='hideHighlight(document.form1.X.value, document.form1.Y.value)' >";
+      echo "<span style='position: absolute;left: 5px;top:5px;color: Gray;'>"._mb("Longitude").":</span>";
+      echo "<span style='position: absolute;left: 80px;top:5px;color: Gray;'>"._mb("Latitude").":</span>";
+      echo "<input style='position: absolute;left:5px;top:20px;color: Gray;width:65px;border: solid thin;height:20px;' type='text' name='X'>";
+      echo "<input style='position: absolute;left:80px;top:20px;color: Gray;width:65px;border: solid thin;height:20px;'class='texty' type='text' name='Y'>";
+      echo "<input style='position: absolute;left:150px;top:20px;color: Gray;border: solid thin;height:20px;' type='button' value='"._mb("ok")."' onclick='zoomCoordinate(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value); highlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' onmouseover='highlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' onmouseout='hideHighlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' >";
 
-?>
-</form>
-</body>
-</html>
+echo "</form>";
+?>";
+	}
+}
+

Modified: trunk/mapbender/http/javascripts/ovnf.php
===================================================================
--- trunk/mapbender/http/javascripts/ovnf.php	2009-01-02 14:20:26 UTC (rev 3393)
+++ trunk/mapbender/http/javascripts/ovnf.php	2009-01-02 15:13:16 UTC (rev 3394)
@@ -1,5 +1,26 @@
+<?php 
+# $Id:$
+# http://www.mapbender.org/Mapbender_without_iframes
+# 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.
+
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+include '../include/dyn_js.php';
+?>
 var mod_overview_target = "<?php echo $e_target[0]; ?>";
-<?php include '../include/dyn_js.php';?>
 if (typeof(overview_wms) === 'undefined')overview_wms = 0;
 overview_wms = parseInt(overview_wms);
 

Modified: trunk/mapbender/http/php/mod_zoomCoords.php
===================================================================
--- trunk/mapbender/http/php/mod_zoomCoords.php	2009-01-02 14:20:26 UTC (rev 3393)
+++ trunk/mapbender/http/php/mod_zoomCoords.php	2009-01-02 15:13:16 UTC (rev 3394)
@@ -1,6 +1,6 @@
 <?php
-# $Id$
-# http://www.mapbender.org/index.php/Administration
+#$Id$
+# http://www.mapbender.org/Mapbender_without_iframes
 # Copyright (C) 2002 CCGIS 
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,139 +17,91 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-import_request_variables("PG");
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+include(dirname(__FILE__)."/../include/dyn_js.php");
 ?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>Zoom to Coordinate</title>
-<?php
-
-include '../include/dyn_css.php';
-?>
-<style type="text/css">
-	    <!--
-	    body{
-	    	font-family : Arial, Helvetica, sans-serif;
-	    	font-size: 11px;
-	    }
-	    .labelx{
-	    	position: absolute;
-	    	left: 5px;
-	    	top:5px;
-	    	color: Gray;
-	    }
-	    .labely{
-	    	position: absolute;
-	    	left: 90px;
-	    	top:5px;
-	    	color: Gray;
-	    }
-	    .textx{
-	    	position: absolute;
-	    	left:5px;
-	    	top:20px;
-	    	color: Gray;
-	    	width:70px;
-         border: solid thin;
-         height:20px;
-	    }
-	    .texty{
-	    	position: absolute;
-	    	left:90px;
-	    	top:20px;
-         color: Gray;
-	    	width:70px;
-         border: solid thin;
-         height:20px;
-	    }
-       .send{
-  	    	position: absolute;
-	    	left:177px;
-	    	top:20px;
-         color: Gray;
-         border: solid thin;
-         height:20px;
-         width:30px;
-       }
-	    -->
-</style>
-<?php
-
-$sql = "SELECT e_target FROM gui_element WHERE e_id = 'zoomCoords' AND fkey_gui_id = $1 ";
-$v = array($_SESSION["mb_user_gui"]);
-$t = array('s');
-$res = db_prep_query($sql,$v,$t);
-$cnt = 0;
-while($row = db_fetch_array($res)){
-	$e_target = $row["e_target"];
-	$cnt++;
+try{
+	if (zoomCoords_permanentHighlight){}
 }
+catch(e){
+	zoomCoords_permanentHighlight = 'false';
+}
 
-echo '<script type="text/javascript">';
-if($cnt > 1){ echo "alert('zoomCoords: ID not unique!');";}
+var mod_zoomCoords_target = '<?php echo $e_target[0];?>';
+mod_zoomCoords_target = mod_zoomCoords_target.split(',');
 
-echo "var mod_zoomCoords_target = '".$e_target."';";
-echo "var target = mod_zoomCoords_target.split(',')";
-echo "</script>";
-?>
-<script type="text/javascript">
-<!--
-function zoomCoordinate(){
-   var coordx = document.form1.X.value; 
-   var coordy = document.form1.Y.value;
-   coordx = coordx.replace(",",".");
-   coordy = coordy.replace(",",".");
-   var valid = true;
-   setPermanentMarker(coordx,coordy);
-   parent.mb_hideHighlight(target[0]);
-   parent.mb_hideHighlight(target[1]);
-   parent.zoom(target[0],true, 1.0,coordx,coordy);
+function zoomCoordinate(x,y){
+   x=x.replace(",",".");
+   y=y.replace(",",".");
+   
+   document.zoomCoordsForm.X.value=x;
+   document.zoomCoordsForm.Y.value=y;
+	  
+   if (isNaN(x)==true || isNaN(y)==true){
+       alert ("<?php echo _mb("Please type a number.");?>");
+   }else{
+   
+	   if(zoomCoords_permanentHighlight =='true'){
+		   setPermanentMarker(x,y);
+	   }
+  		hideHighlight()
+      	zoom(mod_zoomCoords_target[0],true, 1.0,x,y);
+   }
 }
 
 function highlight(x, y){
-	x=x.replace(",",".");
-	y=y.replace(",",".");
-	document.form1.X.value=x;
-	document.form1.Y.value=y;
-	if (isNaN(x)==true || isNaN(y)==true){
+	if(x!='' && y!=''){   
+	   x=x.replace(",",".");
+	   y=y.replace(",",".");
+	   
+	   document.zoomCoordsForm.X.value=x;
+	   document.zoomCoordsForm.Y.value=y;
+	  
+	   
+	   if (isNaN(x)==true || isNaN(y)==true){
+	     
+	   }
+	   else{
+			for(var i=0;i<mod_zoomCoords_target.length;i++){
+				mb_showHighlight(mod_zoomCoords_target[i],x,y);
+			}
+	   }
 	}
-	else{
-		parent.mb_showHighlight(target[0],x,y);
-		parent.mb_showHighlight(target[1],x,y);
-	}
 }
 
+
 function hideHighlight(){
-	parent.mb_hideHighlight(target[0]);
-	parent.mb_hideHighlight(target[1]);
+	for(var i=0;i<mod_zoomCoords_target.length;i++){
+		mb_hideHighlight(mod_zoomCoords_target[i]);
+	}
 }
 
 function setPermanentMarker(x,y){
-	parent.mod_permanentHighlight_x = parseFloat(x);
-	parent.mod_permanentHighlight_y = parseFloat(y);
+ 	mod_permanentHighlight_x = parseFloat(x);
+   	mod_permanentHighlight_y = parseFloat(y);
+   	mod_permanentHighlight_text = x + ' / '+ y;
+  
+   	mod_permanentHighlight_init();
 }
-// -->
-</script>
-</head>
-<body bgcolor='#ffffff' onload=''>
 
-<?php
-# needs intl'!
-	echo "<form name='form1' action='" . $self ."' method='post'>";
-	echo "<span class='labelx'>L&auml;nge:</span>";
-	echo "<span class='labely'>Breite:</span>";
-	echo "<input class='textx' type='text' name='X'>";
-	echo "<input class='texty' type='text' name='Y'>";
-	echo "<input class='send' type='button' value='ok' onclick='zoomCoordinate();' onmouseover='highlight(document.form1.X.value, document.form1.Y.value)' onmouseout='hideHighlight(document.form1.X.value, document.form1.Y.value)' >";
-?>
-</form>
-</body>
-</html>
+parent.eventInitMap.register(function zoomCoorsInit(){
+	var el = document.getElementById("zoomCoords");
+	if(el){
+		el.innerHTML="<?php
+echo "<form style='font-family : Arial, Helvetica, sans-serif;font-size: 11px;' name='zoomCoordsForm' action='" . $PHP_SELF . "?".SID."' method='post'>";
+#coordinates
+   
+   # Deutsche Version
+
+   # English Version
+      echo "<span style='position: absolute;left: 5px;top:5px;color: Gray;'>"._mb("Longitude").":</span>";
+      echo "<span style='position: absolute;left: 80px;top:5px;color: Gray;'>"._mb("Latitude").":</span>";
+      echo "<input style='position: absolute;left:5px;top:20px;color: Gray;width:65px;border: solid thin;height:20px;' type='text' name='X'>";
+      echo "<input style='position: absolute;left:80px;top:20px;color: Gray;width:65px;border: solid thin;height:20px;'class='texty' type='text' name='Y'>";
+      echo "<input style='position: absolute;left:150px;top:20px;color: Gray;border: solid thin;height:20px;' type='button' value='"._mb("ok")."' onclick='zoomCoordinate(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value); highlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' onmouseover='highlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' onmouseout='hideHighlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' >";
+
+echo "</form>";
+?>";
+	}
+}
+



More information about the Mapbender_commits mailing list