[Mapbender-commits] r9670 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jan 24 01:02:33 PST 2017


Author: armin11
Date: 2017-01-24 01:02:33 -0800 (Tue, 24 Jan 2017)
New Revision: 9670

Modified:
   trunk/mapbender/http/plugins/mb_metadata_manager_select.js
   trunk/mapbender/http/plugins/mb_metadata_manager_server.php
Log:
Fixes for metadata table: empty list if filter give no values, no sorting option for columns, open metadata html previews in dialog

Modified: trunk/mapbender/http/plugins/mb_metadata_manager_select.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_manager_select.js	2017-01-23 18:55:26 UTC (rev 9669)
+++ trunk/mapbender/http/plugins/mb_metadata_manager_select.js	2017-01-24 09:02:33 UTC (rev 9670)
@@ -20,7 +20,6 @@
  */
 
 var $metadataManagerSelect = $(this);
-//$metadataManagerSelect.prepend("<img src='../img/indicator_wheel.gif'>");
 
 var MetadataManagerSelectApi = function (o) {
 	var table = null;
@@ -193,18 +192,7 @@
 				"targets": [0,1,2,3],
 				"orderable": false
 			} ],
-			/*"columnDefs": [
-    				{ "orderable": false },
-				{ "orderable": false },
-				{ "orderable": false },
-				{ "orderable": false, "targets": 3 },
-				{ "orderable": false, "targets": 4 },
-				{ "orderable": false, "targets": 5 },
-				{ "orderable": false, "targets": 6 },
-				{ "orderable": false, "targets": 7 },
-				{ "orderable": false, "targets": 8 },
-				{ "orderable": false, "targets": 9 }
-  			],*/
+			"bSort" : false,
 			"fnServerParams": function ( aoData ) {
 				var params = {}; //JSON.stringify(aoData);
 				for(var i in aoData) {
@@ -233,8 +221,6 @@
 			"fnCreatedRow": function( nRow, aData, iDataIndex ) {
       				// define a metadataId to row
 				var metadataId = aData[0];
-				//data.shift();
-				//var rowNode = table.fnGetNodes(iDataIndex);
 				$(nRow).data("metadataId", metadataId);
     			},
 			"fnDrawCallback": function( oSettings ) {
@@ -256,6 +242,26 @@
 					that.toggleSearchability(id);
 					return false;
 				});
+				// add option to open metadata windows in a modal dialog
+				$(".modalDialog").click(function (e) {
+					var iframe = $('<iframe width="100%" height="100%" frameborder="0" scrolling="yes" style="min-width: 95%;height:100%;"></iframe>');
+					iframe.attr('src', String($(this).attr('url')));
+    					var dialog = $("<div></div>").append(iframe).dialog({
+        					autoOpen: true,
+        					modal: true,
+        					resizable: false,
+        					width: 600,
+        					height: 400,
+        					close: function () {
+            						iframe.attr("src", "");
+        					}
+    					});
+				});
+				// change style to link optic
+				$(".modalDialog").css("text-decoration", "underline");
+				$(".modalDialog").css("text-decoration-color", "blue");
+				$(".modalDialog").css("color", "blue");
+				$(".modalDialog").css("cursor", "pointer");
     			},
 			"bJQueryUI": true
     		} );

Modified: trunk/mapbender/http/plugins/mb_metadata_manager_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_manager_server.php	2017-01-23 18:55:26 UTC (rev 9669)
+++ trunk/mapbender/http/plugins/mb_metadata_manager_server.php	2017-01-24 09:02:33 UTC (rev 9670)
@@ -50,7 +50,8 @@
 	//preview with uuid
 	$row[0] = $row[0];
 	$row[1] = $row[1];
-	$row[2] = "<a class='modalDialog' target='_blank' id='metadata_".$row[0]."' href='../php/mod_exportIso19139.php?url=".urlencode(MAPBENDER_PATH."/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row[2])."'>".$row[2]."</a>";
+	//$row[2] = "<a class='modalDialog' target='_blank' id='metadata_".$row[0]."' href='../php/mod_exportIso19139.php?url=".urlencode(MAPBENDER_PATH."/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row[2])."'>".$row[2]."</a>";
+	$row[2] = "<a class='modalDialog' id='metadata_".$row[0]."' url='../php/mod_exportIso19139.php?url=".urlencode(MAPBENDER_PATH."/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row[2])."'>".$row[2]."</a>";
 	$row[3] = $row[3];
 	$row[4] = $row[4];
 	$coupledResourceRow = 5;
@@ -59,7 +60,8 @@
 	//get layer list
 	$numberLayers = 0;
 	foreach ($coupledResources->coupledResources->layerIds as $layerId) {
-		$row[$coupledResourceRow] .= "<a class='modalDialog' target='_blank' id='layer_".$row[0]."_".$numberLayers."' href='../php/mod_showMetadata.php?languageCode=de&resource=layer&id=".$layerId."'>".$layerId."</a>".", ";
+		//$row[$coupledResourceRow] .= "<a class='modalDialog' target='_blank' id='layer_".$row[0]."_".$numberLayers."' href='../php/mod_showMetadata.php?languageCode=de&resource=layer&id=".$layerId."'>".$layerId."</a>".", ";
+		$row[$coupledResourceRow] .= "<a class='modalDialog' id='layer_".$row[0]."_".$numberLayers."' url='../php/mod_showMetadata.php?languageCode=de&resource=layer&id=".$layerId."'>".$layerId."</a>".", ";
 		$numberLayers++;
 	}
 	$row[$coupledResourceRow] = rtrim($row[$coupledResourceRow], ', ');
@@ -70,7 +72,8 @@
 	//get featuretype list
 	$numberFeaturetypes = 0;
 	foreach ($coupledResources->coupledResources->featuretypeIds as $featuretypeId) {
-		$row[$coupledResourceRow+1] .= "<a class='modalDialog'  target='_blank' id='featuretype_".$row[0]."_".$numberFeaturetypes."' href='../php/mod_showMetadata.php?languageCode=de&resource=featuretype&id=".$featuretypeId."'>".$featuretypeId."</a>".", ";
+		//$row[$coupledResourceRow+1] .= "<a class='modalDialog'  target='_blank' id='featuretype_".$row[0]."_".$numberFeaturetypes."' href='../php/mod_showMetadata.php?languageCode=de&resource=featuretype&id=".$featuretypeId."'>".$featuretypeId."</a>".", ";
+		$row[$coupledResourceRow+1] .= "<a class='modalDialog' id='featuretype_".$row[0]."_".$numberFeaturetypes."' url='../php/mod_showMetadata.php?languageCode=de&resource=featuretype&id=".$featuretypeId."'>".$featuretypeId."</a>".", ";
 		$numberFeaturetypes++;
 	}
 	$row[$coupledResourceRow+1] = rtrim($row[$coupledResourceRow+1], ', ');
@@ -356,6 +359,9 @@
 		while ($row = db_fetch_row($res)) {
 			$resultObj["aaData"][] = parseMetadataRow($row, $withOutFirstColumn);
 		}
+		if ($highLevelObj["iTotalDisplayRecords"] == 0) {
+			$resultObj["aaData"] = array();
+		}
 		$ajaxResponse->setResult($resultObj);
 		$ajaxResponse->setHighLevelAttributes($highLevelObj);
 		$ajaxResponse->setSuccess(true);



More information about the Mapbender_commits mailing list