[Mapbender-commits] r2957 - branches/nimix_dev/http/html
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Sep 17 09:14:41 EDT 2008
Author: nimix
Date: 2008-09-17 09:14:41 -0400 (Wed, 17 Sep 2008)
New Revision: 2957
Modified:
branches/nimix_dev/http/html/mod_treefolder2.php
Log:
cleanup
Modified: branches/nimix_dev/http/html/mod_treefolder2.php
===================================================================
--- branches/nimix_dev/http/html/mod_treefolder2.php 2008-09-17 12:37:06 UTC (rev 2956)
+++ branches/nimix_dev/http/html/mod_treefolder2.php 2008-09-17 13:14:41 UTC (rev 2957)
@@ -148,29 +148,23 @@
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';}
-try{if (wmsbuttons){}}catch(e){wmsbuttons = 'false';}
-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 = '';}
-try {
- if (redirectToMetadataUrl) {
- if (redirectToMetadataUrl == "false") {
- redirectToMetadataUrl = false;
- }
- else {
- redirectToMetadataUrl = true;
- }
- }
+if (typeof(reverse) === 'undefined')reverse = 'false';
+if (typeof(switchwms) === 'undefined')switchwms = 'true';
+if (typeof(ficheckbox) === 'undefined')ficheckbox = 'false';
+if (typeof(metadatalink) === 'undefined')metadatalink = 'false';
+if (typeof(wmsbuttons) === 'undefined')wmsbuttons = 'false';
+if (typeof(showstatus) === 'undefined')showstatus = 'false';
+if (typeof(alerterror) === 'undefined')alerterror = 'false';
+if (typeof(openfolder) === 'undefined')openfolder = 'false';
+if (typeof(handlesublayer) === 'undefined')handlesublayer = 'false';
+if (typeof(menu) === 'undefined')menu = '';
+if (typeof(redirectToMetadataUrl) !== 'undefined' && redirectToMetadataUrl == "false") {
+ redirectToMetadataUrl = false;
}
-catch (e) {
- var redirectToMetadataUrl = true;
+else {
+ redirectToMetadataUrl = true;
}
+
var defaultMetadataUrl = '../php/mod_layerMetadata.php?';
if (redirectToMetadataUrl) {
defaultMetadataUrl += 'redirectToMetadataUrl=1';
@@ -194,15 +188,6 @@
//parent.eventMapRequestFailed.register(function(t){imgerror(t)});
-var treeStructure = [{"left":4,"right":5,"name":"Heute",layerId:123,wmsId:123},{"left":7,"right":8,"name":"2005"},{"left":9,"right":10,"name":"2006"},{"left":11,"right":12,"name":"2007"},{"left":6,"right":13,"name":"Archiv"},{"left":3,"right":14,"name":"News"},{"left":15,"right":16,"name":"Impressum"},{"left":2,"right":17,"name":"Startseite"},{"left":1,"right":18,"name":"(root)"}]
-function treeSort(a,b)
-{
- return a.left-b.left;
-}
-console.log(treeStructure);
-treeStructure.sort(treeSort);
-console.log(treeStructure);
-
parent.eventAfterLoadWMS.register(reloadTree);
parent.eventInit.register(loadTree);
if(showstatus=='true'||alerterror=='true'){
More information about the Mapbender_commits
mailing list