svn commit: r910 - trunk/mapbender/http/php/mod_addWmsFromFeatureInfo.php

christoph at osgeo.org christoph at osgeo.org
Tue Nov 21 05:11:13 EST 2006


Author: christoph
Date: 2006-11-21 10:11:12+0000
New Revision: 910

Modified:
   trunk/mapbender/http/php/mod_addWmsFromFeatureInfo.php

Log:
fixed wms index in function call

Modified: trunk/mapbender/http/php/mod_addWmsFromFeatureInfo.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_addWmsFromFeatureInfo.php?view=diff&rev=910&p1=trunk/mapbender/http/php/mod_addWmsFromFeatureInfo.php&p2=trunk/mapbender/http/php/mod_addWmsFromFeatureInfo.php&r1=909&r2=910
==============================================================================
--- trunk/mapbender/http/php/mod_addWmsFromFeatureInfo.php	(original)
+++ trunk/mapbender/http/php/mod_addWmsFromFeatureInfo.php	2006-11-21 10:11:12+0000
@@ -18,14 +18,14 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 import_request_variables("PG");
-require_once("../php/mb_validateSession.php");
-require_once("../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
 $con = db_connect($DBSERVER,$OWNER,$PW);
 db_select_db(DB,$con);
 $gui_id = $_SESSION["mb_user_gui"];
 
 $e_id_css = 'addWmsFromFeatureInfo';
-include('../include/dyn_js.php');
+include(dirname(__FILE__).'/../include/dyn_js.php');
 
 $sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = $1 AND fkey_gui_id = $2 ";
 $v = array($e_id_css,$gui_id);
@@ -68,6 +68,8 @@
 	}
 }
 function addWmsFromInfo_pos(){
-	mb_wmsMoveByIndex(getMapObjIndexByName(mod_target), mb_mapObj[getMapObjIndexByName(mod_target)].wms.length-1, mod_addWmsFromFeatureInfo_position-1);
+	if (mod_addWmsFromFeatureInfo_position > 0 && mod_addWmsFromFeatureInfo_position < mb_mapObj[getMapObjIndexByName(mod_target)].wms.length-1) {
+		mb_wmsMoveByIndex(getMapObjIndexByName(mod_target), mb_mapObj[getMapObjIndexByName(mod_target)].wms.length-1, mod_addWmsFromFeatureInfo_position-1);
+	}
 	mb_removeFunctionFromArray("mb_loadWmsSubFunctions", "addWmsFromInfo_pos()");	
 }
\ No newline at end of file




More information about the Mapbender_commits mailing list