[Mapbender-commits] r5219 - branches/2.6/http/html
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Dec 21 05:08:11 EST 2009
Author: astrid_emde
Date: 2009-12-21 05:08:10 -0500 (Mon, 21 Dec 2009)
New Revision: 5219
Modified:
branches/2.6/http/html/mod_treefolderPlain.php
Log:
added addslashes() to avoid error when translation contains '
Modified: branches/2.6/http/html/mod_treefolderPlain.php
===================================================================
--- branches/2.6/http/html/mod_treefolderPlain.php 2009-12-21 09:43:20 UTC (rev 5218)
+++ branches/2.6/http/html/mod_treefolderPlain.php 2009-12-21 10:08:10 UTC (rev 5219)
@@ -28,14 +28,14 @@
echo "mod_treeGDE_map = '".$e_target[0]."';";
?>
var msgObj = {};
-msgObj.tooltipHandleWms = '<?php echo _mb("(De)activate this service");?>';
-msgObj.tooltipLayerVisible = '<?php echo _mb("Toggles the visibility of this service");?>';
-msgObj.tooltipLayerQuerylayer = '<?php echo _mb("Toggles the queryability of this service");?>';
-msgObj.tooltipLayerContextMenu = '<?php echo _mb("Opens the layer context menu");?>';
-msgObj.tooltipWmsContextMenu = '<?php echo _mb("Opens the WMS context menu");?>';
-msgObj.tooltipRemoveWms = '<?php echo _mb("Removes the selected WMS");?>';
-msgObj.tooltipMoveSelectionUp = '<?php echo _mb("Moves the selection up");?>';
-msgObj.tooltipMoveSelectionDown = '<?php echo _mb("Moves the selection down");?>';
+msgObj.tooltipHandleWms = '<?php echo addslashes(_mb("(De)activate this service"));?>';
+msgObj.tooltipLayerVisible = '<?php echo addslashes(_mb("Toggles the visibility of this service"));?>';
+msgObj.tooltipLayerQuerylayer = '<?php echo addslashes(_mb("Toggles the queryability of this service"));?>';
+msgObj.tooltipLayerContextMenu = '<?php echo addslashes(_mb("Opens the layer context menu"));?>';
+msgObj.tooltipWmsContextMenu = '<?php echo addslashes(_mb("Opens the WMS context menu"));?>';
+msgObj.tooltipRemoveWms = '<?php echo addslashes(_mb("Removes the selected WMS"));?>';
+msgObj.tooltipMoveSelectionUp = '<?php echo addslashes(_mb("Moves the selection up"));?>';
+msgObj.tooltipMoveSelectionDown = '<?php echo addslashes(_mb("Moves the selection down"));?>';
var jst_container = "document.getElementById('treeContainer')";
var jst_image_folder = imagedir;
@@ -140,15 +140,15 @@
}
//menu elements
-var menu_move_up = ['menu_move_up', ['<?php echo _mb("Move up");?> ','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
-var menu_move_down = ['menu_move_down', ['<?php echo _mb("Move down");?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
-var menu_delete = ['menu_delete', ['<?php echo _mb("Remove");?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];remove_wms(ids[0],ids[1],ids[2]);',,'delete_wms.png']];
-var menu_opacity_up = ['menu_opacity_up', ['<?php echo _mb("Opacity up");?> ','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
-var menu_opacity_down = ['menu_opacity_down', ['<?php echo _mb("Opacity down");?> ','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
-var menu_metalink = ['menu_metalink', ['<?php echo _mb("Information");?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[ids[0]].wms[ids[1]].objLayer[ids[2]].layer_uid);',,'info.png']];
-var menu_zoom = ['menu_zoom', ['<?php echo _mb("Zoom");?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];zoomToLayer(ids[0],ids[1],ids[2]);',,'zoom.png']];
-var menu_hide = ['menu_hide', ['<?php echo _mb("Hide menu");?> ', 'javascript:hideMenu()',,'hide.png']];
-//var menu_wms_switch = ['menu_zoom', ['<?php echo _mb("Zoom");?> ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
+var menu_move_up = ['menu_move_up', ['<?php echo addslashes(_mb("Move up"));?> ','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
+var menu_move_down = ['menu_move_down', ['<?php echo addslashes(_mb("Move down"));?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
+var menu_delete = ['menu_delete', ['<?php echo addslashes(_mb("Remove"));?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];remove_wms(ids[0],ids[1],ids[2]);',,'delete_wms.png']];
+var menu_opacity_up = ['menu_opacity_up', ['<?php echo addslashes(_mb("Opacity up"));?> ','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
+var menu_opacity_down = ['menu_opacity_down', ['<?php echo addslashes(_mb("Opacity down"));?> ','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
+var menu_metalink = ['menu_metalink', ['<?php echo addslashes(_mb("Information"));?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[ids[0]].wms[ids[1]].objLayer[ids[2]].layer_uid);',,'info.png']];
+var menu_zoom = ['menu_zoom', ['<?php echo addslashes(_mb("Zoom"));?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];zoomToLayer(ids[0],ids[1],ids[2]);',,'zoom.png']];
+var menu_hide = ['menu_hide', ['<?php echo addslashes(_mb("Hide menu"));?> ', 'javascript:hideMenu()',,'hide.png']];
+//var menu_wms_switch = ['menu_zoom', ['<?php echo addslashes(_mb("Zoom"));?> ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
//var menu_layer_switch = ['menu_zoom', ['Zjjj ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
//var menu_info_switch = ['menu_zoom', ['Zmn ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
@@ -430,12 +430,12 @@
l=selectedLayer;
}
if(j==-1||k==-1||l==-1){
- alert("<?php echo _mb('You have to select the WMS you want to move up!');?> ")
+ alert("<?php echo addslashes(_mb('You have to select the WMS you want to move up!'));?> ")
return;
}
var lid= mb_mapObj[j].wms[k].objLayer[l].layer_id;
if(! mb_mapObj[j].move( mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?false:true)){
- alert("<?php echo _mb('Illegal move operation');?>");
+ alert("<?php echo addslashes(_mb('Illegal move operation'));?>");
return;
}
treeState = getState();
@@ -462,12 +462,12 @@
l=selectedLayer;
}
if(j==-1||k==-1||l==-1){
- alert("<?php echo _mb('You have to select the WMS you want to move down!');?>")
+ alert("<?php echo addslashes(_mb('You have to select the WMS you want to move down!'));?>")
return;
}
var lid= mb_mapObj[j].wms[k].objLayer[l].layer_id;
if(! mb_mapObj[j].move( mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?true:false)){
- alert("<?php echo _mb('Illegal move operation');?>");
+ alert("<?php echo addslashes(_mb('Illegal move operation'));?>");
return;
}
treeState = getState();
@@ -494,11 +494,11 @@
l=selectedLayer;
}
if(j==-1||k==-1||l==-1){
- alert("<?php echo _mb('You have to select the WMS you want to delete!');?>")
+ alert("<?php echo addslashes(_mb('You have to select the WMS you want to delete!'));?>")
return;
}
if(l!=0){
- alert("<?php echo _mb('It is not possible to delete a single layer, please select a WMS!');?>")
+ alert("<?php echo addslashes(_mb('It is not possible to delete a single layer, please select a WMS!'));?>")
return;
}
var visibleWMS=0;
@@ -506,10 +506,10 @@
if( mb_mapObj[j].wms[i].gui_wms_visible=='1'|| mb_mapObj[j].wms[i].gui_wms_visible==1)
visibleWMS++;
if(visibleWMS<=1){
- alert ("<?php echo _mb('Last WMS can not be removed.');?>");
+ alert ("<?php echo addslashes(_mb('Last WMS can not be removed.'));?>");
return;
}
- if(confirm('<?php echo _mb("Are you sure you want to remove");?>' + ' "'+ mb_mapObj[j].wms[k].objLayer[l].layer_title+'"?')){
+ if(confirm('<?php echo addslashes(_mb("Are you sure you want to remove"));?>' + ' "'+ mb_mapObj[j].wms[k].objLayer[l].layer_title+'"?')){
mb_mapObjremoveWMS(j,k);
mb_mapObj[j].zoom(true, 1.0);
mb_execloadWmsSubFunctions();
More information about the Mapbender_commits
mailing list