[Mapbender-commits] r1938 - in trunk/mapbender/http: frames javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Dec 21 05:10:38 EST 2007


Author: christoph
Date: 2007-12-21 05:10:37 -0500 (Fri, 21 Dec 2007)
New Revision: 1938

Modified:
   trunk/mapbender/http/frames/index.php
   trunk/mapbender/http/javascripts/map.php
   trunk/mapbender/http/php/mod_createJSObjFromDB.php
Log:
optimization, see http://lists.osgeo.org/pipermail/mapbender_dev/2007-December/000950.html

moved WMS creation to map.php, avoids bug "wms.0.gui_wms_epsg has no properties"

Modified: trunk/mapbender/http/frames/index.php
===================================================================
--- trunk/mapbender/http/frames/index.php	2007-12-20 15:06:56 UTC (rev 1937)
+++ trunk/mapbender/http/frames/index.php	2007-12-21 10:10:37 UTC (rev 1938)
@@ -160,7 +160,6 @@
 <?php
 #echo "<script type='text/javascript' src='../javascripts/map.php?gui_id=".$_REQUEST["gui_id"]."&zoomToLayer=".$_REQUEST["zoomToLayer"]."&portal_services=".$_REQUEST['portal_services']."&portal_services_wfs=".$_REQUEST['portal_services_wfs']."&layer_preview=".$_REQUEST['layer_preview']."&".strip_tags(SID)."&mb_myBBOX=".$_REQUEST["mb_myBBOX"]."'></script>";
 echo "<script type='text/javascript' src='../javascripts/map.php?gui_id=".$_REQUEST["gui_id"]."&".strip_tags(SID)."&mb_myBBOX=".$_REQUEST["mb_myBBOX"]."'></script>";
-echo "<script type='text/javascript' src='../php/mod_createJSObjFromDB.php?". strip_tags (SID)."'></script>";
 ?>
 </body>
 </html>
\ No newline at end of file

Modified: trunk/mapbender/http/javascripts/map.php
===================================================================
--- trunk/mapbender/http/javascripts/map.php	2007-12-20 15:06:56 UTC (rev 1937)
+++ trunk/mapbender/http/javascripts/map.php	2007-12-21 10:10:37 UTC (rev 1938)
@@ -19,9 +19,12 @@
 
 session_start();
 
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
 require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+require_once(dirname(__FILE__)."/../classes/class_wms.php");
 
+
 // see http://trac.osgeo.org/mapbender/ticket/79
 ini_set('session.bug_compat_42',0); 
 ini_set('session.bug_compat_warn',0);
@@ -81,6 +84,20 @@
 require_once("../extensions/jqjson.js");
 
 //
+// Load WMS
+// 
+$sql = "SELECT fkey_wms_id FROM gui_wms WHERE fkey_gui_id = $1 ORDER BY gui_wms_position";
+$v = array($_SESSION["mb_user_gui"]);
+$t = array('s');
+$res = db_prep_query($sql,$v,$t);
+
+while($row = db_fetch_array($res)){
+	$mywms = new wms();
+	$mywms->createObjFromDB($_SESSION["mb_user_gui"],$row["fkey_wms_id"]);
+	$mywms->createJsObjFromWMS();
+}
+
+//
 // Load JavaScript modules of GUI elements
 //
 $sql = "SELECT DISTINCT e_mb_mod FROM gui_element WHERE e_public = 1 AND fkey_gui_id = $1";

Modified: trunk/mapbender/http/php/mod_createJSObjFromDB.php
===================================================================
--- trunk/mapbender/http/php/mod_createJSObjFromDB.php	2007-12-20 15:06:56 UTC (rev 1937)
+++ trunk/mapbender/http/php/mod_createJSObjFromDB.php	2007-12-21 10:10:37 UTC (rev 1938)
@@ -17,8 +17,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-ob_start();
-require_once(dirname(__FILE__)."/mb_validateSession.php");
 require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
 require_once(dirname(__FILE__)."/../classes/class_wms.php");
 
@@ -35,4 +33,5 @@
 	$mywms->createObjFromDB($_SESSION["mb_user_gui"],$row["fkey_wms_id"]);
 	$mywms->createJsObjFromWMS();
 }
-?>
\ No newline at end of file
+?>
+//alert("WMS geladen.");
\ No newline at end of file



More information about the Mapbender_commits mailing list