[Mapbender-commits] r4865 - in branches/2.6/http: javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Oct 27 09:34:27 EDT 2009


Author: christoph
Date: 2009-10-27 09:34:27 -0400 (Tue, 27 Oct 2009)
New Revision: 4865

Modified:
   branches/2.6/http/javascripts/wms.js
   branches/2.6/http/php/mod_createJSLayerObjFromXML.php
   branches/2.6/http/php/mod_createJSObjFromDBByWMS.php
   branches/2.6/http/php/mod_createJSObjFromXML.php
Log:


Modified: branches/2.6/http/javascripts/wms.js
===================================================================
--- branches/2.6/http/javascripts/wms.js	2009-10-27 13:33:48 UTC (rev 4864)
+++ branches/2.6/http/javascripts/wms.js	2009-10-27 13:34:27 UTC (rev 4865)
@@ -115,6 +115,7 @@
 	this.wms_id = wms_id;
 	this.wms_version = wms_version;
 	this.wms_title = wms_title;
+	this.wms_currentTitle = wms_title;
 	this.wms_abstract = wms_abstract;
 	this.wms_getmap = wms_getmap;
 	this.wms_getfeatureinfo = wms_getfeatureinfo;
@@ -736,6 +737,7 @@
 	this.layer_parent = layer_parent;
 	this.layer_name = layer_name;
 	this.layer_title = layer_title;
+	this.layer_currentTitle = layer_title;
 	this.layer_dataurl_href = layer_dataurl_href;
 	this.layer_pos = layer_pos;
 	this.layer_queryable = layer_queryable;

Modified: branches/2.6/http/php/mod_createJSLayerObjFromXML.php
===================================================================
--- branches/2.6/http/php/mod_createJSLayerObjFromXML.php	2009-10-27 13:33:48 UTC (rev 4864)
+++ branches/2.6/http/php/mod_createJSLayerObjFromXML.php	2009-10-27 13:34:27 UTC (rev 4865)
@@ -19,28 +19,59 @@
 
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 require_once(dirname(__FILE__)."/../classes/class_wms.php");
-?>
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+
+$capabilitiesURL = $_REQUEST['caps'];
+$layerName = $_REQUEST['layerName'];
+$noHtml = intval($_GET["noHtml"]);
+
+$output = "";
+$charset = CHARSET;
+
+$mywms = new wms();
+$mywms->createObjFromXML($capabilitiesURL);
+
+$errorMessage = _mb("Error: The Capabilities Document could not be accessed. " . 
+	"Please check whether the server is responding and accessible to " . 
+	"Mapbender.");
+if (!$mywms->wms_status) { 
+	$output .= "try {" . 
+		"Mapbender.Modules.dialogManager.openDialog({" . 
+		"content: '" . $errorMessage . "<br><br><b>" . $capabilitiesURL . 
+		"', modal: false, effectShow: 'puff'});" . 
+		"} catch (e) {" . 
+		"prompt('" . $errorMessage . "', '" . $capabilitiesURL . "');" . 
+		"}";
+}
+else {
+	$output .= $mywms->createJsLayerObjFromWMS("TRUE", $layerName);
+}
+
+$js = administration::convertOutgoingString($output);
+unset($output);
+
+if ($noHtml) {
+	echo $js;
+}
+else {
+
+	$js .= "parent.mod_addWMS_refresh();";
+	echo <<<HTML
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
+<title>Load WMS</title>
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>Load WMS with one layer</title>
-<?php
-echo "<script type='text/javascript'>";
-$mywms = new wms();
-$mywms->createObjFromXML(html_entity_decode($_REQUEST['caps']));
-if(!$mywms->wms_status){ echo "alert('Error: The Capabilities Document " . html_entity_decode($_REQUEST['caps']) . " could not be accessed. Please check whether the server is responding and accessible to Mapbender.'); </script>"; die; }
-$mywms->createJsLayerObjFromWMS("TRUE", $_REQUEST['layer_name']);
-echo "parent.mod_addWMS_refresh();";
-echo "</script>";
-?>
+<meta http-equiv="Content-Type" content="text/html; charset='$charset'">	
+<script type='text/javascript'>
+$js
+</script>
 </head>
-<body bgcolor='#ffffff'>
+<body>
+</body>
+</html>
+HTML;
 
-</body>
-</html>
\ No newline at end of file
+}

Modified: branches/2.6/http/php/mod_createJSObjFromDBByWMS.php
===================================================================
--- branches/2.6/http/php/mod_createJSObjFromDBByWMS.php	2009-10-27 13:33:48 UTC (rev 4864)
+++ branches/2.6/http/php/mod_createJSObjFromDBByWMS.php	2009-10-27 13:34:27 UTC (rev 4865)
@@ -22,19 +22,11 @@
 require_once(dirname(__FILE__)."/../classes/class_administration.php");
 
 $wms_id = $_GET["wms_id"];
