[Mapbender-commits] r8093 - branches/2.7/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Aug 31 11:14:16 EDT 2011
Author: verenadiewald
Date: 2011-08-31 08:14:16 -0700 (Wed, 31 Aug 2011)
New Revision: 8093
Modified:
branches/2.7/http/javascripts/mod_legendDiv.php
Log:
added dyn_js.php for validation of element vars
Modified: branches/2.7/http/javascripts/mod_legendDiv.php
===================================================================
--- branches/2.7/http/javascripts/mod_legendDiv.php 2011-08-31 14:52:26 UTC (rev 8092)
+++ branches/2.7/http/javascripts/mod_legendDiv.php 2011-08-31 15:14:16 UTC (rev 8093)
@@ -9,14 +9,11 @@
# any later version.
#
/*
-INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url) VALUES('Geoportal-RLP','legend',2,1,'legend','Legend','div','','',0,0,NULL ,NULL ,600,'','','div','../javascripts/mod_legendDiv.php','','mapframe1','','');
-INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'legend', 'checkbox_on_off', 'false', 'display or hide the checkbox to set the legend on/off' ,'var');
-INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'legend', 'css_file_legend', '../css/legend.css', '' ,'file/css');
-INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'legend', 'legendlink', 'false', '' ,'var');
-INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'legend', 'showgroupedlayertitle', 'true', 'show the title of the grouped layers in the legend' ,'var');
-INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'legend', 'showlayertitle', 'true', 'show the layer title in the legend' ,'var');
-INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'legend', 'showwmstitle', 'true', 'show the wms title in the legend' ,'var');
-INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'legend', 'stickylegend', 'false', 'parameter to decide wether the legend should stick on the mapframe1' ,'var');
+INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url) VALUES('<app_id>','legend',2,1,'legend','Legend','div','','',0,0,NULL ,NULL ,600,'','','div','../javascripts/mod_legendDiv.php','','mapframe1','','');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('<app_id>', 'legend', 'legendlink', 'false', '' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('<app_id>', 'legend', 'showgroupedlayertitle', 'true', 'show the title of the grouped layers in the legend' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('<app_id>', 'legend', 'showlayertitle', 'true', 'show the layer title in the legend' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('<app_id>', 'legend', 'showwmstitle', 'true', 'show the wms title in the legend' ,'var');
*/
# This program is distributed in the hope that it will be useful,
@@ -32,32 +29,26 @@
$e_top = '10';
$e_left = '10';
-
echo "var mod_legend_target = '".$e_target."';\n";
echo "var mod_legend_target_left = ".intval($e_left).";\n";
echo "var mod_legend_target_top = ".intval($e_top).";\n";
-//echo "var mod_legend_target_width = ".db_result($res2,0,"e_width").";\n";
-//echo "var mod_legend_target_height = ".db_result($res2,0,"e_height").";\n";
+
+include '../include/dyn_js.php';
+//defaults for element vars
?>
mod_legend_offsetLeft = 25;
mod_legend_offsetTop = -10;
-showlayertitle = true;
-showwmstitle = true;
-legendlink = false;
-var checkbox_on_off = typeof checkbox_on_off === "undefined" ? 'false' : checkbox_on_off;
-var stickylegend = typeof stickylegend === "undefined" ? "false" : stickylegend;
+var legendlink = typeof legendlink === "undefined" ? 'false' : legendlink;
+var showwmstitle = typeof showwmstitle === "undefined" ? "false" : showwmstitle;
+var showlayertitle = typeof showlayertitle === "undefined" ? "false" : showlayertitle;
+var showgroupedlayertitle = typeof showgroupedlayertitle === "undefined" ? "false" : showgroupedlayertitle;
function mod_legend_pos(frameName){
if(frameName == mod_legend_target){
var ind = getMapObjIndexByName(mod_legend_target);
var obj = document.getElementById("legend");
- if(stickylegend == 'true'){
- obj.style.left = (parseInt(mb_mapObj[ind].width) + mod_legend_target_left + mod_legend_offsetLeft) + "px";
- }
-
-
var str = "";
var str_tmp = "";
@@ -80,7 +71,7 @@
// if(layerParent == 0){
if(showlayertitle == 'true'){
- str_tmp += "<div><span class='titles'>" + layerTitle+ "</span></div>";
+ str_tmp += "<div><span class='titles'>" + layerTitle+ "</span></div>";
}
str_tmp += "<div>";
if(legendlink == 'true'){
More information about the Mapbender_commits
mailing list