[Mapbender-commits] r1200 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Mar 7 05:07:57 EST 2007
Author: christoph
Date: 2007-03-07 05:07:57 -0500 (Wed, 07 Mar 2007)
New Revision: 1200
Modified:
trunk/mapbender/http/php/mod_createJSObjFromXML.php
Log:
some refactoring
Modified: trunk/mapbender/http/php/mod_createJSObjFromXML.php
===================================================================
--- trunk/mapbender/http/php/mod_createJSObjFromXML.php 2007-03-07 10:06:22 UTC (rev 1199)
+++ trunk/mapbender/http/php/mod_createJSObjFromXML.php 2007-03-07 10:07:57 UTC (rev 1200)
@@ -18,31 +18,35 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../classes/class_wms.php");
+
+$capabilitiesURL = html_entity_decode($_REQUEST['caps']);
?>
<!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">
+<meta http-equiv="Content-Type" content="text/html; charset='<?php echo CHARSET;?>'">
+<script type='text/javascript'>
<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
-?>
-<title>Load WMS</title>
-<?php
-echo "<script type='text/javascript'>";
-require_once(dirname(__FILE__)."/../classes/class_wms.php");
+
$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->optimizeWMS();
-$mywms->createJsObjFromWMS("TRUE");
+$mywms->createObjFromXML($capabilitiesURL);
-echo "parent.mod_addWMS_refresh();";
-echo "</script>";
+$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;
+}
+$mywms->createJsObjFromWMS(true);
?>
+
+parent.mod_addWMS_refresh();
+</script>
</head>
<body bgcolor='#ffffff'>
-
</body>
-</html>
+</html>
\ No newline at end of file
More information about the Mapbender_commits
mailing list