[Mapbender-commits] r2683 - in branches/2.5/http: css print

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jul 22 01:48:26 EDT 2008


Author: beck
Date: 2008-07-22 01:48:25 -0400 (Tue, 22 Jul 2008)
New Revision: 2683

Added:
   branches/2.5/http/css/print.css
Modified:
   branches/2.5/http/print/mod_printPDF.php
Log:
Rebuild  mod_printPDF.php as valid XHTML with external CSS ressource.

Added: branches/2.5/http/css/print.css
===================================================================
--- branches/2.5/http/css/print.css	                        (rev 0)
+++ branches/2.5/http/css/print.css	2008-07-22 05:48:25 UTC (rev 2683)
@@ -0,0 +1,32 @@
+* {
+	font: 12px normal Verdana,Arial,Helvetica,sans-serif;
+}
+
+body {
+	margin: 0;
+	padding: 1em;
+	color: #000;
+	background-color: #FFF;
+}
+
+form p {
+	line-height: 1.25em;
+	white-space: nowrap;
+}
+
+form p label {
+	display: block;
+	float: left;
+	width: 7em;
+	padding-right: 1em;
+	line-height: 1.25em;
+}
+
+form p input#mylegendcheckbox {
+	margin: 0;
+	padding: 0;
+}
+
+form p input#print {
+	margin-left: 8em;
+}
\ No newline at end of file

Modified: branches/2.5/http/print/mod_printPDF.php
===================================================================
--- branches/2.5/http/print/mod_printPDF.php	2008-07-21 14:40:03 UTC (rev 2682)
+++ branches/2.5/http/print/mod_printPDF.php	2008-07-22 05:48:25 UTC (rev 2683)
@@ -19,378 +19,351 @@
 session_start();
 require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-
+
+// ini_set("error_reporting",E_ALL);
+// ini_set("display_errors","on");
 ?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
 <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>Print PDF</title>
-</head>
-<style type="text/css">
-<!-- 
-select{
-   width:150px;
-} 
-input{
-	width:150px;
-}
-.mycheck{
-	width:15px;
-}
-div{
-	font-family : Arial, Helvetica, sans-serif;
-	font-size: 12px;
-}
--->
-</style>
-<?php
+	<meta http-equiv="cache-control" content="no-cache" />
+	<meta http-equiv="pragma" content="no-cache" />
+	<meta http-equiv="expires" content="0" />
+	<?php printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\" />",CHARSET);	?>
+	<title>Print PDF</title>
 
-//FIXME:
-//setlocale(LC_ALL, "de_DE.utf8");
+	<?php
+	include '../include/dyn_css.php';
+	
+	//FIXME:
+	//setlocale(LC_ALL, "de_DE.utf8");
+
+	require_once(dirname(__FILE__)."/../print/".$_REQUEST["conf"]);
+
+	printf("
+	<script type=\"text/javascript\">
+		var target = '%s';
+		var comment = '%s';
+		var comment_length = %s;
+		var label_button = '%s';
+		var type = '%s';
+	</script>",
+	$_REQUEST["target"],$label_comment,$comment_length,$label_button,$type
+	);
+	?>
+
+	<script type="text/javascript">
+	<!--
+	var size;
+	var format;
+	var map_width;
+	var map_height;
 
-require_once(dirname(__FILE__)."/../print/".$_REQUEST["conf"]);
-echo "<script type='text/javascript'>";
-echo "var target = '".$_REQUEST["target"]."';";
-echo "var comment = '".$label_comment."';";
-echo "var comment_length = ".$comment_length.";";
-echo "var label_button = '".$label_button."';";
-echo "var type = '".$type."';";
-echo "</script>";
-?>
-<script type="text/javascript">
-<!--
+	if(type=='window'){
+		var pt = window.opener;
+	}
+	else if(type == 'iframe'){
+		var pt = parent;
+	}
 