+$gui_id = $_GET["gui_id"];
 $user_id = $_SESSION["mb_user_id"];
+$noHtml = intval($_GET["noHtml"]);
 
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<meta http-equiv="Content-Type" content="text/html; charset='<?php echo CHARSET;?>'">	
-<title>Load WMS with one layer</title>
-<script language="JavaScript" type="text/javascript">
-<?php
+$js = "";
 // check if user is allowed to access this wms
 $admin = new administration();
 if ($admin->getWmsPermission($wms_id, $user_id)) {
@@ -46,16 +38,38 @@
 		$mywms->createObjFromDBNoGui($wms_id);	
 	}
 	$output = $mywms->createJsObjFromWMS_(true);
-	echo administration::convertOutgoingString($output);
+	$js .= administration::convertOutgoingString($output);
 	unset($output);
-	echo "parent.mod_addWMS_refresh();";
 }
 else {
 	$e = new mb_exception("You are not allowed to access this WMS (WMS ID " . $wms_id . ").");
 }
-?>
+
+if ($noHtml) {
+	echo $js;
+}
+else {
+	$js .= "parent.mod_addWMS_refresh();";
+	
+	$charset = CHARSET;
+	echo <<<HTML
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<meta http-equiv="Content-Type" content="text/html; charset='$charset'">	
+<title>Load WMS with one layer</title>
+<script language="JavaScript" type="text/javascript">
+$js
 </script>
 </head>
 <body bgcolor='#ffffff'>
 </body>
 </html>
+HTML;
+}
+
+

Modified: branches/2.6/http/php/mod_createJSObjFromXML.php
===================================================================
--- branches/2.6/http/php/mod_createJSObjFromXML.php	2009-10-27 13:33:48 UTC (rev 4864)
+++ branches/2.6/http/php/mod_createJSObjFromXML.php	2009-10-27 13:34:27 UTC (rev 4865)
@@ -21,8 +21,41 @@
 require_once(dirname(__FILE__)."/../classes/class_wms.php");
 require_once(dirname(__FILE__)."/../classes/class_administration.php");
 
-$capabilitiesURL = html_entity_decode($_REQUEST['caps']);
-?>
+$capabilitiesURL = $_REQUEST['caps'];
+$noHtml = intval($_GET["noHtml"]);
+
+$output = "";
+$charset = CHARSET;
+
+$mywms = new wms();
+$mywms->createObjFromXML($capabilitiesURL);
+
+$errorMessage = _mb("Error: The Capabilities Document could not be accessed. " . 
+	"Please check whether the server is responding and accessible to " . 
+	"Mapbender.");
+if (!$mywms->wms_status) { 
+	$output .= "try {" . 
+		"Mapbender.Modules.dialogManager.openDialog({" . 
+		"content: '" . $errorMessage . "<br><br><b>" . $capabilitiesURL . 
+		"', modal: false, effectShow: 'puff'});" . 
+		"} catch (e) {" . 
+		"prompt('" . $errorMessage . "', '" . $capabilitiesURL . "');" . 
+		"}";
+}
+else {
+	$output .= $mywms->createJsObjFromWMS_(true);
+}
+$js = administration::convertOutgoingString($output);
+unset($output);
+
+if ($noHtml) {
+
+	echo $js;
+}
+else {
+
+	$js .= "parent.mod_addWMS_refresh();";
+	echo <<<HTML
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
@@ -30,26 +63,14 @@
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="expires" content="0">
-<meta http-equiv="Content-Type" content="text/html; charset='<?php echo CHARSET;?>'">	
+<meta http-equiv="Content-Type" content="text/html; charset='$charset'">	
 <script type='text/javascript'>
-<?php
-
-$mywms = new wms();
-$mywms->createObjFromXML($capabilitiesURL);
-
-$errorMessage = "Error: The Capabilities Document could not be accessed. Please check whether the server is responding and accessible to Mapbender.";
-if (!$mywms->wms_status) { 
-	echo "prompt('" . $errorMessage . "', '" . $capabilitiesURL . "');"; 
-	die; 
-}
-$output = $mywms->createJsObjFromWMS_(true);
-echo administration::convertOutgoingString($output);
-unset($output);
-?>
-
-parent.mod_addWMS_refresh();
+$js
 </script>
 </head>
-<body bgcolor='#ffffff'>
+<body>
 </body>
 </html>
+HTML;
+
+}



More information about the Mapbender_commits mailing list