[Mapbender-commits] r1276 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Apr 25 04:26:24 EDT 2007


Author: christoph
Date: 2007-04-25 04:26:24 -0400 (Wed, 25 Apr 2007)
New Revision: 1276

Added:
   trunk/mapbender/http/php/mod_createJSObjFromDBByWMS.php
Log:
loads a configured WMS from a GUI

Added: trunk/mapbender/http/php/mod_createJSObjFromDBByWMS.php
===================================================================
--- trunk/mapbender/http/php/mod_createJSObjFromDBByWMS.php	                        (rev 0)
+++ trunk/mapbender/http/php/mod_createJSObjFromDBByWMS.php	2007-04-25 08:26:24 UTC (rev 1276)
@@ -0,0 +1,63 @@
+<?php
+# $Id: mod_createJSObjFromDBByWMS.php 1199 2007-03-07 10:06:22Z christoph $
+# http://www.mapbender.org/index.php/mod_createJSObjectFromDBByWMS.php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../classes/class_wms.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+
+$wms_id = $_GET["wms_id"];
+$gui_id = $_GET["gui_id"];
+$user_id = $_SESSION["mb_user_id"];
+
+?>
+<!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
+// check if user is allowed to access this wms
+$admin = new administration();
+if ($admin->getWmsPermission($wms_id, $user_id)) {
+	$mywms = new wms();
+	$mywms->createObjFromDB($gui_id, $wms_id);
+	$mywms->createJsObjFromWMS(true);
+	echo "parent.mod_addWMS_refresh();";
+}
+else {
+	$e = new mb_exception("You are not allowed to access this WMS (WMS ID " . $wms_id . ").");
+}
+?>
+</script>
+<!--
+<script language="JavaScript" type="text/javascript">
+alert("3/3 mod_createJSObjFromDBByWMS: WMS ID = <?php echo $wms_id;?>, GUI ID = <?php echo $gui_id;?>");
+</script>
+-->
+</head>
+<body bgcolor='#ffffff'>
+</body>
+</html>
\ No newline at end of file



More information about the Mapbender_commits mailing list