+	function mod_legend_print(){
+		var mod_legend_target = target;
+		var ind = pt.getMapObjIndexByName(mod_legend_target);
+		var layers;
 
-var size;
-var format;
-var map_width;
-var map_height;
-
-if(type=='window'){
-	var pt = window.opener;
-}
-else if(type == 'iframe'){
-	var pt = parent;
-}
-
-function mod_legend_print(){
-	var mod_legend_target = target;
-	var ind = pt.getMapObjIndexByName(mod_legend_target);
-	var layers;
-
-	document.forms[0].layers.value = "";
-	document.forms[0].wms_id.value = "";
-	document.forms[0].wms_title.value = "";
-	document.forms[0].legendurl.value = "";
-	
-	for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
-		layers = pt.mb_mapObj[ind].wms[i].getLayers(pt.mb_mapObj[ind]);
-		if(layers != "" && layers){
+		document.forms[0].layers.value = "";
+		document.forms[0].wms_id.value = "";
+		document.forms[0].wms_title.value = "";
+		document.forms[0].legendurl.value = "";
 		
-			if(i>0 && document.forms[0].wms_id.value!=''){
-			    document.forms[0].layers.value += "___";
-			    document.forms[0].wms_id.value += "___";
-			    document.forms[0].wms_title.value += "___";
-			    document.forms[0].legendurl.value += "___";
-			}
-					
-			document.forms[0].wms_id.value += pt.mb_mapObj[ind].wms[i].wms_id;   
-			document.forms[0].wms_title.value += pt.mb_mapObj[ind].wms[i].wms_title;
-				
-			for(var j=0; j<layers.length; j++){			
-				var layer = layers[j];
-				var title = pt.mb_mapObj[ind].wms[i].getTitleByLayerName(layers[j]);
-				var layerStyle = pt.mb_mapObj[ind].wms[i].getCurrentStyleByLayerName(layers[j]);
-				if(layerStyle==false){
-					var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],"default");	
+		for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+			layers = pt.mb_mapObj[ind].wms[i].getLayers(pt.mb_mapObj[ind]);
+			if(layers != "" && layers){
+			
+				if(i>0 && document.forms[0].wms_id.value!=''){
+				    document.forms[0].layers.value += "___";
+				    document.forms[0].wms_id.value += "___";
+				    document.forms[0].wms_title.value += "___";
+				    document.forms[0].legendurl.value += "___";
 				}
-				else{
-					var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],layerStyle);
-				}
-				
-				//---------- legendurl ----------
-				tmp_name = "";	
-				if(j>0){
-					document.forms[0].layers.value += ",";
-				}
-					document.forms[0].layers.value += title;
-				if(j>0){
-					document.forms[0].legendurl.value += ",";
-				}
-				if (temp_legendurl!= '' || !temp_legendurl == 'true'){
-					document.forms[0].legendurl.value += temp_legendurl;
-				}else{
-					document.forms[0].legendurl.value +='0';
+						
+				document.forms[0].wms_id.value += pt.mb_mapObj[ind].wms[i].wms_id;   
+				document.forms[0].wms_title.value += pt.mb_mapObj[ind].wms[i].wms_title;
+					
+				for(var j=0; j<layers.length; j++){			
+					var layer = layers[j];
+					var title = pt.mb_mapObj[ind].wms[i].getTitleByLayerName(layers[j]);
+					var layerStyle = pt.mb_mapObj[ind].wms[i].getCurrentStyleByLayerName(layers[j]);
+					if(layerStyle==false){
+						var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],"default");	
+					}
+					else{
+						var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],layerStyle);
+					}
+					
+					//---------- legendurl ----------
+					tmp_name = "";	
+					if(j>0){
+						document.forms[0].layers.value += ",";
+					}
+						document.forms[0].layers.value += title;
+					if(j>0){
+						document.forms[0].legendurl.value += ",";
+					}
+					if (temp_legendurl!= '' || !temp_legendurl == 'true'){
+						document.forms[0].legendurl.value += temp_legendurl;
+					}else{
+						document.forms[0].legendurl.value +='0';
+					}	
 				}	
