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

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


Author: astrid_emde
Date: 2006-10-27 08:59:27+0000
New Revision: 806

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

Log:
new modul to generate a meeting point

have a look at http://www.mapbender.org/index.php/MeetingPoint for a detailed description of the modul

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=806&p1=trunk/mapbender/http/php/mod_meetingPoint.php&p2=trunk/mapbender/http/php/mod_meetingPoint.php&r1=805&r2=806
==============================================================================
--- trunk/mapbender/http/php/mod_meetingPoint.php	(original)
+++ trunk/mapbender/http/php/mod_meetingPoint.php	2006-10-27 08:59:27+0000
@@ -41,8 +41,6 @@
 	echo "alert('legend: ID not unique!');";
 }
 
-$e_id_css = 'meetingPoint';
-include('../include/dyn_js.php');
 ?>
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
@@ -54,9 +52,35 @@
 <script language='JavaScript'>
 <!--
 <?php
+
+$e_id_css = 'meetingPoint';
+include('../include/dyn_js.php');
+
 echo "var mod_meetingPoint_target = '".$e_target."';";
 echo "var meetingPoint_write_to = 'meetingPoint';";
 ?>
+
+try{
+	if (meetingPoint_export_subject){}
+}
+catch(e){
+	meetingPoint_export_subject = 'Your meeting point. Follow the link!';
+}
+
+try{
+	if (meetingPoint_export_format){}
+}
+catch(e){
+	meetingPoint_export_format = 'prompt';
+}
+
+try{
+	if (meetingPoint_max_characters){}
+}
+catch(e){
+	meetingPoint_max_characters = 100;
+}
+
 var ie = document.all?1:0;
 var mod_meetingPoint_win = null;
 var mod_meetingPoint_elName = "meetingPoint";
@@ -74,12 +98,12 @@
 
 
 function init_mod_meetingPoint(ind){
-	parent.mb_button[ind] = window.document.getElementById("getCoords");
+	parent.mb_button[ind] = window.document.getElementById("my_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].elName = "my_getCoords";
 	parent.mb_button[ind].go = new Function ("mod_meetingPoint_run()");
 	parent.mb_button[ind].stop = new Function ("mod_meetingPoint_disable()");   
 }
@@ -163,18 +187,21 @@
 
     	my_meetingPoint += "&mb_myPOI=";
     	
-		if(used_charset == 'UTF-8'){
-    		my_meetingPoint += decodeURI(document.forms[0].mytext.value);
-    	}else{
-    		my_meetingPoint += document.forms[0].mytext.value;
-    	}
+    	var splitext  = document.forms[0].mytext.value;
+    	document.forms[0].mytext.value = splitext.substring(0, meetingPoint_max_characters);
+    	
+
+    	my_meetingPoint += document.forms[0].mytext.value;
+
     	
     	my_meetingPoint += "," + document.forms[0].x.value + ",";
     	my_meetingPoint += document.forms[0].y.value;
 
-    	
-    	prompt("Ihr Treffpunkt. Kopieren Sie den Link. ",my_meetingPoint);
-		//createEmail(my_meetingPoint);
+    	if(meetingPoint_export_format == 'email'){
+    		createEmail(my_meetingPoint,meetingPoint_export_subject);
+		}else{			
+			prompt(meetingPoint_export_subject,my_meetingPoint);			
+		}
     }
 }
 
@@ -184,11 +211,11 @@
 	document.forms[0].y.value =  '';
 }
 
-function createEmail (url) {
+function createEmail (url,subject) {
   var email = "mailto:"
   email  += "";
   email  += "?subject=";
-  email  += "Ihr Treffpunkt. Folgen Sie dem Link";
+  email  += subject;
   email  += "&body=";
   email  += escape(url);
 
@@ -211,7 +238,7 @@
 
 <form action="" >
 
-<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'>
+<img  id='my_getCoords' name='my_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;  ?>'>
 
@@ -222,13 +249,13 @@
 <input class='strinput' type="hidden" name='mypw' value='<?php  echo $_SESSION["mb_user_password"];  ?>'>
 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>
+<textarea rows="3" 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="hidden" name='x' value='' readonly>
+<input class="coord" type="hidden" name='y' value='' readonly>
 <br>
 </form>
 </body>




More information about the Mapbender_commits mailing list