[Mapbender-commits] r1769 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Oct 29 08:43:58 EDT 2007


Author: christoph
Date: 2007-10-29 08:43:58 -0400 (Mon, 29 Oct 2007)
New Revision: 1769

Modified:
   trunk/mapbender/http/javascripts/mod_loadwmc.php
Log:
imported from Geoportal

Modified: trunk/mapbender/http/javascripts/mod_loadwmc.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.php	2007-10-29 12:41:26 UTC (rev 1768)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.php	2007-10-29 12:43:58 UTC (rev 1769)
@@ -37,41 +37,79 @@
 if($cnt > 1){
 	echo "alert('loadwmc: ID not unique!');";
 }
+$e_id_css = "loadwmc";
+include("../include/dyn_js.php");
 
 echo "mod_loadwmc_target = '".$e_target."';";
 
+/*
+// this may be added at a later stage
+if ($new_wmc == 1) {
+	include("../generate_defaultWmc.php");
+	$startup = true;
+	$e = new mb_notice("loadwmc: new wmc");
+}
+else {
+	$startup = false;
+	$e = new mb_notice("loadwmc: old wmc");
+}
+if ($gui_changed == 0) {
+	if ($_REQUEST['portal_services']) {
+		$e = new mb_notice("loadwmc: merging layers");
+		include("../merge_layers.php");
+	}
+	if ($_SESSION['GML']) {
+		$e = new mb_notice("loadwmc: merging bbox");
+		include("../merge_bbox.php");
+	}
+}
+*/
 ?>
-
 function load_wmc_session() {
 	<?php
-		if (isset($_SESSION['mb_wmc']) && !empty($_SESSION['mb_wmc'])) {
+		if (isset($_SESSION['mb_wmc'])) {
 			$wmc = new wmc();
 			if ($wmc->createObjFromWMC_xml($_SESSION['mb_wmc'])) {
-/*
+				$js = "";
 				if ($_SESSION['layer_preview']) {
+//					echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: layer preview');";
 					$js = $wmc->createJsObjFromWMC("", $e_target, "load");
 				}
-				else if ($_SESSION['startup'] == true) {
+				else if ($startup == true) {
+//					echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: load new wmc');";
 					$js = $wmc->createJsObjFromWMC("", $e_target, "merge");
-					$_SESSION['startup'] = false;
+					$startup = false;
 				}		
 				else {
-*/					
+//					echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: load old wmc');";
 					$js = $wmc->createJsObjFromWMC("", $e_target, "load");
-//				}
+				}
 				echo $js;
 			}
+			else {
+				echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: error parsing wmc');";
+			}
 		}
+		else {
+			echo "var e = new Mb_warning('mod_loadwmc: load_wmc_session: no wmc set!');";
+		}
 	?>
 }
-//mb_registerInitFunctions('load_wmc_session()');
 
+try {if (loadFromSession) {}}catch(e) {loadFromSession = 0;}
+
+if (loadFromSession) {
+	mb_registerInitFunctions('load_wmc_session()');
+}
+
 var mod_loadwmc_img = new Image(); mod_loadwmc_img.src = "<?php echo $e_src; ?>";
-//var mod_loadwmc_img_over = new Image(); mod_loadwmc_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src);  ?>";
+//var mod_loadwmc_img_over = new Image(); mod_loadwmc_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
 
+function mod_importWmc(id){
+	alert(id);
+}
 function mod_loadwmc(obj){
-	windowWmc = window.open("../php/mb_listWMCs.php?<?php echo "e_id=".$e_id . "&" . SID;?>","displayWmc","width=500, height=600, scrollbars=yes, dependent=yes");
-	//windowWmc.focus();
+	windowWmc = window.open("../php/mb_listWMCs.php?<?php echo SID;?>","displayWmc","width=500, height=600, scrollbars=yes, dependent=yes");
 }
 function mod_loadwmc_init(obj){
 	//document.getElementById("loadwmc").src = mod_zoom1_img_over.src;



More information about the Mapbender_commits mailing list