-			}	
-		}
-		else{
-			if(i>0 && document.forms[0].wms_id.value!=''){
-			    document.forms[0].layers.value += "___";
-			    document.forms[0].wms_id.value += "___";
-			    document.forms[0].wms_title.value += "___";
-			    document.forms[0].legendurl.value += "___";
-		    }
+			}
+			else{
+				if(i>0 && document.forms[0].wms_id.value!=''){
+				    document.forms[0].layers.value += "___";
+				    document.forms[0].wms_id.value += "___";
+				    document.forms[0].wms_title.value += "___";
+				    document.forms[0].legendurl.value += "___";
+			    }
+				
+				document.forms[0].layers.value += "0";
+			    document.forms[0].wms_id.value += "0";
+			    document.forms[0].wms_title.value += "0";
+			    document.forms[0].legendurl.value += "0";
+			}
+		}//for
+		//alert(document.forms[0].layers.value+"---"+document.forms[0].wms_id.value+"---"+document.forms[0].wms_title.value+"---"+document.forms[0].legendurl.value);	
 			
-			document.forms[0].layers.value += "0";
-		    document.forms[0].wms_id.value += "0";
-		    document.forms[0].wms_title.value += "0";
-		    document.forms[0].legendurl.value += "0";
-		}
-	}//for
-	//alert(document.forms[0].layers.value+"---"+document.forms[0].wms_id.value+"---"+document.forms[0].wms_title.value+"---"+document.forms[0].legendurl.value);	
+	}
+
+	function validate(){
+		size = document.getElementById('size').options[document.getElementById('size').selectedIndex].value;
+		format = document.getElementById('format').options[document.getElementById('format').selectedIndex].value;
 		
-}
+		if(size != "" && format != ""){
+			var ind = pt.getMapObjIndexByName(target);
+			var coord = pt.mb_mapObj[ind].extent.split(",");
+			var centerX = parseFloat(coord[0]) + (parseFloat(coord[2]) - parseFloat(coord[0]))/2
+			var centerY = parseFloat(coord[1]) + (parseFloat(coord[3]) - parseFloat(coord[1]))/2
+			if(size == "A4" && format == "portrait"){
+				map_width = <?php echo $a4p_map_width; ?>; 
+				map_height = <?php echo $a4p_map_height; ?>; 
+			}
+			if(size == "A4" && format == "landscape"){
+				map_width = <?php echo $a4l_map_width; ?>;
+				map_height = <?php echo $a4l_map_height; ?>; 
+			}
+			if(size == "A3" && format == "portrait"){
+				map_width = <?php echo $a3p_map_width; ?>;
+				map_height = <?php echo $a3p_map_height; ?>;
+			}
+			if(size == "A3" && format == "landscape"){
+				map_width = <?php echo $a3l_map_width; ?>;
+				map_height = <?php echo $a3l_map_height; ?>;
+			}  
+			if(size == "A2" && format == "portrait"){
+				map_width = <?php echo $a2p_map_width; ?>;
+				map_height = <?php echo $a2p_map_height; ?>;
+			}
+			if(size == "A2" && format == "landscape"){
+				map_width = <?php echo $a2l_map_width; ?>;
+				map_height = <?php echo $a2l_map_height; ?>;
+			}
+			if(size == "A1" && format == "portrait"){
+				map_width = <?php echo $a1p_map_width; ?>;
+				map_height = <?php echo $a1p_map_height; ?>;
+			}
+			if(size == "A1" && format == "landscape"){
+				map_width = <?php echo $a1l_map_width; ?>;
+				map_height = <?php echo $a1l_map_height; ?>;
+			}
+			if(size == "A0" && format == "portrait"){
+				map_width = <?php echo $a0p_map_width; ?>;
+				map_height = <?php echo $a0p_map_height; ?>;
+			}
+			if(size == "A0" && format == "landscape"){
+				map_width = <?php echo $a0l_map_width; ?>;
+				map_height = <?php echo $a0l_map_height; ?>;
+			}     
+			var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
+			pt.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," +  coord[3];
 
-function validate(){
-	size = document.form1.size.options[document.form1.size.selectedIndex].value;
-	format = document.form1.format.options[document.form1.format.selectedIndex].value;
-	if(size != "" && format != ""){
-		var ind = pt.getMapObjIndexByName(target);
-		var coord = pt.mb_mapObj[ind].extent.split(",");
-		var centerX = parseFloat(coord[0]) + (parseFloat(coord[2]) - parseFloat(coord[0]))/2
-		var centerY = parseFloat(coord[1]) + (parseFloat(coord[3]) - parseFloat(coord[1]))/2
-		if(size == "A4" && format == "portrait"){
-			map_width = <?php echo $a4p_map_width; ?>; 
-			map_height = <?php echo $a4p_map_height; ?>; 
-		}
-		if(size == "A4" && format == "landscape"){
-			map_width = <?php echo $a4l_map_width; ?>;
-			map_height = <?php echo $a4l_map_height; ?>; 
-		}
-		if(size == "A3" && format == "portrait"){
-			map_width = <?php echo $a3p_map_width; ?>;
-			map_height = <?php echo $a3p_map_height; ?>;
-		}
-		if(size == "A3" && format == "landscape"){
-			map_width = <?php echo $a3l_map_width; ?>;
-			map_height = <?php echo $a3l_map_height; ?>;
-		}  
-		if(size == "A2" && format == "portrait"){
-			map_width = <?php echo $a2p_map_width; ?>;
-			map_height = <?php echo $a2p_map_height; ?>;
-		}
-		if(size == "A2" && format == "landscape"){
-			map_width = <?php echo $a2l_map_width; ?>;
-			map_height = <?php echo $a2l_map_height; ?>;
-		}
-		if(size == "A1" && format == "portrait"){
-			map_width = <?php echo $a1p_map_width; ?>;
-			map_height = <?php echo $a1p_map_height; ?>;
-		}
-		if(size == "A1" && format == "landscape"){
-			map_width = <?php echo $a1l_map_width; ?>;
-			map_height = <?php echo $a1l_map_height; ?>;
-		}
-		if(size == "A0" && format == "portrait"){
-			map_width = <?php echo $a0p_map_width; ?>;
-			map_height = <?php echo $a0p_map_height; ?>;
-		}
-		if(size == "A0" && format == "landscape"){
-			map_width = <?php echo $a0l_map_width; ?>;
-			map_height = <?php echo $a0l_map_height; ?>;
-		}     
-		var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
-		pt.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," +  coord[3];
+			pt.mb_mapObj[ind].width = Math.round(map_width);
+			pt.mb_mapObj[ind].height = Math.round(map_height);
+			pt.document.getElementById(target).style.width = Math.round(map_width);
+			pt.document.getElementById(target).style.height = Math.round(map_height);
+			pt.window.frames[target].document.getElementById("maps").style.width = Math.round(map_width);
+			pt.window.frames[target].document.getElementById("maps").style.height = Math.round(map_height);
 
-		pt.mb_mapObj[ind].width = Math.round(map_width);
-		pt.mb_mapObj[ind].height = Math.round(map_height);
-		pt.document.getElementById(target).style.width = Math.round(map_width);
-		pt.document.getElementById(target).style.height = Math.round(map_height);
-		pt.window.frames[target].document.getElementById("maps").style.width = Math.round(map_width);
-		pt.window.frames[target].document.getElementById("maps").style.height = Math.round(map_height);
-
-		//pt.setMapRequest(target);		
-		pt.mb_repaintScale(target, null, null, pt.mb_getScale(target));
-      	document.form1.map_url.value = '';
-		for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
-			if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
-				if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){   
-					if(document.form1.map_url.value != ""){
-						document.form1.map_url.value += "___";
-					}         
-					document.form1.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
+			//pt.setMapRequest(target);		
+			pt.mb_repaintScale(target, null, null, pt.mb_getScale(target));
+		document.form1.map_url.value = '';
+			for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+				if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
+					if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){   
+						if(document.form1.map_url.value != ""){
+							document.form1.map_url.value += "___";
+						}         
+						document.form1.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
+					}
 				}
 			}
