[Mapbender-commits] r1839 - branches/mapbender_sld/http/html

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Nov 23 08:47:33 EST 2007


Author: christoph
Date: 2007-11-23 08:47:33 -0500 (Fri, 23 Nov 2007)
New Revision: 1839

Modified:
   branches/mapbender_sld/http/html/mod_treefolder2.php
Log:
updated treefolder

Modified: branches/mapbender_sld/http/html/mod_treefolder2.php
===================================================================
--- branches/mapbender_sld/http/html/mod_treefolder2.php	2007-11-23 13:46:53 UTC (rev 1838)
+++ branches/mapbender_sld/http/html/mod_treefolder2.php	2007-11-23 13:47:33 UTC (rev 1839)
@@ -58,6 +58,8 @@
 var jst_display_root = false;
 var defaultTarget = 'examplemain';
 var lock=false;
+var lock_update=false;
+var lock_check=false;
 var selectedMap=-1;
 var selectedWMS=-1;
 var selectedLayer=-1;
@@ -74,6 +76,7 @@
 function _foo(){}
 
 // some defaults
+try{if (reverse){}}catch(e){reverse = 'false';}
 try{if (switchwms){}}catch(e){switchwms = 'true';}
 try{if (ficheckbox){}}catch(e){ficheckbox = 'false';}
 try{if (metadatalink){}}catch(e){metadatalink = 'false';}
@@ -81,6 +84,7 @@
 try{if (showstatus){}}catch(e){showstatus = 'false';}
 try{if (alerterror){}}catch(e){alerterror = 'false';}
 try{if (openfolder){}}catch(e){openfolder = 'false';}
+try{if (handlesublayer){}}catch(e){handlesublayer = 'false';}
 try{if (menu){}}catch(e){menu = '';}
 
 //menu elements
@@ -121,19 +125,19 @@
 		if(selectedLayer==0)
 		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
 		else
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_name, '#999999');
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '#999999');
 	}
 	else if(scale > parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_maxscale) && parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_maxscale) != 0){
 		if(selectedLayer==0)
 		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
 		else
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_name, '#999999');
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '#999999');
 	}
 	else{
 		if(selectedLayer==0)
 		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '');
 		else
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_name, '');
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '');
 	}
 
 	selectedMap=i;
@@ -152,19 +156,19 @@
 						if(iii==0)
 						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '#999999');
 						else
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name, '#999999');
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '#999999');
 					}
 					else if(scale > parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_maxscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_maxscale) != 0){
 						if(iii==0)
 						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '#999999');
 						else
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name, '#999999');
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '#999999');
 					}
 					else{
 						if(iii==0)
 						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '');
 						else
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name, '');
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '');
 					}
 				}
 			}
@@ -254,6 +258,8 @@
 	}
 }
 
+//parent.mb_registerWmsLoadErrorFunctions("window.frames['treeGDE'].imgerror();");
+
 function init_mapcheck(){
 	if(!init)return;
 	errors = 0;
@@ -271,11 +277,14 @@
 }
 
 function handleSelectedLayer(mapObj,wms_id,layername,type,status){
-	var mywms = new Array();
-	mywms[0] = wms_id;
-	var mylayername = new Array();
-	mylayername[0] = layername;
-	parent.handleSelectedLayer_array(mapObj, mywms, mylayername, type, status);
+	if(lock_update||lock_check)return;
+	var ind = parent.getMapObjIndexByName(mapObj);
+	for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
+		if(parent.mb_mapObj[ind].wms[i].wms_id == wms_id){
+			parent.mb_mapObj[ind].wms[i].handleLayer(layername, type, status);
+			break;
+		}
+	}
 }
 
 function zoomToLayer(j,k,l){
@@ -319,13 +328,14 @@
 			applyOpacity(wms_id, opacity);
 		}
 	}
