svn commit: r804 - trunk/mapbender/http/php/mod_meetingPoint.php

astrid_emde at osgeo.org astrid_emde at osgeo.org
Fri Oct 27 03:32:04 EDT 2006


Author: astrid_emde
Date: 2006-10-27 07:32:04+0000
New Revision: 804

Modified:
   trunk/mapbender/http/php/mod_meetingPoint.php

Log:
new function meetingPoint to generate a meetingPoint and extent. An url will be generated an offered in a prompt-window or email

Modified: trunk/mapbender/http/php/mod_meetingPoint.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_meetingPoint.php?view=diff&rev=804&p1=trunk/mapbender/http/php/mod_meetingPoint.php&p2=trunk/mapbender/http/php/mod_meetingPoint.php&r1=803&r2=804
==============================================================================
--- trunk/mapbender/http/php/mod_meetingPoint.php	(original)
+++ trunk/mapbender/http/php/mod_meetingPoint.php	2006-10-27 07:32:04+0000
@@ -30,10 +30,7 @@
 $sql = "SELECT DISTINCT e_target FROM gui_element WHERE e_id = '".$_REQUEST["e_id_css"]."' AND fkey_gui_id = $1";
 $v = array($gui_id);
 $t = array('s');
-#echo $sql;
-#echo $gui_id;
 