-		}
-		
-		//overview_url
-		var ind_overview = pt.getMapObjIndexByName('overview');
+			
+			//overview_url
+			var ind_overview = pt.getMapObjIndexByName('overview');
 
-		//alert ("l�nge: " + length+ " - " + ind_overview + name + pt.mb_mapObj[ind_overview].wms.length);
-		if(pt.mb_mapObj[ind_overview].mapURL != false ){
-			document.forms[0].overview_url.value = pt.mb_mapObj[ind_overview].mapURL;
+			//alert ("l�nge: " + length+ " - " + ind_overview + name + pt.mb_mapObj[ind_overview].wms.length);
+			if(pt.mb_mapObj[ind_overview].mapURL != false ){
+				document.forms[0].overview_url.value = pt.mb_mapObj[ind_overview].mapURL;
+			}
 		}
 	}
-}
-function refreshParams(){
-	var ind = pt.getMapObjIndexByName(target);
-	var f = document.form1;
-	f.map_url.value = "";
-	for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
-		if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
-			if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){
-				if(f.map_url.value != ""){
-					f.map_url.value += "___";
-				}      
-				f.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
+	function refreshParams(){
+		var ind = pt.getMapObjIndexByName(target);
+		var f = document.form1;
+		f.map_url.value = "";
+		for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+			if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
+				if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){
+					if(f.map_url.value != ""){
+						f.map_url.value += "___";
+					}      
+					f.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
+				}
 			}
 		}
