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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jun 2 02:53:26 PDT 2016


Author: verenadiewald
Date: 2016-06-02 02:53:25 -0700 (Thu, 02 Jun 2016)
New Revision: 9504

Modified:
   trunk/mapbender/http/plugins/mb_metadata_server.php
   trunk/mapbender/http/plugins/mb_metadata_wmc_edit.js
   trunk/mapbender/http/plugins/mb_metadata_wmc_edit.php
   trunk/mapbender/http/plugins/mb_metadata_wmc_server.php
Log:
hint for user if wmc preview image has been uploaded

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2016-06-01 14:35:32 UTC (rev 9503)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2016-06-02 09:53:25 UTC (rev 9504)
@@ -449,7 +449,7 @@
 			$i++;
 		}
         // check for preview image
-        if (file_exists(PREVIEW_DIR."/".$layerId."_layer_map_preview.jpg")) {
+        if (file_exists(PREVIEW_DIR."/".$layerId."_layer_map_preview.jpg") || file_exists(PREVIEW_DIR."/".$layerId."_layer_map_preview.png")) {
             $resultObj['hasPreview']= true;
         } else {
             $resultObj['hasPreview']= false;

Modified: trunk/mapbender/http/plugins/mb_metadata_wmc_edit.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wmc_edit.js	2016-06-01 14:35:32 UTC (rev 9503)
+++ trunk/mapbender/http/plugins/mb_metadata_wmc_edit.js	2016-06-02 09:53:25 UTC (rev 9504)
@@ -81,6 +81,13 @@
                 that.valid();
                 that.enableResetButton();
                 that.enableShowMetadataLink();
+                // check for preview
+             	if (obj.hasPreview === true) {
+             		$("#previewImgUpload .hasPreviewImage").css('display','inline-block');
+             	} 
+             	else {
+             		$("#previewImgUpload .hasPreviewImage").css('display','none');
+             	}
             }
         });
         req.send();

Modified: trunk/mapbender/http/plugins/mb_metadata_wmc_edit.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wmc_edit.php	2016-06-01 14:35:32 UTC (rev 9503)
+++ trunk/mapbender/http/plugins/mb_metadata_wmc_edit.php	2016-06-02 09:53:25 UTC (rev 9504)
@@ -69,6 +69,7 @@
 				<div id="previewImgUpload">
 					<form id="previewImgForm" action='../php/mb_metadata_uploadLayerPreview.php' enctype="multipart/form-data">
 						<input type="file" name="image">
+						<span style="display:none;color:green" class="hasPreviewImage">Vorschaubild vorhanden</span>
 						<input type="submit" value="Upload">
 						<input type="hidden" name="source_id" value="source_id" >
 						<div id="upload"></div>

Modified: trunk/mapbender/http/plugins/mb_metadata_wmc_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wmc_server.php	2016-06-01 14:35:32 UTC (rev 9503)
+++ trunk/mapbender/http/plugins/mb_metadata_wmc_server.php	2016-06-02 09:53:25 UTC (rev 9504)
@@ -128,6 +128,14 @@
 			$resultObj["customCats"][]= $row["fkey_custom_category_id"];
 		}
 		
+		// check for preview image
+		if (file_exists(PREVIEW_DIR."/".$wmcId."_wmc_preview.jpg") || file_exists(PREVIEW_DIR."/".$wmcId."_wmc_preview.png")) {
+			$resultObj['hasPreview']= true;
+		} 
+		else {
+			$resultObj['hasPreview']= false;
+		}
+		
 		$ajaxResponse->setResult($resultObj);
 		$ajaxResponse->setSuccess(true);
 		break;



More information about the Mapbender_commits mailing list