[Mapbender-commits] r10015 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Dec 14 03:52:12 PST 2018
Author: armin11
Date: 2018-12-14 03:52:12 -0800 (Fri, 14 Dec 2018)
New Revision: 10015
Modified:
trunk/mapbender/http/php/mod_mobileClientQr.php
Log:
some more functions
Modified: trunk/mapbender/http/php/mod_mobileClientQr.php
===================================================================
--- trunk/mapbender/http/php/mod_mobileClientQr.php 2018-12-14 11:01:33 UTC (rev 10014)
+++ trunk/mapbender/http/php/mod_mobileClientQr.php 2018-12-14 11:52:12 UTC (rev 10015)
@@ -18,6 +18,7 @@
require_once dirname(__FILE__) . "/../../core/globalSettings.php";
require_once dirname(__FILE__) . "/../extensions/phpqrcode/phpqrcode.php";
$pathExtension = "";
+$return = "default";
if (isset($_REQUEST["pathExtension"]) & $_REQUEST["pathExtension"] != "") {
//validate to de, en, fr
$testMatch = $_REQUEST["pathExtension"];
@@ -29,6 +30,18 @@
$pathExtension = $testMatch;
$testMatch = NULL;
}
+if (isset($_REQUEST["return"]) & $_REQUEST["return"] != "") {
+ //validate to de, en, fr
+ $testMatch = $_REQUEST["return"];
+ if (!($testMatch == 'applicationlink' or $testMatch == 'imagelink')){
+ //echo 'languageCode: <b>'.$testMatch.'</b> is not valid.<br/>';
+ echo 'Parameter <b>return</b> is not valid ("applicationlink","imagelink").<br/>';
+ die();
+ }
+ $return = $testMatch;
+ $testMatch = NULL;
+}
+
$filename = "qr_mobileclient.png";
//generate qr on the fly in tmp folder
//link to invoke wmc per get api if wrapper path isset
@@ -35,11 +48,24 @@
if (defined("MAPBENDER_PATH") && MAPBENDER_PATH != "") {
$invokeLink = MAPBENDER_PATH."/extensions/mobilemap2/index.html";
QRcode::png($invokeLink,TMPDIR."/".$filename);
- $htmlElement = "<a href = '".$invokeLink."'><img src='$pathExtension".TMPDIR."/".$filename."'></a>";
+ $htmlElement = "<a href='".$invokeLink."' target='_blank'><img src='$pathExtension".TMPDIR."/".$filename."'></a>";
} else {
echo "MAPBENDER_PATH not defined in mapbender.conf - please define it to activate linkage and qr code!";
die();
}
+
+switch ($return) {
+ case "imagelink":
+ echo $pathExtension.TMPDIR."/".$filename;
+ break;
+ case "applicationlink":
+ echo $invokeLink;
+ break;
+ case "default":
+ echo $htmlElement;
+ break;
+}
+
//echo html image tag with link to mobile client
-echo $htmlElement;
+//echo $htmlElement;
?>
More information about the Mapbender_commits
mailing list