+		f.map_scale.value = pt.mb_getScale(target);
+		f.epsg.value = pt.mb_mapObj[ind].epsg;
+		mod_legend_print();
 	}
-	f.map_scale.value = pt.mb_getScale(target);
-	f.epsg.value = pt.mb_mapObj[ind].epsg;
-	mod_legend_print();
-}
-function printMap(){
-	if(size != "" && (format == "portrait" || format == "landscape")){
-		refreshParams();
-		if(document.form1.c1.value != comment){
-			document.form1.comment1.value = document.form1.c1.value;
-		}
-		if(document.form1.c2.value != comment){
-			document.form1.comment2.value = document.form1.c2.value;
-		}
-		if(document.form1.mylegendcheckbox.checked == 0){
-			document.form1.mylegend.value = 'false';
-		}else{
-			document.form1.mylegend.value = 'true';
-		}
-		
-		// write the measured coordinates
-		
-		if (pt.mod_measure_RX != undefined && pt.mod_measure_RY != undefined) {
-			var tmp_x = '';
-			var tmp_y = '';
-			for(i = 0; i<pt.mod_measure_RX.length; i++) {
-				if(tmp_x != '') {
-					tmp_x += ','
-				}
-				tmp_x += pt.mod_measure_RX[i];
+	function printMap(){
+		if(size != "" && (format == "portrait" || format == "landscape")){
+			refreshParams();
+			if(document.form1.c1.value != comment){
+				document.form1.comment1.value = document.form1.c1.value;
 			}
-			for(i = 0; i<pt.mod_measure_RY.length; i++) {
-				if(tmp_y != '') {
-					tmp_y += ','
+			if(document.form1.c2.value != comment){
+				document.form1.comment2.value = document.form1.c2.value;
+			}
+			if(document.form1.mylegendcheckbox.checked == 0){
+				document.form1.mylegend.value = 'false';
+			}else{
+				document.form1.mylegend.value = 'true';
+			}
+			
+			// write the measured coordinates
+			
+			if (pt.mod_measure_RX != undefined && pt.mod_measure_RY != undefined) {
+				var tmp_x = '';
+				var tmp_y = '';
+				for(i = 0; i<pt.mod_measure_RX.length; i++) {
+					if(tmp_x != '') {
+						tmp_x += ','
+					}
+					tmp_x += pt.mod_measure_RX[i];
 				}
-				tmp_y += pt.mod_measure_RY[i];
+				for(i = 0; i<pt.mod_measure_RY.length; i++) {
+					if(tmp_y != '') {
+						tmp_y += ','
+					}
+					tmp_y += pt.mod_measure_RY[i];
+				}
+				document.forms['form1'].elements['measured_x_values'].value = tmp_x;
+				document.forms['form1'].elements['measured_y_values'].value = tmp_y;
 			}
-			document.forms['form1'].elements['measured_x_values'].value = tmp_x;
-			document.forms['form1'].elements['measured_y_values'].value = tmp_y;
+			
+			document.form1.submit();
 		}
-		
-		document.form1.submit();
+		else{
+			alert("<?php echo _("No format selected!")?>");
+		}
 	}
-	else{
-		alert("<?php echo _("No format selected.")?>");
+	function valCom(obj){
+		if(obj.value.length > comment_length){
+			obj.value = obj.value.substr(0,comment_length);
+		}
 	}
-}
-function valCom(obj){
-	if(obj.value.length > comment_length){
-		obj.value = obj.value.substr(0,comment_length);
-	}
-}
-// -->
-</script>
+	-->
+	</script>
+</head>
+
 <body>
-<form name='form1' method='POST' action='../print/mod_printPDF_pdf.php?<?php echo SID; ?>' target="_blank">
-<table border='0'>
-<tr>
-	<td>
-	<select name='size' onchange='validate()'>
-<?php
-	if($a4 == true && $a3 == true){
-		echo "<option value=''>".$label_format."</option>";
-	}
-	if($a4 == true){
-		echo "<option value='A4'>".$label_format_a4."</option>";
-	}
-	if($a3 == true){
-		echo "<option value='A3'>".$label_format_a3."</option>";
-	}
-	if($a2 == true){
-		echo "<option value='A2'>".$label_format_a2."</option>";
-	}
-	if($a1 == true){
-		echo "<option value='A1'>".$label_format_a1."</option>";
-	}
-	if($a0 == true){
-		echo "<option value='A0'>".$label_format_a0."</option>";
-	}
-?>
+
+<form name="form1" method="POST" action="../print/mod_printPDF_pdf.php?<?php echo SID; ?>" target="_blank">
+
+<p>
+	<label for="size"><?php echo $label_format ?>:</label> 
+	<select id="size" name="size" onchange="validate();">
+		<option value="false">-</option>
+		<?php
+		for($i = 4; $i >= 0; $i--) {
+			if(${"a".$i}) {
+				printf("<option value=\"A%s\">%s</option>",$i,${"label_format_a".$i});
+			}
+		}
+		?>
 	</select>
-	</td>   
-</tr>
-<tr>
-	<td>
-	<select name='format' onchange='validate()'>
-	<option value=''><?php echo $label_orientation; ?></option>
-	<option value='portrait'><?php echo $label_portrait; ?></option>
-	<option value='landscape'><?php echo $label_landscape; ?></option>
-	</select>
-	</td>
-</tr>
-<?php
-if($highquality == true){
-	echo "<tr>";
-		echo "<td>";
-		echo "<select name='quality'>";
-		echo "<option value='1'>".$label_72dpi."</option>";
-		echo "<option value='2'>".$label_288dpi."</option>";
-		echo "</select>";
-		echo "</td>";
-	echo "</tr>";
-}
-?>
-<tr>
-	<td>
-		<input type='text' name='c1' value='<?php echo $label_comment; ?>' onkeydown="valCom(this)">
-	</td>
-</tr>
-<tr>
-	<td>
-		<input type='text' name='c2' value='<?php echo $label_comment; ?>' onkeydown="valCom(this)">
-	</td>
-</tr>
-<?php
-if($legend == true){
-	echo "<tr>";
-		echo "<td>";
-		echo "<div><input type='checkbox' class='mycheck' name='mylegendcheckbox' value='false'>".$label_legend."</div>";
-		echo "</td>";
-	echo "</tr>";
-}else {
-	echo "<tr>";
-	echo "<td>";
-	echo "<input type='hidden' name='mylegendcheckbox' value='false'>";
-	echo "</td>";
-	echo "</tr>";
-}
+</p>
+
+<p>
+	<label for="format"><?php echo $label_orientation; ?>:</label> 
+	<select id="format" name="format" onchange="validate();">
+		<option value="portrait"><?php echo $label_portrait; ?></option>
+		<option value="landscape"><?php echo $label_landscape; ?></option>
+	</select>
+</p>
+
+<?php if($highquality === TRUE): ?>
+	<p>
+		<label for="quality"><?php echo $label_quality; ?>:</label> 
+		<input type="radio" id="quality" name="quality" value="1" checked="checked" /> <?php echo $label_72dpi; ?>
+		<input type="radio" id="quality" name="quality" value="2" /> <?php echo $label_288dpi; ?>
+	</p>
+<?php endif; ?>
+
+<p>
+	<label for="c1"><?php echo $label_comment; ?>:</label> 
+	<input type="text" id="c1" name="c1" maxlength="<?php echo $comment_length; ?>" onkeydown="valCom(this);" /> 
+	<em>(max. <?php echo $comment_length; ?>)</em>
+</p>
 
-
-?>
-<table>  
-<input type='hidden' name='map_url' value=''>
-<input type='hidden' name='overview_url' value=''>
-<input type='hidden' name='wms_title' value=''>
-<input type='hidden' name='wms_id' value=''>
-<input type='hidden' name='layers' value=''>
-<input type='hidden' name='legendurl' value=''>
-<input type='hidden' name='map_scale' value=''>
-<input type='hidden' name='epsg' value=''>
-<input type='button' name='print' value="<?php echo $label_button; ?>" onclick='printMap()'>
-<input type='hidden' name='conf' value='<?php echo $_REQUEST["conf"]; ?>'>
-<input type='hidden' name='comment1' value=''>
-<input type='hidden' name='comment2' value=''>
-<input type='hidden' name='mylegend' value='true'>
-<input type='hidden' name='measured_x_values' value=''>
-<input type='hidden' name='measured_y_values' value=''>
-
+<p>
+	<label for="c2"><?php echo $label_comment; ?>:</label> 
+	<input type="text" id="c2" name="c2" maxlength="<?php echo $comment_length; ?>" onkeydown="valCom(this);" /> 
+	<em>(max. <?php echo $comment_length; ?>)</em>
+</p>
+
+<?php if($legend === TRUE): ?>
+	<p>
+		<label for="mylegendcheckbox"><?php echo $label_legend; ?>:</label>  
+		<input type="checkbox" id="mylegendcheckbox" name="mylegendcheckbox" value="false" />
+	</p>
+<?php else: ?>
+	<input type="hidden" name="mylegendcheckbox" value="false" />
+<?php endif; ?>  
+
+<input type="hidden" name="map_url" />
+<input type="hidden" name="overview_url" />
+<input type="hidden" name="wms_title" />
+<input type="hidden" name="wms_id" />
+<input type="hidden" name="layers" />
+<input type="hidden" name="legendurl" />
+<input type="hidden" name="map_scale" />
+<input type="hidden" name="epsg" />
+<input type="hidden" name="conf" value="<?php echo $_REQUEST["conf"]; ?>" />
+<input type="hidden" name="comment1" />
+<input type="hidden" name="comment2" />
+<input type="hidden" name="mylegend" value="true" >
+<input type="hidden" name="measured_x_values" />
+<input type="hidden" name="measured_y_values" />
+
+<p>
+	<input type="button" id="print" name="print" value="<?php echo $label_button; ?>" onclick="printMap();" />
+</p>
+
 </form>
-</body>
-</html>
+
+</body>
+
+</html>
\ No newline at end of file



More information about the Mapbender_commits mailing list