[Mapbender-commits] r8302 - in trunk/mapbender/http: plugins print/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Apr 4 08:00:23 EDT 2012


Author: verenadiewald
Date: 2012-04-04 05:00:23 -0700 (Wed, 04 Apr 2012)
New Revision: 8302

Modified:
   trunk/mapbender/http/plugins/mb_print.php
   trunk/mapbender/http/print/classes/mbParagraphDecorator.php
Log:
http://trac.osgeo.org/mapbender/ticket/878

Modified: trunk/mapbender/http/plugins/mb_print.php
===================================================================
--- trunk/mapbender/http/plugins/mb_print.php	2012-04-04 11:56:21 UTC (rev 8301)
+++ trunk/mapbender/http/plugins/mb_print.php	2012-04-04 12:00:23 UTC (rev 8302)
@@ -572,16 +572,22 @@
 			} else {
 				str += '<div class="print_option_dyn" style="display:none;">\n';
 			}
+			if(element.maxCharacter) {
+				var maxLength = 'maxlength="'+element.maxCharacter+'"';
+			}
+			else {
+				var maxLength = "";
+			}
 			switch (element.type) {
 				case "text":
-					str += '<input type="'+element.type+'" name="'+element.id+'" id="'+element.id+'" size="'+element.size+'"><br>\n';
+					str += '<input type="'+element.type+'" name="'+element.id+'" id="'+element.id+'" size="'+element.size+'" '+maxLength+'><br>\n';
 					break;
 				case "hidden":
 					str += '<input type="'+element.type+'" name="'+element.id+'" id="'+element.id+'">\n';
-					break;
+					break;				
 				case "textarea":
-					str += '<textarea id="'+element.id+'" name="'+element.id+'" size="'+element.size+'"></textarea><br>\n';
-					break;
+					str += '<textarea id="'+element.id+'" name="'+element.id+'" size="'+element.size+'" '+maxLength+'></textarea><br>\n';
+					break;	
 				case "select":
 					str += '<select id="'+element.id+'" name="'+element.id+'" size="1">\n';
 					for (var option_index in element.options) {

Modified: trunk/mapbender/http/print/classes/mbParagraphDecorator.php
===================================================================
--- trunk/mapbender/http/print/classes/mbParagraphDecorator.php	2012-04-04 11:56:21 UTC (rev 8301)
+++ trunk/mapbender/http/print/classes/mbParagraphDecorator.php	2012-04-04 12:00:23 UTC (rev 8302)
@@ -48,7 +48,9 @@
 		$this->pdf->objPdf->SetLineWidth($this->conf->border_width);
 		$this->pdf->objPdf->SetXY($this->conf->x_ul, $this->conf->y_ul);
 		$this->pdf->objPdf->setFont($this->conf->font_family, "", $this->conf->font_size);
-		$this->pdf->objPdf->Cell($this->conf->width, $this->conf->height, utf8_decode($this->value), $this->conf->border, 0, $this->conf->align, $this->conf->fill);
+		#$this->pdf->objPdf->Cell($this->conf->width, $this->conf->height, utf8_decode($this->value), $this->conf->border, 0, $this->conf->align, $this->conf->fill);
+		//use MultiCell for line breaks after cell end is reached
+		$this->pdf->objPdf->MultiCell($this->conf->width, $this->conf->height, utf8_decode($this->value), $this->conf->border, $this->conf->align, $this->conf->fill);
 	}
 }
 



More information about the Mapbender_commits mailing list