+	reloadTree();
 }
 
 function applyOpacity(wms_id, opacity) {
 	if (parent.mb_mapObj[mapObj_id].wms[wms_id].gui_wms_visible > 0) {
 		var divId = 'div_'+wms_id;
 		wmsImage = parent.mapframe1.document.getElementById(divId);
-		if (wmsImage != null) {
+		if (wmsImage != null && !isNaN(opacity)) {
 			wmsImage.style.opacity = (opacity / 100);
 			wmsImage.style.MozOpacity = (opacity / 100);
 			wmsImage.style.KhtmlOpacity = (opacity / 100);
@@ -347,7 +357,7 @@
 //---end------------- opacity --------------------
 
 function move_up(j,k,l){
-	if(!j&&!k&&!l){
+	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
 		j=selectedMap;
 		k=selectedWMS;
 		l=selectedLayer;
@@ -356,95 +366,62 @@
 		alert("You have to select the WMS you want to move up!")		
 		return;
 	}
-	if(l!=0){
-		if(l==1){
-			alert("The Layer you selected is already on top of the WMS");
-			return;
-		}
-			
-		var my = parent.mb_mapObj[j];
-		var upperLayers = my.wms[k].objLayer[l-1];
-		my.wms[k].objLayer[l-1] = my.wms[k].objLayer[l];
-		my.wms[k].objLayer[l] = upperLayers;
-
-		//Reload the mapframe by calling zoom function with factor one
-		treeState = getState();
-		parent.zoom(my.frameName, true, 1.0);
-		parent.mb_execloadWmsSubFunctions();	
-		select(j, k, l-1);
-		selectNode(arrNodes[0][0]+"|"+my.wms[k].wms_id+"|"+my.wms[k].objLayer[l-1].layer_name);
+	var lid=parent.mb_mapObj[j].wms[k].objLayer[l].layer_id;
+	if(!parent.mb_mapObj[j].move(parent.mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?false:true)){
+		alert("Illegal move operation");
 		return;
 	}
-	var previousWMS=-1;
-	for(var i=k-1;i>=0;i--)
-		if(parent.mb_mapObj[j].wms[i].gui_wms_visible=='1'||parent.mb_mapObj[j].wms[i].gui_wms_visible==1){
-			previousWMS=i;
-			break;
+	treeState = getState();
+	parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
+	parent.mb_execloadWmsSubFunctions();
+	//find layer and select
+	for(k=0;k<parent.mb_mapObj[j].wms.length;k++){
+		for(l=0;l<parent.mb_mapObj[j].wms[k].objLayer.length;l++){
+			if(parent.mb_mapObj[j].wms[k].objLayer[l].layer_id==lid){
+				select(j,k,l);
+				if(l!=0)
+					selectNode(String(lid));
+				else
+					selectNode(String(parent.mb_mapObj[j].wms[k].wms_id));
+			}
 		}
-	if(previousWMS==-1){
-		alert("The selected WMS is already on top!")
-		return;
 	}
-	if (parent.mb_swapWmsByIndex(j, previousWMS, k) == true){
-		treeState = getState();
-		parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
-		parent.mb_execloadWmsSubFunctions();	
-		select(j, previousWMS, 0);
-		selectNode(arrNodes[0][0]+"|"+parent.mb_mapObj[j].wms[previousWMS].wms_id);
-	}
 }
 
 function move_down(j,k,l){
-	if(!j&&!k&&!l){
+	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
 		j=selectedMap;
 		k=selectedWMS;
 		l=selectedLayer;
-	}	
+	}
 	if(j==-1||k==-1||l==-1){
 		alert("You have to select the WMS you want to move down!")		
 		return;
 	}
-	if(l!=0){
-		var my = parent.mb_mapObj[j];
-		if(selectedLayer==my.wms[k].objLayer.length-1){
-			alert("The Layer you selected is already on bottom of the WMS");
-			return;
-		}
-			
-		var nextLayers = my.wms[k].objLayer[l+1];
-		my.wms[k].objLayer[l+1] = my.wms[k].objLayer[l];
-		my.wms[k].objLayer[l] = nextLayers;
-
-		//Reload the mapframe by calling zoom function with factor one
-		treeState = getState();
-		parent.zoom(my.frameName, true, 1.0);
-		parent.mb_execloadWmsSubFunctions();
-		select(j, k, l+1);
-		selectNode(arrNodes[0][0]+"|"+my.wms[k].wms_id+"|"+my.wms[k].objLayer[l+1].layer_name);
+	var lid=parent.mb_mapObj[j].wms[k].objLayer[l].layer_id;
+	if(!parent.mb_mapObj[j].move(parent.mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?true:false)){
+		alert("Illegal move operation");
 		return;
 	}
-	var nextWMS=-1;
-	for(var i=k+1;i<parent.mb_mapObj[j].wms.length;i++){
-		if(parent.mb_mapObj[j].wms[i].gui_wms_visible=='1'||parent.mb_mapObj[j].wms[i].gui_wms_visible==1){
-			nextWMS=i;
-			break;
+	treeState = getState();
+	parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
+	parent.mb_execloadWmsSubFunctions();	
+	//find layer and select
+	for(k=0;k<parent.mb_mapObj[j].wms.length;k++){
+		for(l=0;l<parent.mb_mapObj[j].wms[k].objLayer.length;l++){
+			if(parent.mb_mapObj[j].wms[k].objLayer[l].layer_id==lid){
+				select(j,k,l);
+				if(l!=0)
+					selectNode(String(lid));
+				else
+					selectNode(String(parent.mb_mapObj[j].wms[k].wms_id));
+			}
 		}
 	}
-	if(nextWMS==-1){
-		alert("The selected WMS is already on bottom!")
-		return;
-	}
-	if (parent.mb_swapWmsByIndex(j, k, nextWMS) == true){
-		treeState = getState();
-		parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
-		parent.mb_execloadWmsSubFunctions();	
-		select(j, nextWMS, 0);	
-		selectNode(arrNodes[0][0]+"|"+parent.mb_mapObj[j].wms[nextWMS].wms_id);
-	}
 }
 
 function remove_wms(j,k,l){
-	if(!j&&!k&&!l){
+	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
 		j=selectedMap;
 		k=selectedWMS;
 		l=selectedLayer;
@@ -473,37 +450,55 @@
 }
 
 function updateParent(path){
-	if(lock)return;
-	lock=true;
+	if(lock_check)return;
+	var reset_lock=!lock_update; 
+	lock_update=true;
 	var state=getChildrenCheckState(path, 0);
 	//enableCheckbox(path, (state!=-1)); //3rd state
 	checkNode(path, 0, (state==1));
-	if(state==0 && showstatus=='true'){
-/*		var arrPath = path.split(jst_delimiter[0])
-		var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
-		for(var wms=0;wms<parent.mb_mapObj[ind].wms.length;wms++)
-		{
-			if(parent.mb_mapObj[ind].wms[wms].wms_id==arrPath[arrPath.length-1])
-				break;
-		}
-*/		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
-//		state[wms]=-1;
-	}	
-	lock=false;
+	if(state==0 && showstatus=='true' && path.split(jst_delimiter[0]).length == 2){
+		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
+	}
+	if(reset_lock)
+		lock_update=false;
 }
 
 function handleSelectedWMS(path){
-	if(lock)return;
-	lock=true;
+	if(lock_update)return;
+	var t = path.split("|");
+	var reset_lock=!lock_check; 
+	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
+	var layername = parent.mb_mapObj[ind].wms[parent.getWMSIndexById(mod_treeGDE_map,t[t.length-1])].objLayer[0].layer_name;
 	var bChk = IsChecked(path, 0);	
-	enableCheckbox(path, 0, true);
+	handleSelectedLayer(mod_treeGDE_map,t[t.length-1],layername,"visible",bChk?"1":"0");
+	lock_check=true;
 	checkChildren(path, 0, bChk);
 	if(ficheckbox)checkChildren(path, 1, bChk);
 	if(bChk==false && showstatus=='true')
 		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
-	lock=false;
+	if(reset_lock)
+	{
+		lock_check=false;
+		parent.mb_restateLayers(mod_treeGDE_map,t[t.length-1]);
+		parent.setSingleMapRequest(mod_treeGDE_map,t[t.length-1]);
+	}
 }
 
+function handleSelection(path){
+	if(lock_update)return;
+	var reset_lock=!lock_check; 
+	lock_check=true;
+	var bChk = IsChecked(path, 0);	
+//	enableCheckbox(path, 0, true);
+	checkChildren(path, 0, bChk);
+	if(reset_lock){
+		var t = path.split("|");
+		lock_check=false;
+		parent.mb_restateLayers(mod_treeGDE_map,t[1]);
+		parent.setSingleMapRequest(mod_treeGDE_map,t[1]);
+	}
+}
+
 function initArray(){
 	var parentObj = "";
 	var controls="";
@@ -514,29 +509,53 @@
 					if(parent.mb_mapObj[i].wms[ii].gui_wms_visible == '1' || parent.mb_mapObj[i].wms[ii].gui_wms_visible == 1){
 						for(var iii=0; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){          
 							var temp = parent.mb_mapObj[i].wms[ii].objLayer[iii];     
-							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){  
+							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){ 
+								if(!temp.gui_layer_selectable == '1' && !temp.gui_layer_queryable == '1')
+									continue;				
 								var c_menu="[";
-								if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_up,";
-								if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_down,";
+								if(reverse=="true"){
+									if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_up,";
+									if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_down,";
+								}
+								else{
+									if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_up,";
+									if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_down,";
+								}
 								if(menu.indexOf("remove")!=-1)c_menu+="menu_delete,";
 //								if(menu.indexOf("wms_switch")!=-1)c_menu+="menu_wms_switch,";
-								if(menu.indexOf("opacity_up")!=-1)c_menu+="menu_opacity_up,";
-								if(menu.indexOf("opacity_down")!=-1)c_menu+="menu_opacity_down,";
+								if(menu.indexOf("opacity_up")!=-1 && parseFloat(parent.mb_mapObj[i].wms[ii].gui_wms_mapopacity) < 1)c_menu+="menu_opacity_up,";
+								if(menu.indexOf("opacity_down")!=-1 && parseFloat(parent.mb_mapObj[i].wms[ii].gui_wms_mapopacity) > 0)c_menu+="menu_opacity_down,";
 								if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
 								c_menu+="]";
-								if(switchwms=='true') {
-									addNode(arrNodes[0][0],[parent.mb_mapObj[i].wms[ii].wms_id,[temp.layer_title,"javascript:select("+i+","+ii+","+iii+");",,,,eval(c_menu),'<INPUT type="checkbox" checked onclick="handleSelectedWMS(\''+arrNodes[0][0]+'|'+parent.mb_mapObj[i].wms[ii].wms_id+'\');" />',[i,ii,iii]]],false,false);
-								}
-								else {
-									addNode(arrNodes[0][0],[parent.mb_mapObj[i].wms[ii].wms_id,[temp.layer_title,"javascript:select("+i+","+ii+","+iii+");",,,,eval(c_menu),[i,ii,iii]]],false,false);
-								}
+								controls=null;
+								if(switchwms=='true')controls='<INPUT type="checkbox" checked onclick="handleSelectedWMS(\''+arrNodes[0][0]+'|'+parent.mb_mapObj[i].wms[ii].wms_id+'\');" />';
+								if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\'../php/mod_layerMetadata.php?id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
+								addNode(arrNodes[0][0],[parent.mb_mapObj[i].wms[ii].wms_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"../php/mod_layerMetadata.php?id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,,,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
 								parentObj = arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id;              
 							}
-							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == "0"){
+							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent && (handlesublayer=="true"||parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent=="0")){
+								var parentLayer = "";
+								var j = iii;
+								while(parent.mb_mapObj[i].wms[ii].objLayer[j].layer_parent!="0"){
+									//find parent
+									for(var jj=0; jj < parent.mb_mapObj[i].wms[ii].objLayer.length; jj++){
+										if(parent.mb_mapObj[i].wms[ii].objLayer[jj].layer_pos==parseInt(parent.mb_mapObj[i].wms[ii].objLayer[j].layer_parent)){
+											j=jj;
+											break;
+										}										
+									}									
+									parentLayer = "|" + parent.mb_mapObj[i].wms[ii].objLayer[j].layer_id + parentLayer;
+								}
 								if(temp.gui_layer_selectable == '1' || temp.gui_layer_queryable == '1'){
 									var c_menu="[";
-									if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_up,";
-									if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_down,";
+									if(reverse=="true"){
+										if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_up,";
+										if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_down,";
+									}
+									else{
+										if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_up,";
+										if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_down,";
+									}
 									if(menu.indexOf("metainfo")!=-1)c_menu+="menu_metalink,";
 									if(menu.indexOf("zoom")!=-1 && temp.layer_epsg.length>0)c_menu+="menu_zoom,";
 //									if(menu.indexOf("layer_switch")!=-1)c_menu+="menu_layer_switch,";
@@ -544,10 +563,10 @@
 									if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
 									c_menu+="]";
 									
-									controls='<input type="checkbox" '+((temp.gui_layer_visible=='1')?'checked ':'')+(temp.gui_layer_selectable!='1'?'disabled ':'')+"onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','visible',this.checked?1:0);updateParent('"+parentObj+"');"+((ficheckbox == 'false')?"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0)":"")+"\" />";
-									if(ficheckbox == 'true')controls+='<input type="checkbox" '+(temp.gui_layer_querylayer=='1'?'checked ':'')+(temp.gui_layer_queryable!='1'?'disabled ':'')+"onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0)\" />";
+									controls='<input type="checkbox" '+(temp.layer_name==""?'style="display:none;" ':"")+((temp.gui_layer_visible=='1')?'checked ':'')+(temp.gui_layer_selectable!='1'?'disabled ':'')+"onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','visible',this.checked?1:0);handleSelection('"+parentObj+parentLayer+"|"+temp.layer_id+"');updateParent('"+parentObj+parentLayer+"');"+((ficheckbox == 'false')?"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0)":"")+"\" />";
+									if(ficheckbox == 'true')controls+='<input type="checkbox" '+(temp.gui_layer_querylayer=='1'?'checked ':'')+(temp.gui_layer_queryable!='1'?'disabled ':'')+"onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0);checkChildren('"+parentObj+parentLayer+"|"+temp.layer_id+"', 1, this.checked?1:0)\" />";
 									if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\'../php/mod_layerMetadata.php?id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
-									addNode(parentObj, [temp.layer_name,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"../php/mod_layerMetadata.php?id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,(c_menu!='[]'?'menu.png':null),,eval(c_menu),controls,[i,ii,iii]]],false,false);
+									addNode(parentObj + parentLayer, [temp.layer_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"../php/mod_layerMetadata.php?id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,((c_menu!='[]'&&temp.layer_name!="")?'menu.png':null),,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
 								}
 							}
 						}



More information about the Mapbender_commits mailing list