-echo CHARSET;
 $res = db_prep_query($sql, $v, $t);
 $cnt = 0;
 while($row = db_fetch_array($res)){    
@@ -43,23 +40,96 @@
 if($cnt > 1){
 	echo "alert('legend: ID not unique!');";
 }
-#echo "var mod_meetingPoint_target = '".$e_target."';";
-#echo "t: ".$e_target;
+
+$e_id_css = 'meetingPoint';
+include('../include/dyn_js.php');
 ?>
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
 <html>
 <head>
 <title>meetingPoint</title>
-
 <link rel="stylesheet" type="text/css" href="../css/meetingPoint.css" />
+
 <script language='JavaScript'>
 <!--
 <?php
-echo "var used_charset = '".CHARSET ."';";
+echo "var mod_meetingPoint_target = '".$e_target."';";
+echo "var meetingPoint_write_to = 'meetingPoint';";
+?>
+var ie = document.all?1:0;
+var mod_meetingPoint_win = null;
+var mod_meetingPoint_elName = "meetingPoint";
+var mod_meetingPoint_frameName = "meetingPoint";
+<?php $e_src = '../img/button_digitize/point_off.png' ;?>
+var mod_meetingPoint_img_off = "<?php  echo $e_src;  ?>";
+var mod_meetingPoint_img_on = "<?php  echo preg_replace("/_off/","_on",$e_src);  ?>";
+var mod_meetingPoint_img_over = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
+
+
+var mod_meetingPoint_img_on = new Image(); mod_meetingPoint_img_on.src = "<?php  echo preg_replace("/_off/","_on",$e_src);  ?>";
+var mod_meetingPoint_img_off = new Image(); mod_meetingPoint_img_off.src = "<?php  echo $e_src;  ?>";
+var mod_meetingPoint_img_over = new Image(); mod_meetingPoint_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
+var mod_meetingPoint_fix = "";
+
+
+function init_mod_meetingPoint(ind){
+	parent.mb_button[ind] = window.document.getElementById("getCoords");
+	parent.mb_button[ind].img_over = mod_meetingPoint_img_over.src;
+	parent.mb_button[ind].img_on = mod_meetingPoint_img_on.src;
+	parent.mb_button[ind].img_off = mod_meetingPoint_img_off.src;
+	parent.mb_button[ind].status = 0;
+	parent.mb_button[ind].elName = "getCoords";
+	parent.mb_button[ind].go = new Function ("mod_meetingPoint_run()");
+	parent.mb_button[ind].stop = new Function ("mod_meetingPoint_disable()");   
+}
+
+function mod_meetingPoint_run(){   
+	parent.frames[mod_meetingPoint_target].document.onclick = mod_meetingPoint_click;
+}
+function mod_meetingPoint_disable(){
+	parent.frames[mod_meetingPoint_target].document.onclick = null;
+}
+function mod_meetingPoint_click(e){
+	if(ie){
+		clickX = parent.frames[mod_meetingPoint_target].event.clientX;
+		clickY = parent.frames[mod_meetingPoint_target].event.clientY;
+	}
+	else{
+		clickX = e.pageX;
+		clickY = e.pageY;
+	}
+	
+	var pos = parent.makeClickPos2RealWorldPos(mod_meetingPoint_target, clickX, clickY);
+    
+	mod_meetingPoint_write(pos[0],pos[1]);
+	mod_meetingPoint_disable();
+	
+}
+function mod_meetingPoint_display(e){
+	if(ie){
+		clickX = parent.frames[mod_meetingPoint_target].event.clientX;
+		clickY = parent.frames[mod_meetingPoint_target].event.clientY;
+
+	}
+	else{
+		clickX = e.pageX;
+		clickY = e.pageY;
+	}
+	var pos = makeClickPos2RealWorldPos(mod_meetingPoint_target, clickX, clickY);
+}
 
+function mod_meetingPoint_write(x,y){	
+   document.forms[0].x.value =x;
+   document.forms[0].y.value =y;	   
+}
+-->
+</script>
 
+<script language='JavaScript'>
+<!--
+<?php
+echo "var used_charset = '".CHARSET ."';";
 ?>
 
 function validate(){
@@ -83,7 +153,6 @@
     	my_meetingPoint += "&password=" + document.forms[0].mypw.value;
     	my_meetingPoint += "&mb_user_myGui=" + document.forms[0].mygui.value;
     	
-    	//var ind = parent.getMapObjIndexByName(mod_meetingPoint_target);
     	var ind = parent.getMapObjIndexByName('mapframe1');
     	var coord = parent.mb_mapObj[ind].extent.split(",");
     	
@@ -93,7 +162,7 @@
 		my_meetingPoint +=  parseFloat(coord[3]) ;
 
     	my_meetingPoint += "&mb_myPOI=";
-
+    	
 		if(used_charset == 'UTF-8'){
     		my_meetingPoint += decodeURI(document.forms[0].mytext.value);
     	}else{
@@ -105,26 +174,35 @@
 
     	
     	prompt("Ihr Treffpunkt. Kopieren Sie den Link. ",my_meetingPoint);
-    	//document.getElementById("mymeetingPoint").href = my_meetingPoint;
-
-    	//prompt("Link",document.getElementById("mymeetingPoint").href);
+		//createEmail(my_meetingPoint);
     }
-      
-    
 }
 
 function emptyfields(){
 	document.forms[0].mytext.value ='';
 	document.forms[0].x.value ='';
 	document.forms[0].y.value =  '';
+}
+
+function createEmail (url) {
+  var email = "mailto:"
+  email  += "";
+  email  += "?subject=";
+  email  += "Ihr Treffpunkt. Folgen Sie dem Link";
+  email  += "&body=";
+  email  += escape(url);
 
+  var win = window.open(email, 'email', 'top=120,left=120');
+  win.close();
 }
 
 function goBack(where){
     document.location.href=where;
 }
 
-
+function init(){
+	parent.mb_regButton_frame("init_mod_meetingPoint","meetingPoint",null);
+}
 -->
 </script>
 
@@ -133,23 +211,24 @@
 
 <form action="" >
 
-<img  id='getCoords' name='getCoords' onmouseover = "mb_regButton('init_mod_getCoords')" title="Treffpunkt setzen"  src = '../img/button_digitize/point_off.png'>
-
-Text &nbsp;<input class='strinput' type="hidden" name='myurl' value='<?php  echo LOGIN;  ?>'>
+<img  id='getCoords' name='getCoords' onclick="mod_meetingPoint_run()" onmouseover ="parent.mb_regButton_frame('init_mod_meetingPoint','meetingPoint',null)"  title="Treffpunkt setzen"  src = '../img/button_digitize/point_off.png'>
+<br>
+<input class='strinput' type="hidden" name='myurl' value='<?php  echo LOGIN;  ?>'>
 
 <input class='strinput' type="hidden" name='mygui' value='<?php  echo $_SESSION["mb_user_gui"];  ?>'>
 
 <input class='strinput' type="hidden" name='myuser' value='<?php  echo $_SESSION["mb_user_name"];  ?>'>
 
 <input class='strinput' type="hidden" name='mypw' value='<?php  echo $_SESSION["mb_user_password"];  ?>'>
-
-<input class='strinput' type="text" name='mytext' value=''>
+Text :<br>
+<!--<input class='strinput' type="textarea" size=2 name='mytext' value='' "maxlength=70" title="max. 70 Zeichen">-->
+<textarea rows="2" name='mytext' value='huhu' title="max. 70 Zeichen"></textarea>
 <br>
 <input class="okbutton" name="Send"   type="button" value="ok" onclick="validate();">
 <input class="ibutton" type="button" value="cancel" onClick="emptyfields();">
 <br>
-<input class='coord' type="text" name='x' value='' readonly>
-<input class='coord' type="text" name='y' value='' readonly>
+<input class="coord" type="text" name='x' value='' readonly>
+<input class="coord" type="text" name='y' value='' readonly>
 <br>
 </form>
 </body>




More information about the Mapbender_commits mailing list