[Mapbender-commits] r7976 - branches/2.7/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jul 19 09:20:06 EDT 2011


Author: astrid_emde
Date: 2011-07-19 06:20:06 -0700 (Tue, 19 Jul 2011)
New Revision: 7976

Modified:
   branches/2.7/http/plugins/mb_print.php
Log:
merged

Modified: branches/2.7/http/plugins/mb_print.php
===================================================================
--- branches/2.7/http/plugins/mb_print.php	2011-07-19 13:07:06 UTC (rev 7975)
+++ branches/2.7/http/plugins/mb_print.php	2011-07-19 13:20:06 UTC (rev 7976)
@@ -19,7 +19,7 @@
  * > 2,1,'pdf print','Print','div','','',1,1,2,2,5,'',
  * > '<div id="printPDF_working_bg"></div><div id="printPDF_working"><img src="../img/indicator_wheel.gif" style="padding:10px 0 0 10px">Generating PDF</div><div id="printPDF_input"><form id="printPDF_form" action="../print/printFactory.php"><div id="printPDF_selector"></div><div class="print_option"><input type="hidden" id="map_url" name="map_url" value=""/><input type="hidden" id="legend_url" name="legend_url" value=""/><input type="hidden" id="overview_url" name="overview_url" value=""/><input type="hidden" id="map_scale" name="map_scale" value=""/><input type="hidden" name="measured_x_values" /><input type="hidden" name="measured_y_values" /><br /></div><div class="print_option" id="printPDF_formsubmit"><input id="submit" type="submit" value="Print"><br /></div></form><div id="printPDF_result"></div></div>',
  * > 'div','../plugins/mb_print.php',
- * > '../../lib/printbox.js,../extensions/jquery-ui-1.7.2.custom/development-bundle/external/bgiframe/jquery.bgiframe.min.js,../extensions/jquery.form.min.js',
+ * > '../../lib/printbox.js,../extensions/jquery-ui-1.7.2.custom/development-bundle/external/bgiframe/jquery.bgiframe.js,../extensions/jquery.form.min.js',
  * > 'mapframe1','','http://www.mapbender.org/index.php/Print');
  * >
  * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, 
@@ -42,8 +42,8 @@
  * > var_value, context, var_type) VALUES('<appId>', 'printPDF',
  * > 'timeout', '90000', 'define maximum milliseconds to wait for print request finished' ,'var');
  * >
- * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, 
- * > var_value, context, var_type) VALUES('<appId>', 'body', 
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name,
+ * > var_value, context, var_type) VALUES('<appId>', 'body',
  * > 'print_css', '../css/print_div.css', '' ,'file/css');
  * 
  * Help:
@@ -126,7 +126,7 @@
 			printBox.repaint();
 		}
 	});
-        /**
+	/**
  	 * Method: createPrintBox
 	 * 
 	 * creates a printBox in the current view, calculates the scale 
@@ -232,7 +232,7 @@
                 $("."+myId+"-dialog").bind("dialogclose", function () {
                     destroyPrintBox();
                 });
-        };
+	};
 
 	/**
  	 * Method: loadConfig
@@ -244,7 +244,7 @@
 		// either json or a string, which trips up $.parseJSON which was being used in the callback
 		$.get(mbPrintConfigPath + configFilename, function(json, status){
 		    actualConfig = json;
-                    buildForm();
+		    buildForm(); 
 		    hookForm();
 			if (typeof callback === "function") {
 				printBox = null;
@@ -260,7 +260,7 @@
 	 * utility method to connect the form plugin to the print form.
 	 */	
 	var hookForm = function () {
-        	var o = {
+		var o = {
 	   		url:			'../print/printFactory.php?e_id='+myId,
 	   		type:			'post',
 	   		dataType:		'json',
@@ -273,7 +273,6 @@
                                 destroyPrintBox();
                         }
 		};
-                
 		$("#"+myId+"_form").ajaxForm(o);
 	};
 	
@@ -412,7 +411,7 @@
 							layerLegendObj.name = currentLayer.layer_name;
 							layerLegendObj.title = currentWms.getTitleByLayerName(currentLayer.layer_name);
 							var layerStyle = currentWms.getCurrentStyleByLayerName(currentLayer.layer_name);
-							if (layerStyle === false) {
+							if (layerStyle === false || layerStyle === "") {
 								layerStyle = "default";
 							}
 							layerLegendObj.legendUrl = currentWms.getLegendUrlByGuiLayerStyle(currentLayer.layer_name, layerStyle);
@@ -425,11 +424,13 @@
 						var tmpObj = {};
 						tmpObj[currentWms.wms_currentTitle] = wmsLegendObj;
 						legendUrlArray.push(tmpObj);
+					
 					}
 				}
 			}
 		}
-		updateFormField(formData, "legend_url", $.toJSON(legendUrlArray));
+		var legendUrlArrayJson =  $.toJSON(legendUrlArray));
+		updateFormField(formData, "legend_url", legendUrlArrayJson);
 		updateFormField(formData, "map_url", f.map_url.value);
 		updateFormField(formData, "scale", scale);
 		
@@ -563,7 +564,7 @@
 					return false;
 				}
 				var scale = parseInt(this.value, 10);
-                                if (isNaN(scale) || typeof printBox === "undefined") {
+				if (isNaN(scale) || typeof printBox === "undefined") {
 					return true;
 				}
 				printBox.setScale(scale);



More information about the Mapbender_commits mailing list