[Mapbender-commits] r2412 - in trunk/mapbender: . http http/frames
http/html http/include http/print http/sld http/sld/classes
http/sld/img http/tools lib owsproxy/http
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Apr 23 12:14:31 EDT 2008
Author: christoph
Date: 2008-04-23 12:14:30 -0400 (Wed, 23 Apr 2008)
New Revision: 2412
Added:
trunk/mapbender/http/sld/
trunk/mapbender/http/sld/classes/
trunk/mapbender/http/sld/classes/AddOperationModule.php
trunk/mapbender/http/sld/classes/AnchorPoint.php
trunk/mapbender/http/sld/classes/BinaryComparisonOp.php
trunk/mapbender/http/sld/classes/BinaryLogicOp.php
trunk/mapbender/http/sld/classes/ColorMap.php
trunk/mapbender/http/sld/classes/ColorMapEntry.php
trunk/mapbender/http/sld/classes/CssParameter.php
trunk/mapbender/http/sld/classes/DbUtils.php
trunk/mapbender/http/sld/classes/Displacement.php
trunk/mapbender/http/sld/classes/DisplayOperationModule.php
trunk/mapbender/http/sld/classes/ElseFilter.php
trunk/mapbender/http/sld/classes/ExternalGraphic.php
trunk/mapbender/http/sld/classes/FeatureTypeStyle.php
trunk/mapbender/http/sld/classes/Fill.php
trunk/mapbender/http/sld/classes/Filter.php
trunk/mapbender/http/sld/classes/Font.php
trunk/mapbender/http/sld/classes/Graphic.php
trunk/mapbender/http/sld/classes/GraphicFill.php
trunk/mapbender/http/sld/classes/GraphicStroke.php
trunk/mapbender/http/sld/classes/Halo.php
trunk/mapbender/http/sld/classes/LabelPlacement.php
trunk/mapbender/http/sld/classes/LegendGraphic.php
trunk/mapbender/http/sld/classes/LineSymbolizer.php
trunk/mapbender/http/sld/classes/Mark.php
trunk/mapbender/http/sld/classes/NamedLayer.php
trunk/mapbender/http/sld/classes/ParameterValue.php
trunk/mapbender/http/sld/classes/PointPlacement.php
trunk/mapbender/http/sld/classes/PointSymbolizer.php
trunk/mapbender/http/sld/classes/PolygonSymbolizer.php
trunk/mapbender/http/sld/classes/PropertyIsBetween.php
trunk/mapbender/http/sld/classes/PropertyIsLike.php
trunk/mapbender/http/sld/classes/PropertyIsNull.php
trunk/mapbender/http/sld/classes/RasterSymbolizer.php
trunk/mapbender/http/sld/classes/Rule.php
trunk/mapbender/http/sld/classes/Stroke.php
trunk/mapbender/http/sld/classes/StyledLayerDescriptor.php
trunk/mapbender/http/sld/classes/TextSymbolizer.php
trunk/mapbender/http/sld/classes/UnaryLogicOp.php
trunk/mapbender/http/sld/classes/UserStyle.php
trunk/mapbender/http/sld/img/
trunk/mapbender/http/sld/img/lightning.png
trunk/mapbender/http/sld/img/map_magnify.png
trunk/mapbender/http/sld/img/minus.gif
trunk/mapbender/http/sld/img/plus.gif
trunk/mapbender/http/sld/img/script.png
trunk/mapbender/http/sld/img/script_code_red.png
trunk/mapbender/http/sld/img/script_link.png
trunk/mapbender/http/sld/img/script_save.png
trunk/mapbender/http/sld/sld_config.php
trunk/mapbender/http/sld/sld_edit_filter.php
trunk/mapbender/http/sld/sld_filter_parse.php
trunk/mapbender/http/sld/sld_function_getusersld.php
trunk/mapbender/http/sld/sld_function_handler.php
trunk/mapbender/http/sld/sld_main.php
trunk/mapbender/http/sld/sld_parse.php
trunk/mapbender/http/sld/sld_pick_color.php
trunk/mapbender/http/tools/mod_monitorCapabilities_main.php
trunk/mapbender/http/tools/mod_monitorCapabilities_read.php
trunk/mapbender/http/tools/mod_monitorCapabilities_read_single.php
trunk/mapbender/http/tools/mod_monitorCapabilities_write.php
trunk/mapbender/lib/
trunk/mapbender/lib/i18n.php
Removed:
trunk/mapbender/http/html/mod_sync_treefolder_auge.php
trunk/mapbender/http/html/mod_treefolder_auge.php
trunk/mapbender/http/sld/classes/
trunk/mapbender/http/sld/classes/AddOperationModule.php
trunk/mapbender/http/sld/classes/AnchorPoint.php
trunk/mapbender/http/sld/classes/BinaryComparisonOp.php
trunk/mapbender/http/sld/classes/BinaryLogicOp.php
trunk/mapbender/http/sld/classes/ColorMap.php
trunk/mapbender/http/sld/classes/ColorMapEntry.php
trunk/mapbender/http/sld/classes/CssParameter.php
trunk/mapbender/http/sld/classes/DbUtils.php
trunk/mapbender/http/sld/classes/Displacement.php
trunk/mapbender/http/sld/classes/DisplayOperationModule.php
trunk/mapbender/http/sld/classes/ElseFilter.php
trunk/mapbender/http/sld/classes/ExternalGraphic.php
trunk/mapbender/http/sld/classes/FeatureTypeStyle.php
trunk/mapbender/http/sld/classes/Fill.php
trunk/mapbender/http/sld/classes/Filter.php
trunk/mapbender/http/sld/classes/Font.php
trunk/mapbender/http/sld/classes/Graphic.php
trunk/mapbender/http/sld/classes/GraphicFill.php
trunk/mapbender/http/sld/classes/GraphicStroke.php
trunk/mapbender/http/sld/classes/Halo.php
trunk/mapbender/http/sld/classes/LabelPlacement.php
trunk/mapbender/http/sld/classes/LegendGraphic.php
trunk/mapbender/http/sld/classes/LineSymbolizer.php
trunk/mapbender/http/sld/classes/Mark.php
trunk/mapbender/http/sld/classes/NamedLayer.php
trunk/mapbender/http/sld/classes/ParameterValue.php
trunk/mapbender/http/sld/classes/PointPlacement.php
trunk/mapbender/http/sld/classes/PointSymbolizer.php
trunk/mapbender/http/sld/classes/PolygonSymbolizer.php
trunk/mapbender/http/sld/classes/PropertyIsBetween.php
trunk/mapbender/http/sld/classes/PropertyIsLike.php
trunk/mapbender/http/sld/classes/PropertyIsNull.php
trunk/mapbender/http/sld/classes/RasterSymbolizer.php
trunk/mapbender/http/sld/classes/Rule.php
trunk/mapbender/http/sld/classes/Stroke.php
trunk/mapbender/http/sld/classes/StyledLayerDescriptor.php
trunk/mapbender/http/sld/classes/TextSymbolizer.php
trunk/mapbender/http/sld/classes/UnaryLogicOp.php
trunk/mapbender/http/sld/classes/UserStyle.php
trunk/mapbender/http/sld/img/
trunk/mapbender/http/sld/img/lightning.png
trunk/mapbender/http/sld/img/map_magnify.png
trunk/mapbender/http/sld/img/minus.gif
trunk/mapbender/http/sld/img/plus.gif
trunk/mapbender/http/sld/img/script.png
trunk/mapbender/http/sld/img/script_code_red.png
trunk/mapbender/http/sld/img/script_link.png
trunk/mapbender/http/sld/img/script_save.png
trunk/mapbender/http/sld/sld_config.php
trunk/mapbender/http/sld/sld_edit_filter.php
trunk/mapbender/http/sld/sld_filter_parse.php
trunk/mapbender/http/sld/sld_function_getusersld.php
trunk/mapbender/http/sld/sld_function_handler.php
trunk/mapbender/http/sld/sld_main.php
trunk/mapbender/http/sld/sld_parse.php
trunk/mapbender/http/sld/sld_pick_color.php
trunk/mapbender/http/tools/datepicker/
trunk/mapbender/http/tools/mapFiler.php
trunk/mapbender/lib/i18n.php
Modified:
trunk/mapbender/http/frames/cleanurl.php
trunk/mapbender/http/frames/index.php
trunk/mapbender/http/frames/login.php
trunk/mapbender/http/html/mod_sync_treefolder.php
trunk/mapbender/http/html/mod_treefolder.php
trunk/mapbender/http/html/mod_treefolder2.php
trunk/mapbender/http/include/dyn_css.php
trunk/mapbender/http/include/dyn_js.php
trunk/mapbender/http/print/mod_printPDF.php
trunk/mapbender/http/print/mod_printPDF_pdf.php
trunk/mapbender/http/tools/mapbender_setup.php
trunk/mapbender/owsproxy/http/index.php
Log:
merge w/ 2.5 branch (7)
Modified: trunk/mapbender/http/frames/cleanurl.php
===================================================================
--- trunk/mapbender/http/frames/cleanurl.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/frames/cleanurl.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -17,8 +17,8 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
ob_start();
-include_once("../../conf/mapbender.conf");
-include("../classes/class_administration.php");
+include_once(dirname(__FILE__) . "/../../conf/mapbender.conf");
+include(dirname(__FILE__) . "/../classes/class_administration.php");
$adm = new administration();
Modified: trunk/mapbender/http/frames/index.php
===================================================================
--- trunk/mapbender/http/frames/index.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/frames/index.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -18,26 +18,29 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-session_start();
mb_internal_encoding("UTF-8");
-
-require(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+require("../php/mb_validateSession.php");
require_once(dirname(__FILE__)."/../classes/class_locale.php");
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+//
+// check if user is allowed to access current GUI;
+// if not, return to login screen
+//
+if (!in_array($gui_id, $_SESSION["mb_user_guis"])) {
+ $e = new mb_exception("mb_validateSession.php: User: " . $_SESSION["mb_user_id"] . " not allowed to access GUI " . $gui_id);
+ header("Location: ".LOGIN);
+ die();
+}
+
#$e = new mb_notice("index.php: arguments: GML: " . $_SESSION["GML"]);
#$e = new mb_notice("index.php: arguments: Zoom to layer: " . $_REQUEST["zoomToLayer"]);
#$e = new mb_notice("index.php: arguments: portal_services: " . $_REQUEST["portal_services"]);
#$e = new mb_notice("index.php: arguments: portal_services_wfs: " . $_REQUEST["portal_services_wfs"]);
#$e = new mb_notice("index.php: arguments: layer_preview: " . $_REQUEST["layer_preview"]);
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-
$pattern = "/sessionID/";
-$_SESSION["mb_user_gui"] = $_REQUEST["gui_id"];
+$_SESSION["mb_user_gui"] = $gui_id;
$localeObj = new Mb_locale($_SESSION["mb_lang"]);
@@ -59,10 +62,10 @@
<?php
echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
?>
-<title><?php echo $_REQUEST["gui_id"];?> - presented by Mapbender</title>
+<title><?php echo $gui_id;?> - presented by Mapbender</title>
<?php
$sql = "SELECT * FROM gui_element_vars WHERE fkey_e_id = 'body' AND fkey_gui_id = $1 and var_type='file/css'";
-$v = array($_REQUEST["gui_id"]);
+$v = array($gui_id);
$t = array('s');
$res = db_prep_query($sql,$v,$t);
$cnt = 0;
@@ -74,7 +77,7 @@
<!--
<?php
$sql = "SELECT * FROM gui_element_vars WHERE fkey_e_id = 'body' AND fkey_gui_id = $1 and var_type='text/css'";
-$v = array($_REQUEST["gui_id"]);
+$v = array($gui_id);
$t = array('s');
$res = db_prep_query($sql,$v,$t);
$cnt = 0;
@@ -96,12 +99,12 @@
$sql = "SELECT fkey_gui_id,e_id,e_pos,e_public,e_comment,gettext($1, e_title) as e_title, e_element,";
$sql .= "e_src,e_attributes,e_left,e_top,e_width,e_height,e_z_index,e_more_styles,";
$sql .= "e_content,e_closetag,e_js_file,e_mb_mod,e_target,e_requires,e_url FROM gui_element WHERE e_public = 1 AND fkey_gui_id = $2 ORDER BY e_pos";
-$v = array($_SESSION["mb_lang"], $_REQUEST["gui_id"]);
+$v = array($_SESSION["mb_lang"], $gui_id);
$t = array('s', 's');
$res = db_prep_query($sql,$v,$t);
$i = 0;
while(db_fetch_row($res)){
- $replacement = SID."&guiID=".$_REQUEST["gui_id"]."&elementID=".db_result($res,$i,"e_id");
+ $replacement = $urlParameters."&elementID=".db_result($res,$i,"e_id");
echo "<".db_result($res,$i,"e_element")." ";
if(db_result($res,$i,"e_id") != ""){
echo " id='".db_result($res,$i,"e_id")."'";
@@ -122,7 +125,9 @@
else {
echo "?";
}
- echo "e_id_css=".db_result($res,$i,"e_id")."&e_id=".db_result($res,$i,"e_id")."&e_target=".db_result($res,$i,"e_target")."'";
+ echo "e_id_css=".db_result($res,$i,"e_id")."&e_id=".db_result($res,$i,"e_id") .
+ "&e_target=".db_result($res,$i,"e_target").
+ "&" . $urlParameters . "'";
}
else{
echo " src = '".preg_replace($pattern,$replacement,db_result($res,$i,"e_src"))."'";
@@ -159,7 +164,7 @@
</form>
<?php
#echo "<script type='text/javascript' src='../javascripts/map.php?gui_id=".$_REQUEST["gui_id"]."&zoomToLayer=".$_REQUEST["zoomToLayer"]."&portal_services=".$_REQUEST['portal_services']."&portal_services_wfs=".$_REQUEST['portal_services_wfs']."&layer_preview=".$_REQUEST['layer_preview']."&".strip_tags(SID)."&mb_myBBOX=".$_REQUEST["mb_myBBOX"]."'></script>";
-echo "<script type='text/javascript' src='../javascripts/map.php?gui_id=".$_REQUEST["gui_id"]."&".strip_tags(SID)."&mb_myBBOX=".$_REQUEST["mb_myBBOX"]."'></script>";
+echo "<script type='text/javascript' src='../javascripts/map.php?".$urlParameters."&mb_myBBOX=".$_REQUEST["mb_myBBOX"]."'></script>";
?>
</body>
</html>
\ No newline at end of file
Modified: trunk/mapbender/http/frames/login.php
===================================================================
--- trunk/mapbender/http/frames/login.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/frames/login.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -152,8 +152,10 @@
}
if($_SESSION["mb_user_id"]){
if($row["mb_user_login_count"] < $loginMax){
- $sql_del_cnt = "UPDATE mb_user SET mb_user_login_count = 0 WHERE mb_user_id = " . $_SESSION['mb_user_id'];
- db_query($sql_del_cnt);
+ $sql_del_cnt = "UPDATE mb_user SET mb_user_login_count = 0 WHERE mb_user_id = $1";
+ $v = array($_SESSION['mb_user_id']);
+ $t = array("i");
+ db_prep_query($sql_del_cnt, $v, $t);
require_once(dirname(__FILE__)."/../php/mb_getGUIs.php");
$arrayGUIs = mb_getGUIs($row["mb_user_id"]);
$_SESSION["mb_user_guis"] = $arrayGUIs;
Modified: trunk/mapbender/http/html/mod_sync_treefolder.php
===================================================================
--- trunk/mapbender/http/html/mod_sync_treefolder.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/html/mod_sync_treefolder.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,5 +1,5 @@
<?php
-session_start();
+require("../php/mb_validateSession.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
@@ -19,7 +19,7 @@
parent.mb_registerInitFunctions("window.frames['treeGDE'].setTree()");
}
function setTree(){
- document.location.href = "../html/mod_treefolder.php?<?php echo SID; ?>&e_id_css=<?php echo $_REQUEST["e_id_css"]; ?>";
+ document.location.href = "../html/mod_treefolder.php?<?php echo $urlParameters; ?>";
}
// -->
</script>
Deleted: trunk/mapbender/http/html/mod_sync_treefolder_auge.php
===================================================================
--- trunk/mapbender/http/html/mod_sync_treefolder_auge.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/html/mod_sync_treefolder_auge.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,54 +0,0 @@
-<?php
-session_start();
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<meta name="author-mail" content="info at ccgis.de">
-<meta name="author" content="U. Rothstein">
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Treefolder</title>
-<?php
-
-import_request_variables("PG");
-session_start();
-
-if(isset($_REQUEST["noquerycheckbox"])){
- $noquerycheck= $_REQUEST["noquerycheckbox"];
-}
-else{
- $noquerycheck = 0;
-}
-
-if(isset($_REQUEST["nolink"])){
- $nolegendlink= $_REQUEST["nolink"];
-}
-else{
- $nolegendlink = 0;
-}
-
-$e_id_css = 0;
-if(isset($_REQUEST["e_id_css"])){
- $e_id_css = $_REQUEST["e_id_css"];
-}
-?>
-
-<script type="text/javascript">
-<!--
-function init(){
- parent.mb_registerInitFunctions("window.frames['treeGDE'].setTree()");
-}
-function setTree(){
- document.location.href = "../html/mod_treefolder_auge.php?<?php echo SID; ?>&noquerycheckbox=<?php echo $noquerycheck."&nolink=".$nolegendlink ?>&e_id_css=<?php echo $e_id_css; ?>";
-}
-// -->
-</script>
-</head>
-<body onload='init()'>
-
-</body>
-</html>
Modified: trunk/mapbender/http/html/mod_treefolder.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolder.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/html/mod_treefolder.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,11 +1,5 @@
<?php
-session_start();
-$gui_id = $_SESSION["mb_user_gui"];
-
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
+require("../php/mb_validateSession.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
@@ -23,7 +17,7 @@
}
<?php
$sql = "SELECT e_target FROM gui_element WHERE e_id = $1 AND fkey_gui_id = $2";
- $v = array($_REQUEST['e_id_css'],$_SESSION["mb_user_gui"]);
+ $v = array($e_id,$gui_id);
$t = array('s','s');
$res = db_prep_query($sql,$v,$t);
$e_target = db_result($res,0,"e_target");
Modified: trunk/mapbender/http/html/mod_treefolder2.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolder2.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/html/mod_treefolder2.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -17,11 +17,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-session_start();
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
$gui_id = $_SESSION["mb_user_gui"];
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
@@ -86,6 +83,26 @@
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;
+ }
+ }
+}
+catch (e) {
+ var redirectToMetadataUrl = true;
+}
+var defaultMetadataUrl = '../php/mod_layerMetadata.php?';
+if (redirectToMetadataUrl) {
+ defaultMetadataUrl += 'redirectToMetadataUrl=1';
+}
+else {
+ defaultMetadataUrl += 'redirectToMetadataUrl=0';
+}
//menu elements
var menu_move_up = ['menu_move_up', ['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']];
@@ -93,12 +110,12 @@
var menu_delete = ['menu_delete', ['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', ['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', ['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', ['Information ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openwindow("../php/mod_layerMetadata.php?id="+parent.mb_mapObj[ids[0]].wms[ids[1]].objLayer[ids[2]].layer_uid);',,'info.png']];
+var menu_metalink = ['menu_metalink', ['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', ['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', ['Hide menu ', 'javascript:hideMenu()',,'hide.png']];
-//var menu_wms_switch = ['menu_zoom', ['Zoom ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow("../php/mod_layerMetadata.php?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("../php/mod_layerMetadata.php?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("../php/mod_layerMetadata.php?id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
+//var menu_wms_switch = ['menu_zoom', ['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']];
parent.mb_registerloadWmsSubFunctions("window.frames['treeGDE'].reloadTree();");
parent.mb_registerInitFunctions("window.frames['treeGDE'].loadTree();");
@@ -318,42 +335,11 @@
}
function handleOpacity(mapObj_id, wms_id, increment) {
-
- if (parent.mb_mapObj[mapObj_id].wms[wms_id].gui_wms_visible > 0) {
- wmsImage = parent.mapframe1.document.getElementById('div_'+wms_id);
- if (wmsImage != null) {
- opacity = wmsImage.style.opacity*100 - (-increment);
- opacity = (opacity < 100)? ((opacity > 0)? opacity : 0) : 100;
- parent.mb_mapObj[mapObj_id].wms[wms_id].gui_wms_mapopacity = (opacity / 100);
- applyOpacity(wms_id, opacity);
- }
- }
+ var opacity = parent.mb_mapObj[mapObj_id].wms[wms_id].gui_wms_mapopacity*100 + increment;
+ parent.mb_mapObj[mapObj_id].wms[wms_id].setOpacity(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 && !isNaN(opacity)) {
- wmsImage.style.opacity = (opacity / 100);
- wmsImage.style.MozOpacity = (opacity / 100);
- wmsImage.style.KhtmlOpacity = (opacity / 100);
- wmsImage.style.filter = "alpha(opacity=" + opacity + ")";
- }
- }
-}
-
-function applyOpacityForAllWms (mapObj_name) {
- mapObj_id = parent.getMapObjIndexByName(mapObj_name);
- for (var i = 0; i < parent.mb_mapObj[mapObj_id].wms.length; i++) {
- var opacity = parent.mb_mapObj[mapObj_id].wms[i].gui_wms_mapopacity * 100;
- applyOpacity(i, opacity);
- }
-}
-
-parent.mb_registerSubFunctions("window.frames['treeGDE'].applyOpacityForAllWms('mapframe1')");
-
//---end------------- opacity --------------------
function move_up(j,k,l){
@@ -529,8 +515,8 @@
c_menu+="]";
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");
+ if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&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(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,,temp.layer_title,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 && (handlesublayer=="true"||parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent=="0")){
@@ -565,8 +551,8 @@
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 + 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");
+ if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
+ addNode(parentObj + parentLayer, [temp.layer_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,((c_menu!='[]'&&temp.layer_name!="")?'menu.png':null),temp.layer_title,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
}
}
}
Deleted: trunk/mapbender/http/html/mod_treefolder_auge.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolder_auge.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/html/mod_treefolder_auge.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,787 +0,0 @@
-<?php
-session_start();
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-$con = db_connect($DBSERVER,$OWNER,$PW);
-db_select_db(DB,$con);
-$gui_id = $_SESSION["mb_user_gui"];
-
-$eye_on = '../img/eye_on.gif';
-$eye_off = '../img/eye_off.gif';
-$info_on = '../img/info_on.gif';
-$info_off ='../img/info_off.gif';
-$no_info ='../img/no_info.gif';
-
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-<META NAME="Generator" CONTENT="Cosmo Create 1.0.3">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
-?>
-<TITLE>Treefolder Eyes</TITLE>
-<?php
- include '../include/dyn_css.php';
-?>
-<script language='JavaScript'>
-function pop_up(name)
-{
- window.open(name,"METADATEN","width=310,height=400,left=0,top=0");
-}
-</script>
-<?php
-echo "<script language='JavaScript'>";
-
- import_request_variables("PG");
-
- require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
- $con = db_connect($DBSERVER,$OWNER,$PW);
- db_select_db(DB,$con);
- $sql = "SELECT e_target FROM gui_element WHERE e_id = '".$_REQUEST['e_id_css']."' AND fkey_gui_id = '".$_SESSION["mb_user_gui"]."'";
-
- $res = db_query($sql);
- $e_target = db_result($res,0,"e_target");
-
- echo "mod_treeGDE_map = '".$e_target."';";
-echo "</script>";
-
-$sql = "select var_name,var_value from gui_element_vars where fkey_gui_id='".$_SESSION["mb_user_gui"]."' and fkey_e_id='".$_REQUEST['e_id_css']."' and var_type = 'img';";
-
- $res = db_query($sql);
-$img["folder_off"] ='../img/tree/folder_off_new.gif';
-$img["folder_on"] ='../img/tree/folder_on_new.gif';
-while($row = db_fetch_array($res))
-{
-$img[$row['var_name']] = $row['var_value'];
-}
-
-?>
- <SCRIPT language="JavaScript1.2">
- <!--
- /*
- * sitemap.js 1.31 05/02/2000
- * - Opera 5
- *
- * sitemap.js 1.3 27/11/2000
- * - Netscape 6
- *
- * sitemap.js 1.2 20/05/2000
- * - split array tree into arrays for each element old tree
- * - no mory type flag, an folder is an entry which has sons
- * - a folder can have an link
- * - while initing an default layers is shown
- *
- * sitemap.js 1.1 20/10/1999
- * - showTree only updates and init layers new which have been really changed
- * - add deep to knot entry
- * - substitute knotDeep[ id ] w/ tree[ id2treeIndex[ id ] ].deep
- * - add alignment to img and a at the beginning of eyery line
- * - add a fake img for bookmarks on top panel
- *
- * sitemap.js 1.02 14/10/1999
- * - fix bug in initStyles
- *
- * sitemap.js 1.01 06/10/1999
- * - fix bug in knotDeep for Netscape 4.00-4.0.5
- *
- * sitemap.js 1.0 20/09/1999
- *
- * Javascript function for displaying hierarchic directory structures with
- * the ability to collapse and expand directories.
- *
- * Copyright (c) 1999 Polzin GmbH, Duesseldorf. All Rights Reserved.
- * Author: Lutz Eymers <ixtab at polzin.com>
- * Download: http://www.polzin.com/inet/fset_inet.phtml?w=goodies
- *
- * Permission to use, copy, modify, and distribute this software
- * and its documentation for any purposes and without fee
- * is hereby granted provided that this copyright notice
- * appears in all copies.
- *
- * Of course, this software is provided "as is" without express or implied
- * warranty of any kind.
- *
- */
-
- parent.mb_registerSubFunctions("window.frames['treeGDE'].mod_treeGDE()");
-
-function mod_treeGDE(){
- /**/
- var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
- //if(ind == false){ alert("error, no mapobject specified");}
- for(var i=0; i<document.getElementsByTagName("input").length; i++){
- //wms_title,layer_shortname,{visible | querylayer}
- var myID = document.getElementsByTagName("input")[i].id;
- var arrayID = document.getElementsByTagName("input")[i].id.split("###");
- //var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
- var wms_ind = parent.getWMSIndexByTitle(mod_treeGDE_map,arrayID[0]);
- if(arrayID[2] == "visible"){
- var arrayLayer = parent.mb_mapObj[ind].layers[wms_ind].split(",");
- var isOn = false;
- for(var ii=0; ii<arrayLayer.length; ii++){
- if(arrayID[1] == arrayLayer[ii]){isOn = true;}
- }
- if(isOn == true){ document.getElementById(myID).checked = true;}
- if(isOn == false){ document.getElementById(myID).checked = false;}
- }
- if(arrayID[2] == "querylayer"){
- //nothing to do at this time
- }
- }
- /*consider scalhints*/
- for(var i=0; i<parent.mb_mapObj.length; i++){
- var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
- if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
- for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
- for(var iii=1; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
- if(document.getElementById(parent.mb_mapObj[i].wms[ii].wms_title+"_"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name)){
- if(scale < parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) != 0){
- document.getElementById(parent.mb_mapObj[i].wms[ii].wms_title+"_"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name).style.color = '#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){
- document.getElementById(parent.mb_mapObj[i].wms[ii].wms_title+"_"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name).style.color = '#999999';
- }
- else{
- document.getElementById(parent.mb_mapObj[i].wms[ii].wms_title+"_"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name).style.color = '#000000';
- }
- }
- }
- }
- }
- }
-}
- window.onError=null;
-
- var idx=0
- var treeId = new Array();
- var treeP_id = new Array();
- var treeIsOn = new Array();
- var treeTyp = new Array();
- var treeName = new Array();
- var treeUrl = new Array();
- var treeWasOn = new Array();
- var treeDeep = new Array();
- var treeLastY = new Array();
- var treeIsShown = new Array();
- var treeSelectable = new Array();
- var treeVisible = new Array();
- var treeQueryable = new Array();
- var treeQuerylayer = new Array();
- var treeWMS = new Array();
- var treeShortname = new Array();
-
- function Note( id,p_id,name,url,selectable,visible,queryable,querylayer,wms,shortname) {
- treeId[ idx ] = id
- treeP_id[ idx ] = p_id
- treeIsOn[ idx ] = false
- treeTyp[ idx ] = 'f'
- treeName[ idx ] = name
- treeUrl[ idx ] = url
- treeWasOn[ idx ] = false
- treeDeep[ idx ] = 0
- treeLastY[ idx ] = 0
- treeIsShown[ idx ] = false
- treeSelectable[ idx ] = selectable
- treeVisible[ idx ] = visible
- treeQueryable[ idx ] = queryable
- treeQuerylayer[ idx ] = querylayer
- treeWMS[ idx ] = wms
- treeShortname[ idx ] = shortname
- idx++
- }
-
- function initDiv ( )
- {
- if ( isDOM || isDomIE )
- {
- divPrefix='<DIV CLASS="sitemap" style="position:absolute; left:0; top:0; visibility:hidden;" ID="sitemap'
- divInfo='<DIV CLASS="sitemap" style="position:absolute; visibility:visible" ID="sitemap'
- }
- else
- {
- divPrefix='<DIV CLASS="sitemap" ID="sitemap'
- divInfo='<DIV CLASS="sitemap" ID="sitemap'
- }
- //document.writeln( divInfo + 'info">Bitte haben Sie etwas Geduld.<BR> <BR>Es werden die Einträge aus<BR> <BR>der Datenbank initialisiert.</DIV> ' );
- for ( var i=1; i<idx; i++ )
- {
- // linked Name ?
-
-
- if ( treeUrl[i] != '' ){
- if(treeVisible[i] != 1){
- linkedName = '<a href="#" onclick="changevalue('+ i +')"><input type=hidden id="treeWMS['+i+']" value=0><img name="bild'+ i +'" id="test" border=0 src="'+images[1]+'" alt="'+images_text[1]+'"></A>';
- }
- else
- {
- linkedName = '<a href="#" onclick="changevalue('+ i +')"><input type=hidden id="treeWMS['+i+']" value=1><img name="bild'+ i +'" id="test" border=0 src="'+images[2]+'" alt="'+images_text[2]+'"></A>';
- }
-
- //linkedName += "<input id='"+treeWMS[i]+"###"+treeShortname[i]+"###visible' type='checkbox' ";
- //if(treeVisible[i] == '1'){ linkedName += "checked ";}
- //if(treeSelectable[i] != '1'){ linkedName += "disabled ";}
- //linkedName += "onClick = 'if(this.checked){parent.handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"visible\",1);parent.setSingleMapRequest(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\");}";
- //linkedName += "else{parent.handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"visible\",0);parent.setSingleMapRequest(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\");}'";
- //linkedName += '>';
-
-
- //no checkbox for the query
- <?php
- if(isset($_REQUEST["noquerycheckbox"])){
- $nocheck = $_REQUEST["noquerycheckbox"];
- }
- else{
- $nocheck = false;
- }
- echo "var noquerycheck = ".$nocheck.";";
- ?>
- ///evudb/images/mapbender/button_gray/query_off.gif
- ///evudb/images/mapbender/button_gray/query_on.gif
- if (noquerycheck==false || noquerycheck==0){
- if(treeQuerylayer[i] == '1' && treeVisible[i] == 1){
- //Info aktiv
- //alert('info aktiv');
- linkedName += ' <a href="#" onclick="changeinfo('+ i +')"><input type=hidden id="'+treeWMS[i]+'###'+treeShortname[i]+'###querylayer" value=1><img name="query'+ i +'" id="query'+i+'" border=0 src="'+qimages[2]+'" alt="'+qimages_text[2]+'"></A>';
- }
- else
- {
- //alert(treeQueryable[i] + ' ' + treeShortname[i]);
- if(treeQueryable[i] == '1')
- {
- //Info verfügbar
- if (treeVisible[i] ==1)
- {
- // Info aktivierbar
- linkedName += ' <a href="#" onclick="changeinfo('+ i +')"><input type=hidden id="'+treeWMS[i]+'###'+treeShortname[i]+'###querylayer" value=0><img name="query'+ i +'" id="query'+i+'" border=0 src="'+qimages[1]+'" alt="'+qimages_text[1]+'"></A>';
- }
- else
- {
- // Info nicht aktivierbar
- linkedName += ' <a href="#" onclick="changeinfo('+ i +')"><input type=hidden id="'+treeWMS[i]+'###'+treeShortname[i]+'###querylayer" value=0><img name="query'+ i +'" id="query'+i+'" border=0 src="'+qimages[3]+'" alt="'+qimages_text[3]+'"></A>';
- }
- }
- else
- {
- //Info nicht verfügbar verfügbar --> kein Image
- //linkedName += ' <input type=hidden id="'+treeWMS[i]+'###'+treeShortname[i]+'###querylayer" value=-1><img name="query'+ i +'" id="query'+i+'" border=0 src="<?php echo $no_info;?>" alt="keine Informationen verfügbar">';
- }
- }
- //linkedName += "<input id='"+treeWMS[i]+"###"+treeShortname[i]+"###querylayer' type='checkbox' ";
- //if(treeQuerylayer[i] == '1' && treeVisible[i] == 1){ linkedName += "checked ";}
- //if(treeQueryable[i] != '1' || treeVisible[i] != 1){ linkedName += "disabled ";}
- //linkedName += "onClick = 'if(this.checked){parent.handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"querylayer\",1);}";
- //linkedName += "else{parent.handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"querylayer\",0);}'";
- //linkedName += '>';
- }
-
-
- //no legendlink for the layername
- <?php
- if(isset($_REQUEST["nolink"])){
- $nolegendlink = $_REQUEST["nolink"];
- }
- else{
- $nolegendlink = false;
- }
- echo "var nolink = ".$nolegendlink.";";
- ?>
-
-
- //linkedName += '<A id="'+treeWMS[i]+'_'+treeShortname[i]+'" HREF="' + treeUrl[i] + '" TARGET="' + defaultTarget + '"><IMG SRC="../img/tree/1w.gif" BORDER="0" WIDTH="3">' + treeName[i] + '</A>';
-
- linkedName += '<A id="'+treeWMS[i]+'_'+treeShortname[i];
- if (nolink==0 || nolink==false){
- linkedName += '" HREF="' + treeUrl[i];
- }
- linkedName +='" TARGET="' + defaultTarget + '"><IMG SRC="../img/tree/1w.gif" BORDER="0" WIDTH="3">' + treeName[i] + '</A>';
-
-
- }
- else
- linkedName = '<IMG SRC="../img/tree/1w.gif" BORDER="0" WIDTH="3">' + treeName[i]
- // don't link folder icon if node has no sons
- if ( i == idx-1 || treeP_id[i+1] != treeId[i] ) {
- if ( treeDeep[ i ] == 0 )
- folderImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="1" HSPACE="0">'
- else
- folderImg = ''
- } else {
- folderImg = '<A HREF="javascript:sitemapClick(' + treeId[i] + ')"><IMG ALIGN="BOTTOM" SRC="<?php echo $img["folder_off"];?>" BORDER="0" NAME="folder' + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0"></A>'
- }
- // which type of file icon should be displayed?
- if ( treeP_id[i] != 0 )
- {
- if ( lastEntryInFolder( treeId[i] ) )
- fileImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_last.gif" BORDER="0" NAME="file'
- + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'
- else
- fileImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file.gif" BORDER="0" NAME="file'
- + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'
- }
- else
- fileImg = ''
- // traverse parents up to root and show vertical lines if parent
- // is not the last entry on this layer
- verticales = ''
- for( var act_id=treeId[i] ; treeDeep[ id2treeIndex[ act_id ] ] > 1; )
- {
- act_id = treeP_id[ id2treeIndex[ act_id ]]
- if ( lastEntryInFolder( act_id ) )
- {
- verticales = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
- }
- else
- {
- verticales = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_vert.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
- }
- }
-
-
- document.writeln( divPrefix + treeId[i] + '"><NOBR> ' + verticales + fileImg + folderImg + linkedName + '</NOBR></DIV>'
- )
- }
- }
-
- var i = 1 ;
- images = new Array;
- qimages = new Array;
- images_text = new Array;
- qimages_text = new Array;
- images[1] = '<?php echo $eye_off;?>';
- images[2] = '<?php echo $eye_on;?>';
- qimages[1] = '<?php echo $info_off;?>';
- qimages[2] = '<?php echo $info_on;?>';
- qimages[3] = '<?php echo $no_info;?>';
- images_text[1] = 'klicken Sie hier um den Layer zu aktivieren';
- images_text[2] = 'klicken Sie hier um den Layer zu deaktivieren';
- qimages_text[1] = 'klicken Sie hier um die Informationen zu aktivieren';
- qimages_text[2] = 'klicken Sie hier um die Informationen zu deaktivieren';
- qimages_text[3] = 'Informationen momentan nicht verfügbar';
-
- function changevalue(id){
- var info = document.getElementById('query'+ id) ;
- var layer = document.getElementById('bild' + id) ;
- var wert = document.getElementById('treeWMS['+id+']');
- var query = document.getElementById(treeWMS[id]+'###'+treeShortname[id]+'###querylayer');
- //alert(wert.value);
- if(wert.value == 1){ //war sichtbar
- // Layer war sichtbar --> deaktivieren
- layer.src = images[1];
- layer.alt = images_text[1];
- //if(treeQuerylayer[id] == 1){
- //Infobutton aendern, wenn Info abfragbar
- if(treeQueryable[id] == '1')
- {
- info.src = qimages[3];
- info.alt = qimages_text[3];
- // Info deaktivieren
- query.value = 0 ; // Ausschalten der Abfrage wenn nicht sichtbar
- query.checked = false;
- query.disabled = true;
- parent.handleSelectedLayer(mod_treeGDE_map,treeWMS[id],treeShortname[id],'querylayer',0); // Info disabled
- }
- wert.value=0;
- //alert(wert.value);
- // Anzeige des Layers deaktivieren
- parent.handleSelectedLayer(mod_treeGDE_map,treeWMS[id],treeShortname[id],'visible',0);
- parent.setSingleMapRequest(mod_treeGDE_map,treeWMS[id]);
-
-
-
- }
- else
- {
- // Layer war nicht sichtbar --> aktivieren
- layer.src = images[2];
- layer.alt = images_text[2]
- wert.value=1;
- //alert(wert.value);
- // Anzeige des Layers aktivieren
- parent.handleSelectedLayer(mod_treeGDE_map,treeWMS[id],treeShortname[id],'visible',1);
- parent.setSingleMapRequest(mod_treeGDE_map,treeWMS[id]);
- // evtl. Info aktivieren und Button aendern
- if(treeQueryable[id] == '1')
- {
- if (treeQuerylayer[id] == 1)
- {
- //Info aktivieren
- info.src = qimages[2];
- info.alt = qimages_text[2];
- parent.handleSelectedLayer(mod_treeGDE_map,treeWMS[id],treeShortname[id],'querylayer',1);
- query.value = 1;
- query.disabled = false;
- }
- else
- {
- //Info aktivierbar
- info.src = qimages[1];
- info.alt = qimages_text[1];
- query.value = 0;
- query.disabled = false;
-
- }
- }
- }
-
- }
-
- function changeinfo(id)
- {
- var info = document.getElementById('query'+ id) ;
- var wert = document.getElementById('treeWMS['+id+']');
- var query = document.getElementById(treeWMS[id]+'###'+treeShortname[id]+'###querylayer');
- //"'+treeWMS[i]+'###'+treeShortname[i]+'###querylayer"
- // alert(query.value);
- //alert(layer.src == '../img/orangeball.gif');
- //alert(wert.value);
- if(query.value == 1)
- { //war sichtbar
- // Info war aktiviert --> deaktivieren
- info.src = qimages[1];
- info.alt = qimages_text[1];
- parent.handleSelectedLayer(mod_treeGDE_map,treeWMS[id],treeShortname[id],'querylayer',0);
-
- query.value = 0 ; // Ausschalten der Abfrage wenn nicht sichtbar
- //query.checked = false; //<--wozu?
- query.disabled = true;
- }
- else
- {
- // Info war deaktiviert --> aktivieren
- if(wert.value == 1)
- {
- info.src = qimages[2];
- info.alt = qimages_text[2];
- query.value=1;
-
- //alert(wert.value);
- parent.handleSelectedLayer(mod_treeGDE_map,treeWMS[id],treeShortname[id],'querylayer',1);
- //if(treeQuerylayer[id] == 1){
- //query.checked = false; //<--wozu?
- query.disabled = false;
- //}
- }
- }
-
- }
- function initStyles ( )
- {
- document.writeln( '<STYLE TYPE="text/css">' + "\n" + '<!--' )
- for ( var i=1,y=y0; i<idx; i++ )
- {
- document.writeln( '#sitemap' + treeId[i] + ' {POSITION: absolute; VISIBILITY: hidden;}' )
- if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
- y += deltaY
- }
- document.writeln( '#sitemapinfo {POSITION: absolute; VISIBILITY: visible;}' )
- document.writeln( '//-->' + "\n" + '</STYLE>' )
- }
-
-
-
- function sitemapClick( id )
- {
- var i = id2treeIndex[ id ]
-
- if ( treeIsOn[ i ] )
- // close directory
- {
- // mark node as invisible
- treeIsOn[ i ]=false
- // mark all sons as invisible
- actDeep = treeDeep[ i ]
- for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
- {
- treeWasOn[ j ] = treeIsOn[ j ]
- treeIsOn[ j ]=false
- }
- gif_off( id )
- }
- else
- // open directory
- {
- treeIsOn[ i ]=true
- // remember and restore old status
- actDeep = treeDeep[ i ]
- for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
- {
- treeIsOn[ j ] = treeWasOn[ j ]
- }
- gif_on( id )
- }
- showTree()
- }
-
- function knotDeep( id )
- {
- var deep=0
- while ( true )
- if ( treeP_id[ id2treeIndex[id] ] == 0 )
- return deep
- else
- {
- ++deep
- id = treeP_id[ id2treeIndex[id] ]
- }
- return deep
- }
-
- function initTree( id )
- {
- treeIsOn[ id2treeIndex[id] ] = true
- if ( treeTyp[ id2treeIndex[id] ] != 'b' )
- gif_on( id )
- while ( treeP_id[ id2treeIndex[id] ] != 0 )
- {
- id = treeP_id[ id2treeIndex[id] ]
- treeIsOn[ id2treeIndex[id] ] = true
- if ( treeTyp[ id2treeIndex[id] ] != 'b' )
- gif_on( id )
- }
- }
-
- function lastEntryInFolder( id )
- {
- var i = id2treeIndex[id]
- if ( i == idx-1 )
- return true
- if ( treeTyp[i] == 'b' )
- {
- if ( treeP_id[i+1] != treeP_id[i] )
- return true
- else
- return false
- }
- else
- {
- var actDeep = treeDeep[i]
- for( var j=i+1; j<idx && treeDeep[j] > actDeep ; j++ )
- ;
- if ( j<idx && treeDeep[j] == actDeep )
- return false
- else
- return true
- }
- }
-
- function showTree()
- {
- for( var i=1, y=y0, x=x0; i<idx; i++ )
- {
- if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
- {
- // show current node
- if ( !(y == treeLastY[i] && treeIsShown[i] ) )
- {
- showLayer( "sitemap"+ treeId[i] )
- setyLayer( "sitemap"+ treeId[i], y )
- treeIsShown[i] = true
- }
- treeLastY[i] = y
- y += deltaY
- }
- else
- {
- // hide current node and all sons
- if ( treeIsShown[ i ] )
- {
- hideLayer( "sitemap"+ treeId[i] )
- treeIsShown[i] = false
- }
- }
- }
- }
-
- function initIndex() {
- for( var i=0; i<idx; i++ )
- id2treeIndex[ treeId[i] ] = i
- }
-
- function gif_name (name, width, height) {
- this.on = new Image (width, height);
- this.on.src = '<?echo $img["folder_on"];?>';
- this.off = new Image (width, height);
- this.off.src = '<?echo $img["folder_off"]?>';
- }
-
- function load_gif (name, width, height) {
- gif_name [name] = new gif_name (name,width,height);
- }
-
- function load_all () {
- load_gif ('folder',30,16)
- file_last = new Image( 30,16 )
- file_last.src = "../img/tree/file_last.gif"
- file_middle = new Image( 30,16 )
- file_middle.src = "../img/tree/file.gif"
- file_vert = new Image( 30,16 )
- file_vert.src = "../img/tree/file_vert.gif"
- file_empty = new Image( 30,16 )
- file_empty = "../img/tree/file_empty.gif"
- }
-
- function gif_on ( id ) {
- eval("document['folder" + id + "'].src = gif_name['folder'].on.src")
- }
-
- function gif_off ( id ) {
- eval("document['folder" + id + "'].src = gif_name['folder'].off.src")
- }
-
- // global configuration
- var deltaX = 30
- var deltaY = 16
- var x0 = 5
- var y0 = 5
- var defaultTarget = 'examplemain'
-
- var browserName = navigator.appName;
- var browserVersion = parseInt(navigator.appVersion);
- var isIE = false;
- var isNN = false;
- var isDOM = false;
- var isDomIE = false;
- var isDomNN = false;
- var layerok = false;
-
- var isIE = browserName.indexOf("Microsoft Internet Explorer" )==-1?false:true;
- var isNN = browserName.indexOf("Netscape")==-1?false:true;
- var isOpera = browserName.indexOf("Opera")==-1?false:true;
- var isDOM = document.getElementById?true:false;
- var isDomNN = document.layers?true:false;
- var isDomIE = document.all?true:false;
-
- if ( isNN && browserVersion>=4 ) layerok=true;
- if ( isIE && browserVersion>=4 ) layerok=true;
- if ( isOpera && browserVersion>=5 ) layerok=true;
-
-
- function hideLayer(layerName) {
- if (isDOM)
- document.getElementById(layerName).style.visibility="hidden"
- else if (isDomIE)
- document.all[layerName].style.visibility="hidden";
- else if (isDomNN)
- document.layers[layerName].visibility="hidden";
- }
-
- function showLayer(layerName) {
- if (isDOM)
- document.getElementById(layerName).style.visibility="visible"
- else if (isDomIE)
- document.all[layerName].style.visibility="visible";
- else if (isDomNN)
- document.layers[layerName].visibility="visible";
- }
-
- function setyLayer(layerName, y) {
- if (isDOM)
- document.getElementById(layerName).style.top=y
- else if (isDomIE)
- document.all[layerName].style.top=y;
- else if (isDomNN)
- document.layers[layerName].top=y;
- }
-
- var id2treeIndex = new Array()
-
- // the structure is easy to understand with a simple example
- // p_id is the id of the parent
- // E0 ( id=0,p_id=-1 )
- // E11 ( id=1,p_id=0)
- // E111 ( id=2,p_id=1 )
- // E112 ( id=3,p_id=1 )
- // E12 ( id=4,p_id=0 )
- // E121 ( id=5,p_id=4 )
- // E13 ( id=6,p_id=0 )
- // E131 ( id=7,p_id=6 )
- // E1311 ( id=8,p_id=7 )
- // E132 ( id=9,p_id=6 )
- // this is a multinary tree structure which is easy to
- // populate with database data :)
-function initArray(){
- var parentObj = 0;
- if(parent.mb_mapObj.length == 0){ window.setTimeout("initArray()",100); }
- else if(parent.mb_mapObj.length > 0){
- Note(0,-1,'','');
- for(var i=0; i<parent.mb_mapObj.length; i++){
- if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
- for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
- if(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 == ""){
- //alert((parseInt(temp.layer_id)+1) + " , " +0 + " , " +temp.layer_title + " , " +'');
- Note((parseInt(temp.layer_id)+1),0,temp.layer_title,'','','','','');
- parentObj = temp.layer_id+1;
- }
- if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == "0"){
-
- if(temp.gui_layer_selectable == '1' || temp.gui_layer_queryable == '1'){
-
- Note((parseInt(temp.layer_id)+1),parentObj,temp.layer_title,'../metadata/metadata.php?wms_id='+parseInt(parent.mb_mapObj[i].wms[ii].wms_id)+'&gui_layer_wms_id='+temp.gui_layer_wms_id+'&layer_name='+temp.layer_name,temp.gui_layer_selectable,temp.gui_layer_visible,temp.gui_layer_queryable,temp.gui_layer_querylayer,parent.mb_mapObj[i].wms[ii].wms_title,temp.layer_name);
- //Note((parseInt(temp.layer_id)+1),parentObj,temp.layer_title,'dasdf',temp.gui_layer_selectable,temp.gui_layer_visible,temp.gui_layer_queryable,temp.gui_layer_querylayer,parent.mb_mapObj[i].wms[ii].wms_title,temp.layer_name);
- }
- }
- }
- }
- }
- }
- }
- //Note(22,1,'willi','adfasd');
- treeTyp[0] = 'f'
- treeIsOn[0] = true
- treeWasOn[0] = true
- }
-}
- function initArray_()
- {
- Note(0,-1,'','')
- Note(1,0,'Tutorials','')
- Note(8,1,'HTML','')
- Note(10,8,'SelfHtml','http://www.teamone.de/selfaktuell/')
- Note(9,1,'willi','')
- Note(100,9,'SelfHtml','http://www.teamone.de/selfaktuell/')
- Note(3,1,'JavaScript','')
- Note(4,3, 'Netscape Guide 1.3','http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm')
- Note(7,3, 'Introduction to Javascript','http://rummelplatz.uni-mannheim.de/~skoch/js/script.htm')
- Note(12,1, 'Perl','')
- Note(14,12, 'Perl Tutorial','http://www.awu.id.ethz.ch/~didi/perl/perl_start.html')
- Note(13,1,'SQL','')
- Note(15,13, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
- Note(111,1, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
- Note(2,0, 'Reference Manuals','')
- Note(11,2, 'HTML Version 3.2 Referenz','http://www.cls-online.de/htmlref/index.htm')
- Note(6,2,'Netscape Reference 1.3','http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm')
- Note(17,2,'PHP Manual','http://www.php.net/manual/html/')
- treeTyp[0] = 'f'
- treeIsOn[0] = true
- treeWasOn[0] = true
- }
-
- var idx=0
- initArray()
- initIndex()
- load_all()
- for( i=1; i<idx; i++ )
- {
- treeDeep[i] = knotDeep( treeId[i] )
- if ( treeDeep[i] == 0 )
- treeIsShown[i] = true
- }
- if ( isDomNN )
- initStyles();
- //-->
- </SCRIPT>
-</HEAD>
-<BODY VLINK="#000000" ALINK="#000000" LINK="#000000" BGCOLOR="#ffffff" TEXT="#000000"
- onLoad="if (layerok) showTree();mod_treeGDE();"
- MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0">
-<SCRIPT language="JavaScript1.2">
-<!--
- initDiv()
- //hideLayer("sitemapinfo")
-//-->
-</SCRIPT>
-</BODY>
-</HTML>
Modified: trunk/mapbender/http/include/dyn_css.php
===================================================================
--- trunk/mapbender/http/include/dyn_css.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/include/dyn_css.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-require_once("../../conf/mapbender.conf");
+require_once(dirname(__FILE__) . "/../../conf/mapbender.conf");
$con = db_connect(DBSERVER,OWNER,PW);
db_select_db(DB,$con);
Modified: trunk/mapbender/http/include/dyn_js.php
===================================================================
--- trunk/mapbender/http/include/dyn_js.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/include/dyn_js.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -20,7 +20,7 @@
if(isset($gui_id))
{
$sql = "SELECT * FROM gui_element_vars WHERE fkey_e_id = $1 AND fkey_gui_id = $2 and var_type='var'";
- $v = array($e_id_css,$gui_id);
+ $v = array($e_id,$gui_id);
$t = array('s','s');
$res = db_prep_query($sql,$v,$t);
$arrays = array();
Modified: trunk/mapbender/http/print/mod_printPDF.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/print/mod_printPDF.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -18,6 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
session_start();
require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Modified: trunk/mapbender/http/print/mod_printPDF_pdf.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF_pdf.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/print/mod_printPDF_pdf.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#require_once("../php/mb_validateSession.php");
+#require_once(dirname(__FILE__) . "/../php/mb_validateSession.php");
ob_start();
session_start();
ini_set('error_reporting', 'E_ALL & ~ E_NOTICE');
@@ -30,6 +30,7 @@
include (dirname(__FILE__)."/../print/".$_REQUEST["conf"]);
include (dirname(__FILE__)."/../classes/class_SaveLegend.php");
include (dirname(__FILE__)."/../print/print_functions.php");
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
if($log == true){
include (dirname(__FILE__)."/../classes/class_log.php");
@@ -547,11 +548,7 @@
$scalebar = false;
}
-else{
- $scalebar = true;
-}
-
if($scalebar == true){
if ($size == "A4" && $format == "portrait"){
$scalebar_left = $a4p_scalebar_left;
Copied: trunk/mapbender/http/sld (from rev 2404, branches/2.5/http/sld)
Copied: trunk/mapbender/http/sld/classes (from rev 2404, branches/2.5/http/sld/classes)
Deleted: trunk/mapbender/http/sld/classes/AddOperationModule.php
===================================================================
--- branches/2.5/http/sld/classes/AddOperationModule.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/AddOperationModule.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,80 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Template class that only creates the source code for the function of adding an operation
- * is used whereever an operation can be added. Simpyl change this class and the change
- * will affect all the appearences of the add operation function.
- *
- * @package filter_classes
- * @author Markus Krzyzanowski
- */
-class AddOperationModule
-{
- /**
- * stores the id of the referring object (the id member field of the object!)
- */
- var $objId = "";
- /**
- * stores the prefix of the referring object's html-form-fields
- */
- var $htmlId = "";
-
- /**
- * constructor that sets the necessary values ov the member fields
- */
- function AddOperationModule($objId, $htmlId)
- {
- $this->objId = $objId;
- $this->htmlId = $htmlId;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($offset = "")
- {
- $temp = "";
- $temp .= $offset."<select name=\"".$this->htmlId."_newoperation\">\n";
- $temp .= $offset." <option value=\"and\">AND - logisches UND</option>\n";
- $temp .= $offset." <option value=\"or\">OR - logisches ODER</option>\n";
- $temp .= $offset." <option value=\"not\">NOT - logisches NICHT</option>\n";
- $temp .= $offset." <option value=\"propertyisequalto\">Eigenschaft = x</option>\n";
- $temp .= $offset." <option value=\"propertyisnotequalto\">Eigenschaft != x</option>\n";
- $temp .= $offset." <option value=\"propertyisgreaterthan\">Eigenschaft > x</option>\n";
- $temp .= $offset." <option value=\"propertyisgreaterthanorequalto\">Eigenschaft >= x</option>\n";
- $temp .= $offset." <option value=\"propertyislessthan\">Eigenschaft < x</option>\n";
- $temp .= $offset." <option value=\"propertyislessthanorequalto\">Eigenschaft <= x</option>\n";
- $temp .= $offset." <option value=\"propertyislike\">Eigenschaft �hnlich x</option>\n";
- $temp .= $offset." <option value=\"propertyisnull\">Eigenschaft nicht definiert</option>\n";
- $temp .= $offset." <option value=\"propertyisbetween\">x <= Eigenschaft <= y</option>\n";
- $temp .= $offset."</select>\n";
- $temp .= $offset."<span class=\"edit hand\"";
- $temp .= " onClick=\"url='?function=addoperation&id=".$this->objId."&operation=';";
- $temp .= " url += document.editFilter.".$this->htmlId."_newoperation.value;";
- $temp .= " location.href = url;\"";
- $temp .= ">";
- $temp .= "<img src='./img/plus.gif' border='0'> hinzufügen\n</span>";
- return $temp;
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/AddOperationModule.php (from rev 2404, branches/2.5/http/sld/classes/AddOperationModule.php)
===================================================================
--- trunk/mapbender/http/sld/classes/AddOperationModule.php (rev 0)
+++ trunk/mapbender/http/sld/classes/AddOperationModule.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,80 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Template class that only creates the source code for the function of adding an operation
+ * is used whereever an operation can be added. Simpyl change this class and the change
+ * will affect all the appearences of the add operation function.
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class AddOperationModule
+{
+ /**
+ * stores the id of the referring object (the id member field of the object!)
+ */
+ var $objId = "";
+ /**
+ * stores the prefix of the referring object's html-form-fields
+ */
+ var $htmlId = "";
+
+ /**
+ * constructor that sets the necessary values ov the member fields
+ */
+ function AddOperationModule($objId, $htmlId)
+ {
+ $this->objId = $objId;
+ $this->htmlId = $htmlId;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<select name=\"".$this->htmlId."_newoperation\">\n";
+ $temp .= $offset." <option value=\"and\">AND - logisches UND</option>\n";
+ $temp .= $offset." <option value=\"or\">OR - logisches ODER</option>\n";
+ $temp .= $offset." <option value=\"not\">NOT - logisches NICHT</option>\n";
+ $temp .= $offset." <option value=\"propertyisequalto\">Eigenschaft = x</option>\n";
+ $temp .= $offset." <option value=\"propertyisnotequalto\">Eigenschaft != x</option>\n";
+ $temp .= $offset." <option value=\"propertyisgreaterthan\">Eigenschaft > x</option>\n";
+ $temp .= $offset." <option value=\"propertyisgreaterthanorequalto\">Eigenschaft >= x</option>\n";
+ $temp .= $offset." <option value=\"propertyislessthan\">Eigenschaft < x</option>\n";
+ $temp .= $offset." <option value=\"propertyislessthanorequalto\">Eigenschaft <= x</option>\n";
+ $temp .= $offset." <option value=\"propertyislike\">Eigenschaft �hnlich x</option>\n";
+ $temp .= $offset." <option value=\"propertyisnull\">Eigenschaft nicht definiert</option>\n";
+ $temp .= $offset." <option value=\"propertyisbetween\">x <= Eigenschaft <= y</option>\n";
+ $temp .= $offset."</select>\n";
+ $temp .= $offset."<span class=\"edit hand\"";
+ $temp .= " onClick=\"url='?function=addoperation&id=".$this->objId."&operation=';";
+ $temp .= " url += document.editFilter.".$this->htmlId."_newoperation.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">";
+ $temp .= "<img src='./img/plus.gif' border='0'> hinzufügen\n</span>";
+ return $temp;
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/AnchorPoint.php
===================================================================
--- branches/2.5/http/sld/classes/AnchorPoint.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/AnchorPoint.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,151 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the AnchorPoint-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class AnchorPoint
-{
- /**
- * The anchorpointx attribute from the xml-scheme.
- * Allowed values are between 0 and 1.
- * @var float
- */
- var $anchorpointx = "";
-
- /**
- * The anchorpointy attribute from the xml-scheme.
- * Allowed values are between 0 and 1.
- * @var float
- */
- var $anchorpointy = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<AnchorPoint>\n";
- $temp .= $offset." <AnchorPointX>".htmlspecialchars($this->anchorpointx)."</AnchorPointX>\n";
- $temp .= $offset." <AnchorPointY>".htmlspecialchars($this->anchorpointy)."</AnchorPointY>\n";
- $temp .= $offset."</AnchorPoint>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"anchorpoint\">\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." AnchorPointX:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- //TODO - check possible values and their meaning
- $temp .= $offset." <select name=\"".$id."_anchorpointx\">\n";
- $temp .= $offset." <option value=\"0.0\"";
- if ( $this->anchorpointx == "0.0") $temp .= " selected";
- $temp .= ">0.0 - Ankerpunkt rechts</option>\n";
- $temp .= $offset." <option value=\"0.5\"";
- if ( $this->anchorpointx == "0.5") $temp .= " selected";
- $temp .= ">0.5 - Ankerpunkt mitte</option>\n";
- $temp .= $offset." <option value=\"1.0\"";
- if ( $this->anchorpointx == "1.0") $temp .= " selected";
- $temp .= ">1.0 - Ankerpunkt links</option>\n";
- $temp .= $offset." </select>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." AnchorPointY:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- //TODO - check possible values and their meaning
- $temp .= $offset." <select name=\"".$id."_anchorpointy\">\n";
- $temp .= $offset." <option value=\"0.0\"";
- if ( $this->anchorpointy == "0.0") $temp .= " selected";
- $temp .= ">0.0 - Ankerpunkt oben</option>\n";
- $temp .= $offset." <option value=\"0.5\"";
- if ( $this->anchorpointy == "0.5") $temp .= " selected";
- $temp .= ">0.5 - Ankerpunkt mitte</option>\n";
- $temp .= $offset." <option value=\"1.0\"";
- if ( $this->anchorpointy == "1.0") $temp .= " selected";
- $temp .= ">1.0 - Ankerpunkt unten</option>\n";
- $temp .= $offset." </select>\n";
-
-
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_anchorpointx"]))
- {
- $this->anchorpointx = $_REQUEST[$id."_anchorpointx"];
- }
- if (isset($_REQUEST[$id."_anchorpointy"]))
- {
- $this->anchorpointy = $_REQUEST[$id."_anchorpointy"];
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/AnchorPoint.php (from rev 2404, branches/2.5/http/sld/classes/AnchorPoint.php)
===================================================================
--- trunk/mapbender/http/sld/classes/AnchorPoint.php (rev 0)
+++ trunk/mapbender/http/sld/classes/AnchorPoint.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,151 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the AnchorPoint-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class AnchorPoint
+{
+ /**
+ * The anchorpointx attribute from the xml-scheme.
+ * Allowed values are between 0 and 1.
+ * @var float
+ */
+ var $anchorpointx = "";
+
+ /**
+ * The anchorpointy attribute from the xml-scheme.
+ * Allowed values are between 0 and 1.
+ * @var float
+ */
+ var $anchorpointy = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<AnchorPoint>\n";
+ $temp .= $offset." <AnchorPointX>".htmlspecialchars($this->anchorpointx)."</AnchorPointX>\n";
+ $temp .= $offset." <AnchorPointY>".htmlspecialchars($this->anchorpointy)."</AnchorPointY>\n";
+ $temp .= $offset."</AnchorPoint>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"anchorpoint\">\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." AnchorPointX:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ //TODO - check possible values and their meaning
+ $temp .= $offset." <select name=\"".$id."_anchorpointx\">\n";
+ $temp .= $offset." <option value=\"0.0\"";
+ if ( $this->anchorpointx == "0.0") $temp .= " selected";
+ $temp .= ">0.0 - Ankerpunkt rechts</option>\n";
+ $temp .= $offset." <option value=\"0.5\"";
+ if ( $this->anchorpointx == "0.5") $temp .= " selected";
+ $temp .= ">0.5 - Ankerpunkt mitte</option>\n";
+ $temp .= $offset." <option value=\"1.0\"";
+ if ( $this->anchorpointx == "1.0") $temp .= " selected";
+ $temp .= ">1.0 - Ankerpunkt links</option>\n";
+ $temp .= $offset." </select>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." AnchorPointY:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ //TODO - check possible values and their meaning
+ $temp .= $offset." <select name=\"".$id."_anchorpointy\">\n";
+ $temp .= $offset." <option value=\"0.0\"";
+ if ( $this->anchorpointy == "0.0") $temp .= " selected";
+ $temp .= ">0.0 - Ankerpunkt oben</option>\n";
+ $temp .= $offset." <option value=\"0.5\"";
+ if ( $this->anchorpointy == "0.5") $temp .= " selected";
+ $temp .= ">0.5 - Ankerpunkt mitte</option>\n";
+ $temp .= $offset." <option value=\"1.0\"";
+ if ( $this->anchorpointy == "1.0") $temp .= " selected";
+ $temp .= ">1.0 - Ankerpunkt unten</option>\n";
+ $temp .= $offset." </select>\n";
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_anchorpointx"]))
+ {
+ $this->anchorpointx = $_REQUEST[$id."_anchorpointx"];
+ }
+ if (isset($_REQUEST[$id."_anchorpointy"]))
+ {
+ $this->anchorpointy = $_REQUEST[$id."_anchorpointy"];
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/BinaryComparisonOp.php
===================================================================
--- branches/2.5/http/sld/classes/BinaryComparisonOp.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/BinaryComparisonOp.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,158 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the BinaryComparisonOp-element
- *
- * @package filter_classes
- * @author Markus Krzyzanowski
- */
-class BinaryComparisonOp
-{
- /**
- * Defines the type of comparison operation.
- * @var string
- */
- var $name = "";
-
- /**
- * Name of the property that is addressed in this comparison.
- * @var string
- */
- var $ogcPropertyName = "";
-
- /**
- * String that is compared to the property-value.
- * Regular Expression?
- * @var string
- */
- var $ogcLiteral = "";
-
- /**
- * Index of this object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * constructor that directly fills the $name variable.
- * @param string $name the type of the comparison operation
- */
- function BinaryComparisonOp($name)
- {
- $this->name = $name;
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<ogc:".$this->name.">\n";
- $temp .= $offset. " <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
- $temp .= $offset. " <ogc:Literal>".$this->ogcLiteral."</ogc:Literal>\n";
- $temp .= $offset."</ogc:".$this->name.">\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id = "", $offset = "")
- {
- $temp = "";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
-
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"binaryComparisonOp\">\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".$this->name."\">\n";
- if (count($_SESSION["sld_objects"][3]->attrs)>0) {
- $temp .= $offset." <input type=\"hidden\" id=\"".$id."_ogcpropertyname\" name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
- $temp_elements = $_SESSION["sld_objects"][3]->generateElementsHtml($id."_ogcpropertyname",$this->ogcPropertyName);
- $temp .= $offset.$temp_elements;
- } else {
- $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
- }
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td style=\"width:50px; text-align: center; font-size: large; \">";
-
- switch($this->name)
- {
- case "PropertyIsEqualTo": $temp .= "="; break;
- case "PropertyIsNotEqualTo": $temp .= "!="; break;
- case "PropertyIsGreaterThan": $temp .= ">"; break;
- case "PropertyIsGreaterThanOrEqualTo": $temp .= ">="; break;
- case "PropertyIsLessThan": $temp .= "<"; break;
- case "PropertyIsLessThanOrEqualTo": $temp .= "<="; break;
- default: $temp .= $this->name;
- }
- $temp .= "\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- $temp .= $offset." <input name=\"".$id."_ogcliteral\" value=\"".$this->ogcLiteral."\">\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
- $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
- $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
-
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $this->name = $_REQUEST[$id."_name"];
- $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
- $this->ogcLiteral = $_REQUEST[$id."_ogcliteral"];
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/BinaryComparisonOp.php (from rev 2404, branches/2.5/http/sld/classes/BinaryComparisonOp.php)
===================================================================
--- trunk/mapbender/http/sld/classes/BinaryComparisonOp.php (rev 0)
+++ trunk/mapbender/http/sld/classes/BinaryComparisonOp.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,158 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the BinaryComparisonOp-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class BinaryComparisonOp
+{
+ /**
+ * Defines the type of comparison operation.
+ * @var string
+ */
+ var $name = "";
+
+ /**
+ * Name of the property that is addressed in this comparison.
+ * @var string
+ */
+ var $ogcPropertyName = "";
+
+ /**
+ * String that is compared to the property-value.
+ * Regular Expression?
+ * @var string
+ */
+ var $ogcLiteral = "";
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * constructor that directly fills the $name variable.
+ * @param string $name the type of the comparison operation
+ */
+ function BinaryComparisonOp($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ogc:".$this->name.">\n";
+ $temp .= $offset. " <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
+ $temp .= $offset. " <ogc:Literal>".$this->ogcLiteral."</ogc:Literal>\n";
+ $temp .= $offset."</ogc:".$this->name.">\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"binaryComparisonOp\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".$this->name."\">\n";
+ if (count($_SESSION["sld_objects"][3]->attrs)>0) {
+ $temp .= $offset." <input type=\"hidden\" id=\"".$id."_ogcpropertyname\" name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
+ $temp_elements = $_SESSION["sld_objects"][3]->generateElementsHtml($id."_ogcpropertyname",$this->ogcPropertyName);
+ $temp .= $offset.$temp_elements;
+ } else {
+ $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width:50px; text-align: center; font-size: large; \">";
+
+ switch($this->name)
+ {
+ case "PropertyIsEqualTo": $temp .= "="; break;
+ case "PropertyIsNotEqualTo": $temp .= "!="; break;
+ case "PropertyIsGreaterThan": $temp .= ">"; break;
+ case "PropertyIsGreaterThanOrEqualTo": $temp .= ">="; break;
+ case "PropertyIsLessThan": $temp .= "<"; break;
+ case "PropertyIsLessThanOrEqualTo": $temp .= "<="; break;
+ default: $temp .= $this->name;
+ }
+ $temp .= "\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <input name=\"".$id."_ogcliteral\" value=\"".$this->ogcLiteral."\">\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
+ $this->ogcLiteral = $_REQUEST[$id."_ogcliteral"];
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/BinaryLogicOp.php
===================================================================
--- branches/2.5/http/sld/classes/BinaryLogicOp.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/BinaryLogicOp.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,208 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the BinaryLogicOp-element
- *
- * @package filter_classes
- * @author Markus Krzyzanowski
- */
-class BinaryLogicOp
-{
- /**
- * Defines the type of logical operation.
- * Possible values: and + or
- * @var string
- */
- var $name = "";
-
- /**
- * Array containing the operations of this filter
- * @see UnaryLogicOp
- * @see BinaryLogicOp
- * @see BinaryComparisonOp
- * @see PropertyIsLike
- * @see PropertyIsNull
- * @see PropertyIsBetween
- * @var array
- */
- var $operations = array();
-
- /**
- * Index of this object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * Constructor that directly fills the $name variable.
- * @param string $name the type of this logical operation.
- */
- function BinaryLogicOp($name)
- {
- $this->name = $name;
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<ogc:".$this->name.">\n";
- foreach($this->operations as $operation)
- {
- $temp .= $operation->generateXml($offset." ");
- }
- $temp .= $offset."</ogc:".$this->name.">\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id = "", $offset = "")
- {
- $temp = "";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"binaryLogicOp\">\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".$this->name."\">\n";
-
- $temp .= $offset." ".$this->name."<br>\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
- $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
- $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
-
-
-
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td colspan=\"3\">\n";
-
- $temp .= $offset." <table>\n";
-
- $displayOperationModule = new DisplayOperationModule();
- $temp .= $displayOperationModule->generateHtmlForm($offset." ", $this->operations, $id);
-
- if(count($this->operations) == 1)
- {
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td colspan=\"4\">\n";
- $temp .= $offset." <hr style=\"color: black\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
- }
-
-
- //Only 2 Operations
- //if (count($this->operations) < 2)
- // why should there be only 2 operations? Nothing in the specs ...
-
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td colspan=\"4\">\n";
-
- $addOperationModule = new AddOperationModule($this->id, $id);
- $temp .= $addOperationModule->generateHtmlForm($offset." ");
-
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
-
- $temp .= $offset." </table>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
-
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $this->name = $_REQUEST[$id."_name"];
- $countOperations = 0;
- while (isset($_REQUEST[$id."_operation_".$countOperations]))
- {
- if ($_REQUEST[$id."_operation_".$countOperations] == "binaryComparisonOp")
- {
- $operation = new BinaryComparisonOp();
- }
- if ($_REQUEST[$id."_operation_".$countOperations] == "binaryLogicOp")
- {
- $operation = new BinaryLogicOp();
- }
- if ($_REQUEST[$id."_operation_".$countOperations] == "unaryLogicOp")
- {
- $operation = new UnaryLogicOp();
- }
- if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsLike")
- {
- $operation = new PropertyIsLike();
- }
- if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsNull")
- {
- $operation = new PropertyIsNull();
- }
- if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsBetween")
- {
- $operation = new PropertyIsBetween();
- }
-
- $operation->generateObjectFromPost($id."_operation_".$countOperations);
- $this->operations[] = $operation;
- $countOperations++;
- }
- }
-
- /**
- * deletes the rule with the given index from the $operations array
- * @param int $index index of the operation that has to be deleted
- */
- function deleteOperation($index)
- {
- array_splice($this->operations, $index, 1);
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/BinaryLogicOp.php (from rev 2404, branches/2.5/http/sld/classes/BinaryLogicOp.php)
===================================================================
--- trunk/mapbender/http/sld/classes/BinaryLogicOp.php (rev 0)
+++ trunk/mapbender/http/sld/classes/BinaryLogicOp.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,208 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the BinaryLogicOp-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class BinaryLogicOp
+{
+ /**
+ * Defines the type of logical operation.
+ * Possible values: and + or
+ * @var string
+ */
+ var $name = "";
+
+ /**
+ * Array containing the operations of this filter
+ * @see UnaryLogicOp
+ * @see BinaryLogicOp
+ * @see BinaryComparisonOp
+ * @see PropertyIsLike
+ * @see PropertyIsNull
+ * @see PropertyIsBetween
+ * @var array
+ */
+ var $operations = array();
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Constructor that directly fills the $name variable.
+ * @param string $name the type of this logical operation.
+ */
+ function BinaryLogicOp($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ogc:".$this->name.">\n";
+ foreach($this->operations as $operation)
+ {
+ $temp .= $operation->generateXml($offset." ");
+ }
+ $temp .= $offset."</ogc:".$this->name.">\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"binaryLogicOp\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".$this->name."\">\n";
+
+ $temp .= $offset." ".$this->name."<br>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td colspan=\"3\">\n";
+
+ $temp .= $offset." <table>\n";
+
+ $displayOperationModule = new DisplayOperationModule();
+ $temp .= $displayOperationModule->generateHtmlForm($offset." ", $this->operations, $id);
+
+ if(count($this->operations) == 1)
+ {
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"4\">\n";
+ $temp .= $offset." <hr style=\"color: black\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+
+
+ //Only 2 Operations
+ //if (count($this->operations) < 2)
+ // why should there be only 2 operations? Nothing in the specs ...
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"4\">\n";
+
+ $addOperationModule = new AddOperationModule($this->id, $id);
+ $temp .= $addOperationModule->generateHtmlForm($offset." ");
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ $temp .= $offset." </table>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ $countOperations = 0;
+ while (isset($_REQUEST[$id."_operation_".$countOperations]))
+ {
+ if ($_REQUEST[$id."_operation_".$countOperations] == "binaryComparisonOp")
+ {
+ $operation = new BinaryComparisonOp();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "binaryLogicOp")
+ {
+ $operation = new BinaryLogicOp();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "unaryLogicOp")
+ {
+ $operation = new UnaryLogicOp();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsLike")
+ {
+ $operation = new PropertyIsLike();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsNull")
+ {
+ $operation = new PropertyIsNull();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsBetween")
+ {
+ $operation = new PropertyIsBetween();
+ }
+
+ $operation->generateObjectFromPost($id."_operation_".$countOperations);
+ $this->operations[] = $operation;
+ $countOperations++;
+ }
+ }
+
+ /**
+ * deletes the rule with the given index from the $operations array
+ * @param int $index index of the operation that has to be deleted
+ */
+ function deleteOperation($index)
+ {
+ array_splice($this->operations, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/ColorMap.php
===================================================================
--- branches/2.5/http/sld/classes/ColorMap.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/ColorMap.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,135 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the ColorMap-element
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class ColorMap
-{
- /**
- * Array containing the ColorMapEntry objects from the sld.
- *
- * @see ColorMapEntry
- * @var object
- */
- var $colormapentries = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<ColorMap>\n";
- foreach ($this->colormapentries as $colormapentry)
- {
- $temp .= $colormapentry->generateXml($offset." ");
- }
- $temp .= $offset."</ColorMap>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." ColorMap<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"colormap\">\n";
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletecolormap&id=".$this->parent."\">löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $colormapentry_id = 0;
- foreach ($this->colormapentries as $colormapentry)
- {
- $temp .= $colormapentry->generateHtmlForm($id."_colormapentry_".$colormapentry_id, $offset." ");
- $colormapentry_id++;
- }
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addcolormapentry&id=".$this->id."\">ColorMapEntry hinzufügen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $countColorMapEntries = 0;
- while (isset($_REQUEST[$id."_colormapentry_".$countColorMapEntries]))
- {
- $colormapentry = new ColorMapEntry();
- $colormapentry->generateObjectFromPost($id."_colormapentry_".$countColorMapEntries);
- $this->colormapentries[] = $colormapentry;
- $countColorMapEntries++;
- }
- }
-
- /**
- * Adds a ColorMapEntry object to the array.
- */
- function addColorMapEntry()
- {
- $this->colormapentries[] = new ColorMapEntry();
- }
-
- /**
- * Deletes the ColorMapEntry object at the given index.
- * @param int $index index of the ColorMapEntry that has to be deleted
- */
- function deleteColorMapEntry($index)
- {
- array_splice($this->colormapentries, $index, 1);
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/ColorMap.php (from rev 2404, branches/2.5/http/sld/classes/ColorMap.php)
===================================================================
--- trunk/mapbender/http/sld/classes/ColorMap.php (rev 0)
+++ trunk/mapbender/http/sld/classes/ColorMap.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,135 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the ColorMap-element
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class ColorMap
+{
+ /**
+ * Array containing the ColorMapEntry objects from the sld.
+ *
+ * @see ColorMapEntry
+ * @var object
+ */
+ var $colormapentries = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ColorMap>\n";
+ foreach ($this->colormapentries as $colormapentry)
+ {
+ $temp .= $colormapentry->generateXml($offset." ");
+ }
+ $temp .= $offset."</ColorMap>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." ColorMap<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"colormap\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletecolormap&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $colormapentry_id = 0;
+ foreach ($this->colormapentries as $colormapentry)
+ {
+ $temp .= $colormapentry->generateHtmlForm($id."_colormapentry_".$colormapentry_id, $offset." ");
+ $colormapentry_id++;
+ }
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addcolormapentry&id=".$this->id."\">ColorMapEntry hinzufügen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countColorMapEntries = 0;
+ while (isset($_REQUEST[$id."_colormapentry_".$countColorMapEntries]))
+ {
+ $colormapentry = new ColorMapEntry();
+ $colormapentry->generateObjectFromPost($id."_colormapentry_".$countColorMapEntries);
+ $this->colormapentries[] = $colormapentry;
+ $countColorMapEntries++;
+ }
+ }
+
+ /**
+ * Adds a ColorMapEntry object to the array.
+ */
+ function addColorMapEntry()
+ {
+ $this->colormapentries[] = new ColorMapEntry();
+ }
+
+ /**
+ * Deletes the ColorMapEntry object at the given index.
+ * @param int $index index of the ColorMapEntry that has to be deleted
+ */
+ function deleteColorMapEntry($index)
+ {
+ array_splice($this->colormapentries, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/ColorMapEntry.php
===================================================================
--- branches/2.5/http/sld/classes/ColorMapEntry.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/ColorMapEntry.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,183 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the ColorMapEntry-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class ColorMapEntry
-{
- /**
- * The color attribute from the xml-scheme.
- * @var string
- */
- var $color = "";
-
- /**
- * The opacity attribute from the xml-scheme.
- * @var string
- */
- var $opacity = "";
-
- /**
- * The quantity attribute from the xml-scheme.
- * @var int
- */
- var $quantity = "";
-
- /**
- * The label attribute from the xml-scheme.
- * @var string
- */
- var $label = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<ColorMapEntry";
- if ($this->color != "") $temp.= " color=\"".htmlspecialchars($this->color)."\"";
- if ($this->opacity != "") $temp.= " opacity=\"".htmlspecialchars($this->opacity)."\"";
- if ($this->quantity != "") $temp.= " quantity=\"".htmlspecialchars($this->quantity)."\"";
- if ($this->label != "") $temp.= " label=\"".htmlspecialchars($this->label)."\"";
- $temp .= " />\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table>\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." ColormapEntry<br>\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
-
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletecolormapentry&id=".$this->parent."&number=".$number."\">löschen</a>\n";
-
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"colormapentry\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
-
- $temp .= $offset." <table>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td style=\"width: 100px\">\n";
- $temp .= $offset." Color:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td";
- $temp .= " id=\"".$id."_color_preview\" style=\"border: 1px solid black; width: 100px; cursor: hand; background-color:".htmlspecialchars($this->color).";\" ";
- $temp .= "onClick=\"window.open('sld_pick_color.php?id=".$id."_color','Farbauswahl','width=299, height=194, resizable=no');\">\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."_color\" value=\"".htmlspecialchars($this->color)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." Opacity:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_opacity\" value=\"".htmlspecialchars($this->opacity)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." Quantity:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_quantity\" value=\"".htmlspecialchars($this->quantity)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." Label:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_label\" value=\"".htmlspecialchars($this->label)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." </table>\n";
-
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_color"]))
- {
- $this->color = $_REQUEST[$id."_color"];
- }
- if (isset($_REQUEST[$id."_opacity"]))
- {
- $this->opacity = $_REQUEST[$id."_opacity"];
- }
- if (isset($_REQUEST[$id."_quantity"]))
- {
- $this->quantity = $_REQUEST[$id."_quantity"];
- }
- if (isset($_REQUEST[$id."_label"]))
- {
- $this->label = $_REQUEST[$id."_label"];
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/ColorMapEntry.php (from rev 2404, branches/2.5/http/sld/classes/ColorMapEntry.php)
===================================================================
--- trunk/mapbender/http/sld/classes/ColorMapEntry.php (rev 0)
+++ trunk/mapbender/http/sld/classes/ColorMapEntry.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,183 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the ColorMapEntry-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class ColorMapEntry
+{
+ /**
+ * The color attribute from the xml-scheme.
+ * @var string
+ */
+ var $color = "";
+
+ /**
+ * The opacity attribute from the xml-scheme.
+ * @var string
+ */
+ var $opacity = "";
+
+ /**
+ * The quantity attribute from the xml-scheme.
+ * @var int
+ */
+ var $quantity = "";
+
+ /**
+ * The label attribute from the xml-scheme.
+ * @var string
+ */
+ var $label = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ColorMapEntry";
+ if ($this->color != "") $temp.= " color=\"".htmlspecialchars($this->color)."\"";
+ if ($this->opacity != "") $temp.= " opacity=\"".htmlspecialchars($this->opacity)."\"";
+ if ($this->quantity != "") $temp.= " quantity=\"".htmlspecialchars($this->quantity)."\"";
+ if ($this->label != "") $temp.= " label=\"".htmlspecialchars($this->label)."\"";
+ $temp .= " />\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." ColormapEntry<br>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletecolormapentry&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"colormapentry\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+
+ $temp .= $offset." <table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td style=\"width: 100px\">\n";
+ $temp .= $offset." Color:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td";
+ $temp .= " id=\"".$id."_color_preview\" style=\"border: 1px solid black; width: 100px; cursor: hand; background-color:".htmlspecialchars($this->color).";\" ";
+ $temp .= "onClick=\"window.open('sld_pick_color.php?id=".$id."_color','Farbauswahl','width=299, height=194, resizable=no');\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_color\" value=\"".htmlspecialchars($this->color)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Opacity:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_opacity\" value=\"".htmlspecialchars($this->opacity)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Quantity:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_quantity\" value=\"".htmlspecialchars($this->quantity)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Label:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_label\" value=\"".htmlspecialchars($this->label)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_color"]))
+ {
+ $this->color = $_REQUEST[$id."_color"];
+ }
+ if (isset($_REQUEST[$id."_opacity"]))
+ {
+ $this->opacity = $_REQUEST[$id."_opacity"];
+ }
+ if (isset($_REQUEST[$id."_quantity"]))
+ {
+ $this->quantity = $_REQUEST[$id."_quantity"];
+ }
+ if (isset($_REQUEST[$id."_label"]))
+ {
+ $this->label = $_REQUEST[$id."_label"];
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/CssParameter.php
===================================================================
--- branches/2.5/http/sld/classes/CssParameter.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/CssParameter.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,173 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the CssParameter-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class CssParameter
-{
- /**
- * The name attribute from the xml-scheme.
- * @var string
- */
- var $name = "";
-
- /**
- * The value attribute from the xml-scheme.
- * @var string
- */
- var $value = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<CssParameter ";
- $temp .= "name=\"".htmlspecialchars($this->name)."\">";
- $temp .= htmlspecialchars($this->value);
- $temp .= "</CssParameter>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table>\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." CssParameter<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"cssparameter\">\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
-
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletecssparameter&id=".$this->parent."&number=".$number."\">löschen</a>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- $temp .= $offset." <table>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." ".htmlspecialchars($this->name)."\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".htmlspecialchars($this->name)."\">\n";
- $temp .= $offset." </td>\n";
-
- //Farbauswahl
- if ($this->name == "fill" || $this->name == "stroke")
- {
- $temp .= $offset." <td";
- $temp .= " id=\"".$id."_value_preview\" style=\"border: 1px solid black; width: 100px; cursor: hand; background-color:".htmlspecialchars($this->value).";\" ";
- $temp .= "onClick=\"window.open('sld_pick_color.php?id=".$id."_value','Farbauswahl','width=299, height=194, resizable=no');\">\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."_value\" id=\"".$id."_value\" value=\"".htmlspecialchars($this->value)."\">\n";
- $temp .= $offset." </td>\n";
- }
- else if ($this->name == "stroke-width" || $this->name == "font-size")
- {
- $temp .= $offset." <td>\n";
- $temp .= $offset." <select name=\"".$id."_value\" onchange=\"document.getElementById('sld_editor_form').submit();\">\n";
- for ($i=0; $i < 17; $i++)
- {
- $temp .= $offset." <option value=\"".$i."\"";
- if ( $this->value == $i ) $temp .= " selected";
- $temp .= ">".$i." px</option>\n";
- }
- $temp .= $offset." </select>\n";
- $temp .= $offset." </td>\n";
- }
- else if ($this->name == "font-family")
- {
- $temp .= $offset." <td>\n";
- $temp .= $offset." <select name=\"".$id."_value\" onchange=\"document.getElementById('sld_editor_form').submit();\">\n";
- $temp .= $offset." <option value=\"verdana\"";
- if ($this->value == "verdana") $temp .= " selected";
- $temp .= ">Verdana</option>\n";
- $temp .= $offset." <option value=\"arial\"";
- if ($this->value == "arial") $temp .= " selected";
- $temp .= ">Arial</option>\n";
- $temp .= $offset." </select>\n";
- $temp .= $offset." </td>\n";
- }
- else
- {
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_value\" value=\"".htmlspecialchars($this->value)."\">\n";
- $temp .= $offset." </td>\n";
- }
- $temp .= $offset." </tr>\n";
- $temp .= $offset." </table>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_name"]))
- {
- $this->name = $_REQUEST[$id."_name"];
- }
- if (isset($_REQUEST[$id."_value"]))
- {
- $this->value = $_REQUEST[$id."_value"];
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/CssParameter.php (from rev 2404, branches/2.5/http/sld/classes/CssParameter.php)
===================================================================
--- trunk/mapbender/http/sld/classes/CssParameter.php (rev 0)
+++ trunk/mapbender/http/sld/classes/CssParameter.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,173 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the CssParameter-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class CssParameter
+{
+ /**
+ * The name attribute from the xml-scheme.
+ * @var string
+ */
+ var $name = "";
+
+ /**
+ * The value attribute from the xml-scheme.
+ * @var string
+ */
+ var $value = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<CssParameter ";
+ $temp .= "name=\"".htmlspecialchars($this->name)."\">";
+ $temp .= htmlspecialchars($this->value);
+ $temp .= "</CssParameter>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." CssParameter<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"cssparameter\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletecssparameter&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." ".htmlspecialchars($this->name)."\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".htmlspecialchars($this->name)."\">\n";
+ $temp .= $offset." </td>\n";
+
+ //Farbauswahl
+ if ($this->name == "fill" || $this->name == "stroke")
+ {
+ $temp .= $offset." <td";
+ $temp .= " id=\"".$id."_value_preview\" style=\"border: 1px solid black; width: 100px; cursor: hand; background-color:".htmlspecialchars($this->value).";\" ";
+ $temp .= "onClick=\"window.open('sld_pick_color.php?id=".$id."_value','Farbauswahl','width=299, height=194, resizable=no');\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_value\" id=\"".$id."_value\" value=\"".htmlspecialchars($this->value)."\">\n";
+ $temp .= $offset." </td>\n";
+ }
+ else if ($this->name == "stroke-width" || $this->name == "font-size")
+ {
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <select name=\"".$id."_value\" onchange=\"document.getElementById('sld_editor_form').submit();\">\n";
+ for ($i=0; $i < 17; $i++)
+ {
+ $temp .= $offset." <option value=\"".$i."\"";
+ if ( $this->value == $i ) $temp .= " selected";
+ $temp .= ">".$i." px</option>\n";
+ }
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." </td>\n";
+ }
+ else if ($this->name == "font-family")
+ {
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <select name=\"".$id."_value\" onchange=\"document.getElementById('sld_editor_form').submit();\">\n";
+ $temp .= $offset." <option value=\"verdana\"";
+ if ($this->value == "verdana") $temp .= " selected";
+ $temp .= ">Verdana</option>\n";
+ $temp .= $offset." <option value=\"arial\"";
+ if ($this->value == "arial") $temp .= " selected";
+ $temp .= ">Arial</option>\n";
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." </td>\n";
+ }
+ else
+ {
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_value\" value=\"".htmlspecialchars($this->value)."\">\n";
+ $temp .= $offset." </td>\n";
+ }
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_name"]))
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ }
+ if (isset($_REQUEST[$id."_value"]))
+ {
+ $this->value = $_REQUEST[$id."_value"];
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/DbUtils.php
===================================================================
--- branches/2.5/http/sld/classes/DbUtils.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/DbUtils.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,134 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../../../conf/mapbender.conf");
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-
-/**
- * This class wraps db functions of the sld implementation.
- *
- * @package sld_classes
- * @author Michael Schulz
- */
-class DbUtils
-{
- /**
- * Read the layer_id from the DB.
- *
- * @param <int> the wms_id
- * @param <string> the layer_name
- * @return <int> the layer_id
- */
- function getLayerIdFromLayerName($wms_id, $layer_name) {
- $sql = "SELECT * FROM layer WHERE fkey_wms_id = $1 AND layer_name = $2";
- $v = array($wms_id, $layer_name);
- $t = array('i', 's');
- $res = db_prep_query($sql,$v,$t);
- if ( db_fetch_row($res, 0) ) {
- return db_result($res, 0, "layer_id");
- } else {
- return false;
- }
- }
-
- /**
- * Check for a layer wfs-Conf.
- *
- * @param <int> the layer_id
- * @param <string> the gui_id
- * @return <int> wfs_conf_id
- */
- function getLayerWfsConfId($gui_id, $layer_id) {
- $sql = "SELECT gui_layer_wfs_featuretype FROM gui_layer WHERE fkey_gui_id = $1 AND fkey_layer_id = $2";
- $v = array($gui_id, $layer_id);
- $t = array('s', 'i');
- $res = db_prep_query($sql,$v,$t);
- if ( db_fetch_row($res, 0) ) {
- return db_result($res, 0, "gui_layer_wfs_featuretype");
- } else {
- return false;
- }
- }
-
- /**
- * return layer wfs-FeatureType-id.
- *
- * @param <int> the wfs_conf_id
- * @return <int> fkey_featuretype_id
- */
- function getWfsConfFeatureTypeId($wfs_conf_id) {
- $sql = "SELECT fkey_featuretype_id FROM wfs_conf WHERE wfs_conf_id = $1";
- $v = array($wfs_conf_id);
- $t = array('i');
- $res = db_prep_query($sql,$v,$t);
- if ( db_fetch_row($res, 0) ) {
- return db_result($res, 0, "fkey_featuretype_id");
- } else {
- return false;
- }
- }
-
- /**
- * create a getmap request for the map images
- *
- * @param <string> gui_id
- * @param <int> layer_id
- * @param <int> wms_id
- *
- * @return <string> getmap URL
- */
- function getPreviewMapUrl($gui_id, $layer_id, $wms_id) {
- $previewMapSrs = "";
- $sql = "select w.gui_wms_epsg as srs, e.minx, e.miny, e.maxx, e.maxy ";
- $sql .= "from gui_wms w, layer l, layer_epsg e ";
- $sql .= "where l.fkey_wms_id=w.fkey_wms_id and e.fkey_layer_id=l.layer_id and e.epsg=w.gui_wms_epsg and ";
- $sql .= "l.layer_parent = '' and w.fkey_gui_id = $1 and w.gui_wms_position=0";
- $v = array($gui_id);
- $t = array('s');
- $res = db_prep_query($sql,$v,$t);
- if ( $res ) {
- $row = db_fetch_array($res, 0);
- $previewMapSrs .= "&SRS=".$row["srs"]."&BBOX=".$row["minx"].",".$row["miny"].",".$row["maxx"].",".$row["maxy"];
- } else {
- return false;
- }
-
- $sql = "select wms.wms_getmap as mapurl, layer.layer_name, wms.wms_version as version, w.gui_wms_mapformat as format ";
- $sql .= "from gui_wms w, gui_layer l, wms, layer ";
- $sql .= "where w.fkey_gui_id=l.fkey_gui_id and wms.wms_id = w.fkey_wms_id and l.fkey_layer_id = layer.layer_id and ";
- $sql .= "w.fkey_gui_id=$1 and l.fkey_layer_id=$2 and wms.wms_id = $3";
- $v = array($gui_id, $layer_id, $wms_id);
- $t = array('s', 'i', 'i');
- $res = db_prep_query($sql,$v,$t);
- $previewMapUrl = "";
- if ( $res ) {
- $row = db_fetch_array($res, 0);
- $previewMapUrl .= $row["mapurl"]."SERVICE=WMS&REQUEST=GetMap&VERSION=".$row["version"];
- $previewMapUrl .= "&LAYERS=".$row["layer_name"]."&STYLES=";
- $previewMapUrl .= $previewMapSrs;
- $previewMapUrl .= "&FORMAT=".$row["format"];
- return $previewMapUrl;
- } else {
- return false;
- }
- }
-}
-
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/DbUtils.php (from rev 2404, branches/2.5/http/sld/classes/DbUtils.php)
===================================================================
--- trunk/mapbender/http/sld/classes/DbUtils.php (rev 0)
+++ trunk/mapbender/http/sld/classes/DbUtils.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,134 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+require_once(dirname(__FILE__)."/../../../conf/mapbender.conf");
+$con = db_connect(DBSERVER,OWNER,PW);
+db_select_db(DB,$con);
+
+/**
+ * This class wraps db functions of the sld implementation.
+ *
+ * @package sld_classes
+ * @author Michael Schulz
+ */
+class DbUtils
+{
+ /**
+ * Read the layer_id from the DB.
+ *
+ * @param <int> the wms_id
+ * @param <string> the layer_name
+ * @return <int> the layer_id
+ */
+ function getLayerIdFromLayerName($wms_id, $layer_name) {
+ $sql = "SELECT * FROM layer WHERE fkey_wms_id = $1 AND layer_name = $2";
+ $v = array($wms_id, $layer_name);
+ $t = array('i', 's');
+ $res = db_prep_query($sql,$v,$t);
+ if ( db_fetch_row($res, 0) ) {
+ return db_result($res, 0, "layer_id");
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Check for a layer wfs-Conf.
+ *
+ * @param <int> the layer_id
+ * @param <string> the gui_id
+ * @return <int> wfs_conf_id
+ */
+ function getLayerWfsConfId($gui_id, $layer_id) {
+ $sql = "SELECT gui_layer_wfs_featuretype FROM gui_layer WHERE fkey_gui_id = $1 AND fkey_layer_id = $2";
+ $v = array($gui_id, $layer_id);
+ $t = array('s', 'i');
+ $res = db_prep_query($sql,$v,$t);
+ if ( db_fetch_row($res, 0) ) {
+ return db_result($res, 0, "gui_layer_wfs_featuretype");
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * return layer wfs-FeatureType-id.
+ *
+ * @param <int> the wfs_conf_id
+ * @return <int> fkey_featuretype_id
+ */
+ function getWfsConfFeatureTypeId($wfs_conf_id) {
+ $sql = "SELECT fkey_featuretype_id FROM wfs_conf WHERE wfs_conf_id = $1";
+ $v = array($wfs_conf_id);
+ $t = array('i');
+ $res = db_prep_query($sql,$v,$t);
+ if ( db_fetch_row($res, 0) ) {
+ return db_result($res, 0, "fkey_featuretype_id");
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * create a getmap request for the map images
+ *
+ * @param <string> gui_id
+ * @param <int> layer_id
+ * @param <int> wms_id
+ *
+ * @return <string> getmap URL
+ */
+ function getPreviewMapUrl($gui_id, $layer_id, $wms_id) {
+ $previewMapSrs = "";
+ $sql = "select w.gui_wms_epsg as srs, e.minx, e.miny, e.maxx, e.maxy ";
+ $sql .= "from gui_wms w, layer l, layer_epsg e ";
+ $sql .= "where l.fkey_wms_id=w.fkey_wms_id and e.fkey_layer_id=l.layer_id and e.epsg=w.gui_wms_epsg and ";
+ $sql .= "l.layer_parent = '' and w.fkey_gui_id = $1 and w.gui_wms_position=0";
+ $v = array($gui_id);
+ $t = array('s');
+ $res = db_prep_query($sql,$v,$t);
+ if ( $res ) {
+ $row = db_fetch_array($res, 0);
+ $previewMapSrs .= "&SRS=".$row["srs"]."&BBOX=".$row["minx"].",".$row["miny"].",".$row["maxx"].",".$row["maxy"];
+ } else {
+ return false;
+ }
+
+ $sql = "select wms.wms_getmap as mapurl, layer.layer_name, wms.wms_version as version, w.gui_wms_mapformat as format ";
+ $sql .= "from gui_wms w, gui_layer l, wms, layer ";
+ $sql .= "where w.fkey_gui_id=l.fkey_gui_id and wms.wms_id = w.fkey_wms_id and l.fkey_layer_id = layer.layer_id and ";
+ $sql .= "w.fkey_gui_id=$1 and l.fkey_layer_id=$2 and wms.wms_id = $3";
+ $v = array($gui_id, $layer_id, $wms_id);
+ $t = array('s', 'i', 'i');
+ $res = db_prep_query($sql,$v,$t);
+ $previewMapUrl = "";
+ if ( $res ) {
+ $row = db_fetch_array($res, 0);
+ $previewMapUrl .= $row["mapurl"]."SERVICE=WMS&REQUEST=GetMap&VERSION=".$row["version"];
+ $previewMapUrl .= "&LAYERS=".$row["layer_name"]."&STYLES=";
+ $previewMapUrl .= $previewMapSrs;
+ $previewMapUrl .= "&FORMAT=".$row["format"];
+ return $previewMapUrl;
+ } else {
+ return false;
+ }
+ }
+}
+
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/Displacement.php
===================================================================
--- branches/2.5/http/sld/classes/Displacement.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/Displacement.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,122 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the Displacement-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class Displacement
-{
- /**
- * The displacementx attribute from the xml-scheme.
- * @var int
- */
- var $displacementx = "";
-
- /**
- * The displacementy attribute from the xml-scheme.
- * @var int
- */
- var $displacementy = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<Displacement>\n";
- $temp .= $offset." <DisplacementX>".htmlspecialchars($this->displacementx)."</DisplacementX>\n";
- $temp .= $offset." <DisplacementY>".htmlspecialchars($this->displacementy)."</DisplacementY>\n";
- $temp .= $offset."</Displacement>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"displacement\">\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." DisplacementX:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_displacementx\" value=\"".htmlspecialchars($this->displacementx)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." DisplacementY:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_displacementy\" value=\"".htmlspecialchars($this->displacementy)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_displacementx"]))
- {
- $this->displacementx = $_REQUEST[$id."_displacementx"];
- }
- if (isset($_REQUEST[$id."_displacementy"]))
- {
- $this->displacementy = $_REQUEST[$id."_displacementy"];
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/Displacement.php (from rev 2404, branches/2.5/http/sld/classes/Displacement.php)
===================================================================
--- trunk/mapbender/http/sld/classes/Displacement.php (rev 0)
+++ trunk/mapbender/http/sld/classes/Displacement.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,122 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the Displacement-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Displacement
+{
+ /**
+ * The displacementx attribute from the xml-scheme.
+ * @var int
+ */
+ var $displacementx = "";
+
+ /**
+ * The displacementy attribute from the xml-scheme.
+ * @var int
+ */
+ var $displacementy = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Displacement>\n";
+ $temp .= $offset." <DisplacementX>".htmlspecialchars($this->displacementx)."</DisplacementX>\n";
+ $temp .= $offset." <DisplacementY>".htmlspecialchars($this->displacementy)."</DisplacementY>\n";
+ $temp .= $offset."</Displacement>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"displacement\">\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." DisplacementX:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_displacementx\" value=\"".htmlspecialchars($this->displacementx)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." DisplacementY:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_displacementy\" value=\"".htmlspecialchars($this->displacementy)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_displacementx"]))
+ {
+ $this->displacementx = $_REQUEST[$id."_displacementx"];
+ }
+ if (isset($_REQUEST[$id."_displacementy"]))
+ {
+ $this->displacementy = $_REQUEST[$id."_displacementy"];
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/DisplayOperationModule.php
===================================================================
--- branches/2.5/http/sld/classes/DisplayOperationModule.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/DisplayOperationModule.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,66 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Template Class that is used to display the operations
- * creates the hmtl source code for the operations
- * similar to the AddOperationModule
- *
- * @package filter_classes
- * @author Markus Krzyzanowski
- */
-class DisplayOperationModule
-{
- /**
- * function that creates the html-form-fragment sourcecode
- *
- * @param $offset string whitespaces that should be added in every row of sourcecode for formatting
- * @param $operations array containing the operations for which the source should be created
- * @return string the created code
- */
- function generateHtmlForm($offset = "", $operations, $id)
- {
- $temp = "";
- $operation_id = 0;
- $max = count($operations);
- foreach ($operations as $operation)
- {
- if ($id == "")
- {
- $temp .= $operation->generateHtmlForm($id."operation_".$operation_id, $offset);
- }
- else
- {
- $temp .= $operation->generateHtmlForm($id."_operation_".$operation_id, $offset);
- }
- //Display emtpy row or line to separate the operations
- if ($operation_id+1 < $max)
- {
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td colspan=\"4\">\n";
- $temp .= $offset." <hr style=\"color: black\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
- }
- $operation_id++;
- }
- return $temp;
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/DisplayOperationModule.php (from rev 2404, branches/2.5/http/sld/classes/DisplayOperationModule.php)
===================================================================
--- trunk/mapbender/http/sld/classes/DisplayOperationModule.php (rev 0)
+++ trunk/mapbender/http/sld/classes/DisplayOperationModule.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,66 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Template Class that is used to display the operations
+ * creates the hmtl source code for the operations
+ * similar to the AddOperationModule
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class DisplayOperationModule
+{
+ /**
+ * function that creates the html-form-fragment sourcecode
+ *
+ * @param $offset string whitespaces that should be added in every row of sourcecode for formatting
+ * @param $operations array containing the operations for which the source should be created
+ * @return string the created code
+ */
+ function generateHtmlForm($offset = "", $operations, $id)
+ {
+ $temp = "";
+ $operation_id = 0;
+ $max = count($operations);
+ foreach ($operations as $operation)
+ {
+ if ($id == "")
+ {
+ $temp .= $operation->generateHtmlForm($id."operation_".$operation_id, $offset);
+ }
+ else
+ {
+ $temp .= $operation->generateHtmlForm($id."_operation_".$operation_id, $offset);
+ }
+ //Display emtpy row or line to separate the operations
+ if ($operation_id+1 < $max)
+ {
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"4\">\n";
+ $temp .= $offset." <hr style=\"color: black\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+ $operation_id++;
+ }
+ return $temp;
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/ElseFilter.php
===================================================================
--- branches/2.5/http/sld/classes/ElseFilter.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/ElseFilter.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,72 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the ElseFilter-element.
- * An ElseFilter can be used instead of a Filter.
- * An ElseFilter is always true an should be used to group those
- * entities that do not have a specific rule for themselves.
- *
- * @package filter_classes
- * @author Markus Krzyzanowski
- */
-class ElseFilter extends Rule
-{
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = "";
- $temp .= $offset."<ElseFilter />\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<input type=\"hidden\" name=\"elsefilter\">\n";
- $temp .= $offset."<table>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." ElseFilter:<br>\n";
- $temp .= $offset." <a class=\"edit\" href=\"sld_edit_filter.php?function=deletefilter\">";
- $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
-
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/ElseFilter.php (from rev 2404, branches/2.5/http/sld/classes/ElseFilter.php)
===================================================================
--- trunk/mapbender/http/sld/classes/ElseFilter.php (rev 0)
+++ trunk/mapbender/http/sld/classes/ElseFilter.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,72 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the ElseFilter-element.
+ * An ElseFilter can be used instead of a Filter.
+ * An ElseFilter is always true an should be used to group those
+ * entities that do not have a specific rule for themselves.
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class ElseFilter extends Rule
+{
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<ElseFilter />\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"elsefilter\">\n";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." ElseFilter:<br>\n";
+ $temp .= $offset." <a class=\"edit\" href=\"sld_edit_filter.php?function=deletefilter\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/ExternalGraphic.php
===================================================================
--- branches/2.5/http/sld/classes/ExternalGraphic.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/ExternalGraphic.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,143 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the ExternalGraphic-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class ExternalGraphic
-{
- /**
- * The onlineresource element from the xml-scheme.
- * @var string
- */
- var $onlineresource = "";
-
- /**
- * The format element from the xml-scheme.
- * @var string
- */
- var $format = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<ExternalGraphic>\n";
- $temp .= $offset." <OnlineResource xlink:href=\"".htmlspecialchars($this->onlineresource)."\" />\n";
- $temp .= $offset." <Format>".htmlspecialchars($this->format)."</Format>\n";
- $temp .= $offset."</ExternalGraphic>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table style=\"border: 1px solid black;\" >\n";
- $temp .= $offset." <tr valign='top'>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." ExternalGraphic<br>\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deleteexternalgraphicormark&id=".$this->parent."&number=".$number."\">löschen</a>\n";
-
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"externalgraphic\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- $temp .= $offset." <table border=\"0\">\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." OnlineResource:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_onlineresource\" value=\"".htmlspecialchars($this->onlineresource)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." Format:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_format\" value=\"".htmlspecialchars($this->format)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." </table>\n";
-
- //TODO: Selectbox f�r Format
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- $temp .= $offset." <br>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_onlineresource"]))
- {
- $this->onlineresource = $_REQUEST[$id."_onlineresource"];
- }
- if (isset($_REQUEST[$id."_format"]))
- {
- $this->format = $_REQUEST[$id."_format"];
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/ExternalGraphic.php (from rev 2404, branches/2.5/http/sld/classes/ExternalGraphic.php)
===================================================================
--- trunk/mapbender/http/sld/classes/ExternalGraphic.php (rev 0)
+++ trunk/mapbender/http/sld/classes/ExternalGraphic.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,143 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the ExternalGraphic-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class ExternalGraphic
+{
+ /**
+ * The onlineresource element from the xml-scheme.
+ * @var string
+ */
+ var $onlineresource = "";
+
+ /**
+ * The format element from the xml-scheme.
+ * @var string
+ */
+ var $format = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ExternalGraphic>\n";
+ $temp .= $offset." <OnlineResource xlink:href=\"".htmlspecialchars($this->onlineresource)."\" />\n";
+ $temp .= $offset." <Format>".htmlspecialchars($this->format)."</Format>\n";
+ $temp .= $offset."</ExternalGraphic>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table style=\"border: 1px solid black;\" >\n";
+ $temp .= $offset." <tr valign='top'>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." ExternalGraphic<br>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deleteexternalgraphicormark&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"externalgraphic\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <table border=\"0\">\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." OnlineResource:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_onlineresource\" value=\"".htmlspecialchars($this->onlineresource)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Format:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_format\" value=\"".htmlspecialchars($this->format)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+
+ //TODO: Selectbox f�r Format
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset." <br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_onlineresource"]))
+ {
+ $this->onlineresource = $_REQUEST[$id."_onlineresource"];
+ }
+ if (isset($_REQUEST[$id."_format"]))
+ {
+ $this->format = $_REQUEST[$id."_format"];
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/FeatureTypeStyle.php
===================================================================
--- branches/2.5/http/sld/classes/FeatureTypeStyle.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/FeatureTypeStyle.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,197 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the FeatureTypeStyle-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class FeatureTypeStyle extends UserStyle
-{
- /**
- * Array containing the Rule-objects
- *
- * @see Rule
- * @var array
- */
- var $rules = array();
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * Array containing the FeatureTypes attribute names (aka elements), acquired either by a
- * - Mapbender WFS-configuration
- * - or via a DescribeFeatureType request (niy)
- * @see PropertyIsEqualTo, TextSymbolizer
- * @var array
- */
- var $attrs = array();
-
- final function setElementArray($name,$array) {
- $this->attrs[$name] = $array;
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<FeatureTypeStyle>\n";
- foreach($this->rules as $rule)
- {
- $temp .= $rule->generateXml($offset." ");
- }
- $temp .= $offset."</FeatureTypeStyle>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- ###### -----------> Fensterrahmen Rule
- $temp = "";
- $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"featuretypestyle\">\n";
- $temp .= $offset."<table border=\"0\" cellspacing=\"2\" cellspacing=\"1\">\n";
-
- $rule_id = 0;
- foreach ($this->rules as $rule)
- {
- $temp .= $offset." <tr>\n";
- $temp .= $rule->generateHtmlForm($id."_rule_".$rule_id, $offset." ");
- $rule_id++;
- $temp .= $offset." </tr>\n";
-
- $temp .= $offset."<tr>\n";
- $temp .= $offset."<td colspan=\"3\"' height='5'>\n";
- $temp .= $offset."<hr size='1' noshade color='#86A6C5'>\n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- }
- $temp .= $offset."<tr>\n";
- $temp .= $offset."<td colspan=\"3\">\n";
- $temp .= $offset."<table width='100%' border='0' cellspacing=\"2\" cellspacing=\"1\">\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset."<td>\n";
- $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addrule&id=".$this->id."\">\n";
- $temp .= $offset."<img src='./img/plus.gif' border='0' alt='Rule hinzuf�gen'> hinzufügen\n";
- $temp .= $offset."</a>\n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."</table>\n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."</table>\n";
-
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $countRules = 0;
- while (isset($_REQUEST[$id."_rule_".$countRules]))
- {
- $rule = new Rule();
- $rule->generateObjectFromPost($id."_rule_".$countRules);
- $this->rules[] = $rule;
- $countRules++;
- }
- }
- /**
- * adds a new Rule object to the $rules array
- *
- * this function is called from sld_function_handler.php
- */
- function addRule()
- {
- $this->rules[] = new Rule();
- }
- /**
- * deletes the rule with the given index from the $rules array
- *
- * this function is called from sld_function_handler.php
- *
- * @param int $index index of the rule that has to be deleted
- */
- function deleteRule($index)
- {
- array_splice($this->rules, $index, 1);
- }
- /**
- * generates html with the fts elements to choose from, useful for Label, Filter, etc.
- *
- * @param string $field string that holds the id of the form field where to return the selected value
- *
- * @param string $value string that holds the name of an already used element name
- *
- * @return string html-fragment that lists the elements, each can be clicked and the name is
- * returned to the form field
- */
- final function generateElementsHtml($field,$value)
- {
- $html = "";
- if ($this->attrs) {
- $html .= "<select name='elementname' onchange=\"if (this.selectedIndex!=0) document.getElementById('".$field."').value=this.options[this.selectedIndex].value;\">\n";
- $html .= "<option>Choose ...</option>";
- foreach ($this->attrs["element_name"] as $ename) {
- $html .= "<option value='".$ename."' ";
- if ($value == $ename)
- $html .= "selected";
- $html .= ">".$ename."<otion>\n";
- }
- $html .= "</select>\n";
- }
- return $html;
- }
-
-}
-
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/FeatureTypeStyle.php (from rev 2404, branches/2.5/http/sld/classes/FeatureTypeStyle.php)
===================================================================
--- trunk/mapbender/http/sld/classes/FeatureTypeStyle.php (rev 0)
+++ trunk/mapbender/http/sld/classes/FeatureTypeStyle.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,197 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the FeatureTypeStyle-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class FeatureTypeStyle extends UserStyle
+{
+ /**
+ * Array containing the Rule-objects
+ *
+ * @see Rule
+ * @var array
+ */
+ var $rules = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Array containing the FeatureTypes attribute names (aka elements), acquired either by a
+ * - Mapbender WFS-configuration
+ * - or via a DescribeFeatureType request (niy)
+ * @see PropertyIsEqualTo, TextSymbolizer
+ * @var array
+ */
+ var $attrs = array();
+
+ final function setElementArray($name,$array) {
+ $this->attrs[$name] = $array;
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<FeatureTypeStyle>\n";
+ foreach($this->rules as $rule)
+ {
+ $temp .= $rule->generateXml($offset." ");
+ }
+ $temp .= $offset."</FeatureTypeStyle>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ ###### -----------> Fensterrahmen Rule
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"featuretypestyle\">\n";
+ $temp .= $offset."<table border=\"0\" cellspacing=\"2\" cellspacing=\"1\">\n";
+
+ $rule_id = 0;
+ foreach ($this->rules as $rule)
+ {
+ $temp .= $offset." <tr>\n";
+ $temp .= $rule->generateHtmlForm($id."_rule_".$rule_id, $offset." ");
+ $rule_id++;
+ $temp .= $offset." </tr>\n";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td colspan=\"3\"' height='5'>\n";
+ $temp .= $offset."<hr size='1' noshade color='#86A6C5'>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td colspan=\"3\">\n";
+ $temp .= $offset."<table width='100%' border='0' cellspacing=\"2\" cellspacing=\"1\">\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addrule&id=".$this->id."\">\n";
+ $temp .= $offset."<img src='./img/plus.gif' border='0' alt='Rule hinzuf�gen'> hinzufügen\n";
+ $temp .= $offset."</a>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."</table>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countRules = 0;
+ while (isset($_REQUEST[$id."_rule_".$countRules]))
+ {
+ $rule = new Rule();
+ $rule->generateObjectFromPost($id."_rule_".$countRules);
+ $this->rules[] = $rule;
+ $countRules++;
+ }
+ }
+ /**
+ * adds a new Rule object to the $rules array
+ *
+ * this function is called from sld_function_handler.php
+ */
+ function addRule()
+ {
+ $this->rules[] = new Rule();
+ }
+ /**
+ * deletes the rule with the given index from the $rules array
+ *
+ * this function is called from sld_function_handler.php
+ *
+ * @param int $index index of the rule that has to be deleted
+ */
+ function deleteRule($index)
+ {
+ array_splice($this->rules, $index, 1);
+ }
+ /**
+ * generates html with the fts elements to choose from, useful for Label, Filter, etc.
+ *
+ * @param string $field string that holds the id of the form field where to return the selected value
+ *
+ * @param string $value string that holds the name of an already used element name
+ *
+ * @return string html-fragment that lists the elements, each can be clicked and the name is
+ * returned to the form field
+ */
+ final function generateElementsHtml($field,$value)
+ {
+ $html = "";
+ if ($this->attrs) {
+ $html .= "<select name='elementname' onchange=\"if (this.selectedIndex!=0) document.getElementById('".$field."').value=this.options[this.selectedIndex].value;\">\n";
+ $html .= "<option>Choose ...</option>";
+ foreach ($this->attrs["element_name"] as $ename) {
+ $html .= "<option value='".$ename."' ";
+ if ($value == $ename)
+ $html .= "selected";
+ $html .= ">".$ename."<otion>\n";
+ }
+ $html .= "</select>\n";
+ }
+ return $html;
+ }
+
+}
+
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/Fill.php
===================================================================
--- branches/2.5/http/sld/classes/Fill.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/Fill.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,172 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the Fill-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class Fill
-{
- /**
- * The GraphicFill object from the xml-scheme.
- *
- * @see GraphicFill
- * @var string
- */
- var $graphicfill = "";
-
- /**
- * Array containing the CssParameter objects from the xml-scheme.
- *
- * @see CssParameter
- * @var array
- */
- var $cssparameters = array();
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<Fill>\n";
- if ($this->graphicfill != "") $temp .= $this->graphicfill->generateXml($offset." ");
- foreach ($this->cssparameters as $cssparameter)
- {
- $temp .= $cssparameter->generateXml($offset." ");
- }
- $temp .= $offset."</Fill>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "<hr class=\"sep\">\n";
- $temp .= $offset."<table>\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." Fill<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"fill\">\n";
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletefill&id=".$this->parent."\">löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td valign=\"top\">\n";
- if ($this->graphicfill != "")
- {
- $temp .= $this->graphicfill->generateHtmlForm($id."_graphicfill", $offset." ");
- }
- else
- {
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addgraphicfill&id=".$this->id."\">GraphicFill hinzufügen</a><br>\n";
- }
- $cssparameter_id = 0;
- foreach ($this->cssparameters as $cssparameter)
- {
- $temp .= $cssparameter->generateHtmlForm($id."_cssparameter_".$cssparameter_id, $offset." ");
- $cssparameter_id++;
- }
- $temp .= $offset." <select name=\"".$id."_newcssparameter\">\n";
- $temp .= $offset." <option value=\"fill\">fill</option>\n";
- $temp .= $offset." <option value=\"fill-opacity\">fill-opacity</option>\n";
- $temp .= $offset." </select>\n";
- $temp .= $offset." <input type=\"button\" value=\"hinzufügen\"";
- //Javascript to make a http request
- $temp .= " onClick=\"url='sld_function_handler.php?function=addcssparameter&id=".$this->id."&cssparameter=';";
- $temp .= " url += ".$id."_newcssparameter.value;";
- $temp .= " location.href = url;\"";
- $temp .= ">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_graphicfill"]))
- {
- $this->graphicfill = new GraphicFill();
- $this->graphicfill->generateObjectFromPost($id."_graphicfill");
- }
- $countCssParameters = 0;
- while (isset($_REQUEST[$id."_cssparameter_".$countCssParameters]))
- {
- $cssParameter = new CssParameter();
- $cssParameter->generateObjectFromPost($id."_cssparameter_".$countCssParameters);
- $this->cssparameters[] = $cssParameter;
- $countCssParameters++;
- }
- }
-
- /**
- * Function that adds a new CssParameter to the array.
- * @param string $cssparameter the name of the new CssParameter object
- */
- function addCssParameter($cssParameter)
- {
- $newCssParameter = new CssParameter();
- $newCssParameter->name = $cssParameter;
- $this->cssparameters[] = $newCssParameter;
- }
-
- /**
- * Deletes the CssParameter at the given index.
- * @param int $index index of the CssParamater in the array that has to be deleted
- */
- function deleteCssParameter($index)
- {
- array_splice($this->cssparameters, $index, 1);
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/Fill.php (from rev 2404, branches/2.5/http/sld/classes/Fill.php)
===================================================================
--- trunk/mapbender/http/sld/classes/Fill.php (rev 0)
+++ trunk/mapbender/http/sld/classes/Fill.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,172 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the Fill-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Fill
+{
+ /**
+ * The GraphicFill object from the xml-scheme.
+ *
+ * @see GraphicFill
+ * @var string
+ */
+ var $graphicfill = "";
+
+ /**
+ * Array containing the CssParameter objects from the xml-scheme.
+ *
+ * @see CssParameter
+ * @var array
+ */
+ var $cssparameters = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Fill>\n";
+ if ($this->graphicfill != "") $temp .= $this->graphicfill->generateXml($offset." ");
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateXml($offset." ");
+ }
+ $temp .= $offset."</Fill>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "<hr class=\"sep\">\n";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Fill<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"fill\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletefill&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td valign=\"top\">\n";
+ if ($this->graphicfill != "")
+ {
+ $temp .= $this->graphicfill->generateHtmlForm($id."_graphicfill", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addgraphicfill&id=".$this->id."\">GraphicFill hinzufügen</a><br>\n";
+ }
+ $cssparameter_id = 0;
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateHtmlForm($id."_cssparameter_".$cssparameter_id, $offset." ");
+ $cssparameter_id++;
+ }
+ $temp .= $offset." <select name=\"".$id."_newcssparameter\">\n";
+ $temp .= $offset." <option value=\"fill\">fill</option>\n";
+ $temp .= $offset." <option value=\"fill-opacity\">fill-opacity</option>\n";
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." <input type=\"button\" value=\"hinzufügen\"";
+ //Javascript to make a http request
+ $temp .= " onClick=\"url='sld_function_handler.php?function=addcssparameter&id=".$this->id."&cssparameter=';";
+ $temp .= " url += ".$id."_newcssparameter.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_graphicfill"]))
+ {
+ $this->graphicfill = new GraphicFill();
+ $this->graphicfill->generateObjectFromPost($id."_graphicfill");
+ }
+ $countCssParameters = 0;
+ while (isset($_REQUEST[$id."_cssparameter_".$countCssParameters]))
+ {
+ $cssParameter = new CssParameter();
+ $cssParameter->generateObjectFromPost($id."_cssparameter_".$countCssParameters);
+ $this->cssparameters[] = $cssParameter;
+ $countCssParameters++;
+ }
+ }
+
+ /**
+ * Function that adds a new CssParameter to the array.
+ * @param string $cssparameter the name of the new CssParameter object
+ */
+ function addCssParameter($cssParameter)
+ {
+ $newCssParameter = new CssParameter();
+ $newCssParameter->name = $cssParameter;
+ $this->cssparameters[] = $newCssParameter;
+ }
+
+ /**
+ * Deletes the CssParameter at the given index.
+ * @param int $index index of the CssParamater in the array that has to be deleted
+ */
+ function deleteCssParameter($index)
+ {
+ array_splice($this->cssparameters, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/Filter.php
===================================================================
--- branches/2.5/http/sld/classes/Filter.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/Filter.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,180 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * This file contains the classes used for editing filter expressions.
- * Filter expressions are currently limited to logical and comparison operations.
- *
- * @package filter_classes
- * @author Markus Krzyzanowski
- */
-
-
-
-/**
- * This class is the implementation of the filter-element from ogc:filter.
- *
- * This element builds up the root of filter-expressions.
- * This class is directly referred to in the sld_edit_filter.php.
- *
- * @package filter_classes
- */
-class Filter extends Rule
-{
- /**
- * Array containing the operations of this filter
- * @see UnaryLogicOp
- * @see BinaryLogicOp
- * @see BinaryComparisonOp
- * @see PropertyIsLike
- * @see PropertyIsNull
- * @see PropertyIsBetween
- * @var array
- */
- var $operations = array();
-
- /**
- * Index of this object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<ogc:Filter>\n";
- foreach($this->operations as $operation)
- {
- $temp .= $operation->generateXml($offset." ");
- }
- $temp .= $offset."</ogc:Filter>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id = "", $offset = "")
- {
- $temp = "";
- $temp .= $offset."<input type=\"hidden\" name=\"filter\">\n";
- $temp .= $offset."<table>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." Filter:<br>\n";
- $temp .= $offset." <a class=\"edit\" href=\"sld_edit_filter.php?function=deletefilter\">";
- $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td colspan=\"3\">\n";
- $temp .= $offset." \n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
-
- $displayOperationModule = new DisplayOperationModule();
- $temp .= $displayOperationModule->generateHtmlForm($offset." ", $this->operations, $id);
-
- if (count($this->operations) == 0)
- {
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td colspan=\"4\">\n";
-
- $addOperationModule = new AddOperationModule($this->id, $id);
- $temp .= $addOperationModule->generateHtmlForm($offset." ");
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- }
- $temp .= $offset."</table>\n";
-
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $countOperations = 0;
- while (isset($_REQUEST[$id."operation_".$countOperations]))
- {
- if ($_REQUEST[$id."operation_".$countOperations] == "binaryComparisonOp")
- {
- $operation = new BinaryComparisonOp();
- }
- if ($_REQUEST[$id."operation_".$countOperations] == "binaryLogicOp")
- {
- $operation = new BinaryLogicOp();
- }
- if ($_REQUEST[$id."operation_".$countOperations] == "unaryLogicOp")
- {
- $operation = new UnaryLogicOp();
- }
- if ($_REQUEST[$id."operation_".$countOperations] == "propertyIsLike")
- {
- $operation = new PropertyIsLike();
- }
- if ($_REQUEST[$id."operation_".$countOperations] == "propertyIsNull")
- {
- $operation = new PropertyIsNull();
- }
- if ($_REQUEST[$id."operation_".$countOperations] == "propertyIsBetween")
- {
- $operation = new PropertyIsBetween();
- }
- $operation->generateObjectFromPost($id."operation_".$countOperations);
- $this->operations[] = $operation;
- $countOperations++;
- }
- }
-
- /**
- * deletes the rule with the given index from the $operations array
- * @param int $index index of the operation that has to be deleted
- */
- function deleteOperation($index)
- {
- array_splice($this->operations, $index, 1);
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/Filter.php (from rev 2404, branches/2.5/http/sld/classes/Filter.php)
===================================================================
--- trunk/mapbender/http/sld/classes/Filter.php (rev 0)
+++ trunk/mapbender/http/sld/classes/Filter.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,180 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * This file contains the classes used for editing filter expressions.
+ * Filter expressions are currently limited to logical and comparison operations.
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+
+
+
+/**
+ * This class is the implementation of the filter-element from ogc:filter.
+ *
+ * This element builds up the root of filter-expressions.
+ * This class is directly referred to in the sld_edit_filter.php.
+ *
+ * @package filter_classes
+ */
+class Filter extends Rule
+{
+ /**
+ * Array containing the operations of this filter
+ * @see UnaryLogicOp
+ * @see BinaryLogicOp
+ * @see BinaryComparisonOp
+ * @see PropertyIsLike
+ * @see PropertyIsNull
+ * @see PropertyIsBetween
+ * @var array
+ */
+ var $operations = array();
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ogc:Filter>\n";
+ foreach($this->operations as $operation)
+ {
+ $temp .= $operation->generateXml($offset." ");
+ }
+ $temp .= $offset."</ogc:Filter>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"filter\">\n";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Filter:<br>\n";
+ $temp .= $offset." <a class=\"edit\" href=\"sld_edit_filter.php?function=deletefilter\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td colspan=\"3\">\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+
+ $displayOperationModule = new DisplayOperationModule();
+ $temp .= $displayOperationModule->generateHtmlForm($offset." ", $this->operations, $id);
+
+ if (count($this->operations) == 0)
+ {
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td colspan=\"4\">\n";
+
+ $addOperationModule = new AddOperationModule($this->id, $id);
+ $temp .= $addOperationModule->generateHtmlForm($offset." ");
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ }
+ $temp .= $offset."</table>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countOperations = 0;
+ while (isset($_REQUEST[$id."operation_".$countOperations]))
+ {
+ if ($_REQUEST[$id."operation_".$countOperations] == "binaryComparisonOp")
+ {
+ $operation = new BinaryComparisonOp();
+ }
+ if ($_REQUEST[$id."operation_".$countOperations] == "binaryLogicOp")
+ {
+ $operation = new BinaryLogicOp();
+ }
+ if ($_REQUEST[$id."operation_".$countOperations] == "unaryLogicOp")
+ {
+ $operation = new UnaryLogicOp();
+ }
+ if ($_REQUEST[$id."operation_".$countOperations] == "propertyIsLike")
+ {
+ $operation = new PropertyIsLike();
+ }
+ if ($_REQUEST[$id."operation_".$countOperations] == "propertyIsNull")
+ {
+ $operation = new PropertyIsNull();
+ }
+ if ($_REQUEST[$id."operation_".$countOperations] == "propertyIsBetween")
+ {
+ $operation = new PropertyIsBetween();
+ }
+ $operation->generateObjectFromPost($id."operation_".$countOperations);
+ $this->operations[] = $operation;
+ $countOperations++;
+ }
+ }
+
+ /**
+ * deletes the rule with the given index from the $operations array
+ * @param int $index index of the operation that has to be deleted
+ */
+ function deleteOperation($index)
+ {
+ array_splice($this->operations, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/Font.php
===================================================================
--- branches/2.5/http/sld/classes/Font.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/Font.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,156 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the Font-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class Font
-{
- /**
- * Array containing the CssParameter objects from the sld.
- *
- * @see CssParameter
- * @var array
- */
- var $cssparameters = array();
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<Font>\n";
- foreach ($this->cssparameters as $cssparameter)
- {
- $temp .= $cssparameter->generateXml($offset." ");
- }
- $temp .= $offset."</Font>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "<hr class=\"sep\">\n";
- $temp .= $offset."<table>\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." Font<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"font\">\n";
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletefont&id=".$this->parent."\">löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $cssparameter_id = 0;
- foreach ($this->cssparameters as $cssparameter)
- {
- $temp .= $cssparameter->generateHtmlForm($id."_cssparameter_".$cssparameter_id, $offset." ");
- $cssparameter_id++;
- }
- $temp .= $offset." <select name=\"".$id."_newcssparameter\">\n";
- $temp .= $offset." <option value=\"font-family\">font-family</option>\n";
- $temp .= $offset." <option value=\"font-size\">font-size</option>\n";
-
- //Probably not supported by Mapserver
- //$temp .= $offset."<option value=\"font-style\">font-style</option>\n";
- //$temp .= $offset."<option value=\"font-weight\">font-weight</option>\n";
-
- $temp .= $offset." </select>\n";
- $temp .= $offset." <input type=\"button\" value=\"hinzufügen\"";
- //Javascript to make a http request
- $temp .= " onClick=\"url='sld_function_handler.php?function=addcssparameter&id=".$this->id."&cssparameter=';";
- $temp .= " url += ".$id."_newcssparameter.value;";
- $temp .= " location.href = url;\"";
- $temp .= ">\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $countCssParameters = 0;
- while (isset($_REQUEST[$id."_cssparameter_".$countCssParameters]))
- {
- $cssParameter = new CssParameter();
- $cssParameter->generateObjectFromPost($id."_cssparameter_".$countCssParameters);
- $this->cssparameters[] = $cssParameter;
- $countCssParameters++;
- }
- }
-
- /**
- * Adds a new CssParameter object to the array.
- * @param string $cssParameter name of the new CssParameter object
- */
- function addCssParameter($cssParameter)
- {
- $newCssParameter = new CssParameter();
- $newCssParameter->name = $cssParameter;
- $this->cssparameters[] = $newCssParameter;
- }
-
- /**
- * Deletes the CssParameter object at the given index.
- * @param int $index index of the CssParameter object that should be deleted
- */
- function deleteCssParameter($index)
- {
- array_splice($this->cssparameters, $index, 1);
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/Font.php (from rev 2404, branches/2.5/http/sld/classes/Font.php)
===================================================================
--- trunk/mapbender/http/sld/classes/Font.php (rev 0)
+++ trunk/mapbender/http/sld/classes/Font.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,156 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the Font-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Font
+{
+ /**
+ * Array containing the CssParameter objects from the sld.
+ *
+ * @see CssParameter
+ * @var array
+ */
+ var $cssparameters = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Font>\n";
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateXml($offset." ");
+ }
+ $temp .= $offset."</Font>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "<hr class=\"sep\">\n";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Font<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"font\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletefont&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $cssparameter_id = 0;
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateHtmlForm($id."_cssparameter_".$cssparameter_id, $offset." ");
+ $cssparameter_id++;
+ }
+ $temp .= $offset." <select name=\"".$id."_newcssparameter\">\n";
+ $temp .= $offset." <option value=\"font-family\">font-family</option>\n";
+ $temp .= $offset." <option value=\"font-size\">font-size</option>\n";
+
+ //Probably not supported by Mapserver
+ //$temp .= $offset."<option value=\"font-style\">font-style</option>\n";
+ //$temp .= $offset."<option value=\"font-weight\">font-weight</option>\n";
+
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." <input type=\"button\" value=\"hinzufügen\"";
+ //Javascript to make a http request
+ $temp .= " onClick=\"url='sld_function_handler.php?function=addcssparameter&id=".$this->id."&cssparameter=';";
+ $temp .= " url += ".$id."_newcssparameter.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countCssParameters = 0;
+ while (isset($_REQUEST[$id."_cssparameter_".$countCssParameters]))
+ {
+ $cssParameter = new CssParameter();
+ $cssParameter->generateObjectFromPost($id."_cssparameter_".$countCssParameters);
+ $this->cssparameters[] = $cssParameter;
+ $countCssParameters++;
+ }
+ }
+
+ /**
+ * Adds a new CssParameter object to the array.
+ * @param string $cssParameter name of the new CssParameter object
+ */
+ function addCssParameter($cssParameter)
+ {
+ $newCssParameter = new CssParameter();
+ $newCssParameter->name = $cssParameter;
+ $this->cssparameters[] = $newCssParameter;
+ }
+
+ /**
+ * Deletes the CssParameter object at the given index.
+ * @param int $index index of the CssParameter object that should be deleted
+ */
+ function deleteCssParameter($index)
+ {
+ array_splice($this->cssparameters, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/Graphic.php
===================================================================
--- branches/2.5/http/sld/classes/Graphic.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/Graphic.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,243 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the Graphic-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class Graphic
-{
- /**
- * Array containing ExternalGraphic or Mark objects.
- *
- * @see ExternalGraphic
- * @see Mark
- * @var array
- */
- var $externalgraphicsormarks = array();
-
- /**
- * The opacity element from the xml-scheme.
- *
- * Not sure if this feature is supported by UMN-MapServer!
- *
- * @var string
- */
- var $opacity = "";
-
- /**
- * The size element from the xml-scheme.
- * @var string
- */
- var $size = "";
-
- /**
- * The rotation element from the xml-scheme.
- *
- * Not sure if this feature is supported by UMN-MapServer!
- *
- * @var int
- */
- var $rotation = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<Graphic>\n";
- foreach ($this->externalgraphicsormarks as $externalgraphicormark)
- {
- $temp .= $externalgraphicormark->generateXml($offset." ");
- }
- if ($this->opacity != "") $temp .= $offset." <Opacity>".htmlspecialchars($this->opacity)."</Opacity>\n";
- if ($this->size != "") $temp .= $offset." <Size>".htmlspecialchars($this->size)."</Size>\n";
- if ($this->rotation != "") $temp .= $offset." <Rotation>".htmlspecialchars($this->rotation)."</Rotation>\n";
- $temp .= $offset."</Graphic>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table border='0' cellpadding='2' cellspacing='0'>\n";
- $temp .= $offset."<tr valign='top'>\n";
- $temp .= $offset."<td>\n";
- $temp .= $offset."<span>\n";
- $temp .= $offset."Graphic:\n";
- $temp .= $offset."</span>\n";
- $temp .= $offset."<br>\n";
- $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"graphic\">\n";
- $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=deletegraphic&id=".$this->parent."\">";
- $temp .= $offset."<img src='./img/minus.gif' border='0' alt='Rule löschen'> löschen";
- $temp .= $offset."</a>\n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."<td valign='top'>\n";
-
- $temp .= $offset." <table border='1' cellpadding='2' cellspacing='1'>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text' style=\"width: 100px;\">\n";
- $temp .= $offset." Opacity:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input class='inputfield edit_label_text' name=\"".$id."_opacity\" value=\"".htmlspecialchars($this->opacity)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text'>\n";
- $temp .= $offset." Size:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input class='inputfield edit_label_text' name=\"".$id."_size\" value=\"".htmlspecialchars($this->size)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text'>\n";
- $temp .= $offset." Rotation:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input class='inputfield edit_label_text' name=\"".$id."_rotation\" value=\"".htmlspecialchars($this->rotation)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td valign='top'>\n";
- $temp .= $offset." <select class=\"edit_label_text\" name=\"".$id."_newexternalgraphicormark\">\n";
- $temp .= $offset." <option value=\"mark\">Mark</option>\n";
- $temp .= $offset." <option value=\"externalgraphic\">ExternalGraphic</option>\n";
- $temp .= $offset." </select>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." \n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td colspan='2'>\n";
- $externalgraphicormark_id = 0;
- foreach ($this->externalgraphicsormarks as $externalgraphicormark)
- {
- $temp .= $externalgraphicormark->generateHtmlForm($id."_externalgraphicormark_".$externalgraphicormark_id, $offset."");
- $externalgraphicormark_id++;
- }
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset."<input class='edit' type=\"button\" value=\"hinzufügen\"";
- $temp .= " onClick=\"url='sld_function_handler.php?function=addexternalgraphicormark&id=".$this->id."&externalgraphicormark=';";
- $temp .= " url += ".$id."_newexternalgraphicormark.value;";
- $temp .= " location.href = url;\"";
- $temp .= ">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." \n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." </table>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $countExternalGraphicsOrMarks = 0;
- while (isset($_REQUEST[$id."_externalgraphicormark_".$countExternalGraphicsOrMarks]))
- {
- $externalgraphicormark = "";
- if ($_REQUEST[$id."_externalgraphicormark_".$countExternalGraphicsOrMarks] == "mark")
- {
- $externalgraphicormark = new Mark();
- }
- else if ($_REQUEST[$id."_externalgraphicormark_".$countExternalGraphicsOrMarks] == "externalgraphic")
- {
- $externalgraphicormark = new ExternalGraphic();
- }
- $externalgraphicormark->generateObjectFromPost($id."_externalgraphicormark_".$countExternalGraphicsOrMarks);
- $this->externalgraphicsormarks[] = $externalgraphicormark;
- $countExternalGraphicsOrMarks++;
- }
- if (isset($_REQUEST[$id."_opacity"]))
- {
- $this->opacity = $_REQUEST[$id."_opacity"];
- }
- if (isset($_REQUEST[$id."_size"]))
- {
- $this->size = $_REQUEST[$id."_size"];
- }
- if (isset($_REQUEST[$id."_rotation"]))
- {
- $this->rotation = $_REQUEST[$id."_rotation"];
- }
- }
- function addExternalGraphicOrMark($externalgraphicormark)
- {
- if ($externalgraphicormark == "externalgraphic")
- {
- $this->externalgraphicsormarks[] = new ExternalGraphic();
- }
- else if ($externalgraphicormark == "mark")
- {
- $test = new Mark();
- $this->externalgraphicsormarks[] = $test;
- }
- }
- function deleteExternalGraphicOrMark($index)
- {
- array_splice($this->externalgraphicsormarks, $index, 1);
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/Graphic.php (from rev 2404, branches/2.5/http/sld/classes/Graphic.php)
===================================================================
--- trunk/mapbender/http/sld/classes/Graphic.php (rev 0)
+++ trunk/mapbender/http/sld/classes/Graphic.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,243 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the Graphic-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Graphic
+{
+ /**
+ * Array containing ExternalGraphic or Mark objects.
+ *
+ * @see ExternalGraphic
+ * @see Mark
+ * @var array
+ */
+ var $externalgraphicsormarks = array();
+
+ /**
+ * The opacity element from the xml-scheme.
+ *
+ * Not sure if this feature is supported by UMN-MapServer!
+ *
+ * @var string
+ */
+ var $opacity = "";
+
+ /**
+ * The size element from the xml-scheme.
+ * @var string
+ */
+ var $size = "";
+
+ /**
+ * The rotation element from the xml-scheme.
+ *
+ * Not sure if this feature is supported by UMN-MapServer!
+ *
+ * @var int
+ */
+ var $rotation = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Graphic>\n";
+ foreach ($this->externalgraphicsormarks as $externalgraphicormark)
+ {
+ $temp .= $externalgraphicormark->generateXml($offset." ");
+ }
+ if ($this->opacity != "") $temp .= $offset." <Opacity>".htmlspecialchars($this->opacity)."</Opacity>\n";
+ if ($this->size != "") $temp .= $offset." <Size>".htmlspecialchars($this->size)."</Size>\n";
+ if ($this->rotation != "") $temp .= $offset." <Rotation>".htmlspecialchars($this->rotation)."</Rotation>\n";
+ $temp .= $offset."</Graphic>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table border='0' cellpadding='2' cellspacing='0'>\n";
+ $temp .= $offset."<tr valign='top'>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."<span>\n";
+ $temp .= $offset."Graphic:\n";
+ $temp .= $offset."</span>\n";
+ $temp .= $offset."<br>\n";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"graphic\">\n";
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=deletegraphic&id=".$this->parent."\">";
+ $temp .= $offset."<img src='./img/minus.gif' border='0' alt='Rule löschen'> löschen";
+ $temp .= $offset."</a>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td valign='top'>\n";
+
+ $temp .= $offset." <table border='1' cellpadding='2' cellspacing='1'>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text' style=\"width: 100px;\">\n";
+ $temp .= $offset." Opacity:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input class='inputfield edit_label_text' name=\"".$id."_opacity\" value=\"".htmlspecialchars($this->opacity)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>\n";
+ $temp .= $offset." Size:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input class='inputfield edit_label_text' name=\"".$id."_size\" value=\"".htmlspecialchars($this->size)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>\n";
+ $temp .= $offset." Rotation:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input class='inputfield edit_label_text' name=\"".$id."_rotation\" value=\"".htmlspecialchars($this->rotation)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td valign='top'>\n";
+ $temp .= $offset." <select class=\"edit_label_text\" name=\"".$id."_newexternalgraphicormark\">\n";
+ $temp .= $offset." <option value=\"mark\">Mark</option>\n";
+ $temp .= $offset." <option value=\"externalgraphic\">ExternalGraphic</option>\n";
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td colspan='2'>\n";
+ $externalgraphicormark_id = 0;
+ foreach ($this->externalgraphicsormarks as $externalgraphicormark)
+ {
+ $temp .= $externalgraphicormark->generateHtmlForm($id."_externalgraphicormark_".$externalgraphicormark_id, $offset."");
+ $externalgraphicormark_id++;
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset."<input class='edit' type=\"button\" value=\"hinzufügen\"";
+ $temp .= " onClick=\"url='sld_function_handler.php?function=addexternalgraphicormark&id=".$this->id."&externalgraphicormark=';";
+ $temp .= " url += ".$id."_newexternalgraphicormark.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countExternalGraphicsOrMarks = 0;
+ while (isset($_REQUEST[$id."_externalgraphicormark_".$countExternalGraphicsOrMarks]))
+ {
+ $externalgraphicormark = "";
+ if ($_REQUEST[$id."_externalgraphicormark_".$countExternalGraphicsOrMarks] == "mark")
+ {
+ $externalgraphicormark = new Mark();
+ }
+ else if ($_REQUEST[$id."_externalgraphicormark_".$countExternalGraphicsOrMarks] == "externalgraphic")
+ {
+ $externalgraphicormark = new ExternalGraphic();
+ }
+ $externalgraphicormark->generateObjectFromPost($id."_externalgraphicormark_".$countExternalGraphicsOrMarks);
+ $this->externalgraphicsormarks[] = $externalgraphicormark;
+ $countExternalGraphicsOrMarks++;
+ }
+ if (isset($_REQUEST[$id."_opacity"]))
+ {
+ $this->opacity = $_REQUEST[$id."_opacity"];
+ }
+ if (isset($_REQUEST[$id."_size"]))
+ {
+ $this->size = $_REQUEST[$id."_size"];
+ }
+ if (isset($_REQUEST[$id."_rotation"]))
+ {
+ $this->rotation = $_REQUEST[$id."_rotation"];
+ }
+ }
+ function addExternalGraphicOrMark($externalgraphicormark)
+ {
+ if ($externalgraphicormark == "externalgraphic")
+ {
+ $this->externalgraphicsormarks[] = new ExternalGraphic();
+ }
+ else if ($externalgraphicormark == "mark")
+ {
+ $test = new Mark();
+ $this->externalgraphicsormarks[] = $test;
+ }
+ }
+ function deleteExternalGraphicOrMark($index)
+ {
+ array_splice($this->externalgraphicsormarks, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/GraphicFill.php
===================================================================
--- branches/2.5/http/sld/classes/GraphicFill.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/GraphicFill.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,116 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the GraphicFill-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class GraphicFill
-{
- /**
- * The Graphic object from the xml-scheme.
- *
- * @see Graphic
- * @var object
- */
- var $graphic = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<GraphicFill>\n";
- if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
- $temp .= $offset."</GraphicFill>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table style=\"border: 1px solid black;\">\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." GraphicFill<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"graphicfill\">\n";
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletegraphicfill&id=".$this->parent."\">löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- if ($this->graphic != "")
- {
- $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
- }
- else
- {
- $temp .= $offset."Graphic hinzufügen<a class='edit' href=\"sld_function_handler.php?function=addgraphic&id=".$this->id."\">Graphic hinzufügen</a><br>\n";
- }
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_graphic"]))
- {
- $this->graphic = new Graphic();
- $this->graphic->generateObjectFromPost($id."_graphic");
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/GraphicFill.php (from rev 2404, branches/2.5/http/sld/classes/GraphicFill.php)
===================================================================
--- trunk/mapbender/http/sld/classes/GraphicFill.php (rev 0)
+++ trunk/mapbender/http/sld/classes/GraphicFill.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,116 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the GraphicFill-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class GraphicFill
+{
+ /**
+ * The Graphic object from the xml-scheme.
+ *
+ * @see Graphic
+ * @var object
+ */
+ var $graphic = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<GraphicFill>\n";
+ if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
+ $temp .= $offset."</GraphicFill>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table style=\"border: 1px solid black;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." GraphicFill<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"graphicfill\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletegraphicfill&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ if ($this->graphic != "")
+ {
+ $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."Graphic hinzufügen<a class='edit' href=\"sld_function_handler.php?function=addgraphic&id=".$this->id."\">Graphic hinzufügen</a><br>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_graphic"]))
+ {
+ $this->graphic = new Graphic();
+ $this->graphic->generateObjectFromPost($id."_graphic");
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/GraphicStroke.php
===================================================================
--- branches/2.5/http/sld/classes/GraphicStroke.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/GraphicStroke.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,118 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the GraphicStroke-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class GraphicStroke
-{
- /**
- * The Graphic object from the xml-scheme.
- *
- * @see Graphic
- * @var object
- */
- var $graphic = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * Default constructor that automatically creates a Graphic object.
- */
- function GraphicStroke()
- {
- $this->graphic = new Graphic();
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<GraphicStroke>\n";
- if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
- $temp .= $offset."</GraphicStroke>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table style=\"border: 1px solid black;\">\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." GraphicStroke\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"graphicstroke\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- if ($this->graphic != "") $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_graphic"]))
- {
- $this->graphic = new Graphic();
- $this->graphic->generateObjectFromPost($id."_graphic");
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/GraphicStroke.php (from rev 2404, branches/2.5/http/sld/classes/GraphicStroke.php)
===================================================================
--- trunk/mapbender/http/sld/classes/GraphicStroke.php (rev 0)
+++ trunk/mapbender/http/sld/classes/GraphicStroke.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,118 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the GraphicStroke-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class GraphicStroke
+{
+ /**
+ * The Graphic object from the xml-scheme.
+ *
+ * @see Graphic
+ * @var object
+ */
+ var $graphic = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Default constructor that automatically creates a Graphic object.
+ */
+ function GraphicStroke()
+ {
+ $this->graphic = new Graphic();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<GraphicStroke>\n";
+ if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
+ $temp .= $offset."</GraphicStroke>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table style=\"border: 1px solid black;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." GraphicStroke\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"graphicstroke\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ if ($this->graphic != "") $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_graphic"]))
+ {
+ $this->graphic = new Graphic();
+ $this->graphic->generateObjectFromPost($id."_graphic");
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/Halo.php
===================================================================
--- branches/2.5/http/sld/classes/Halo.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/Halo.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,125 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the Halo-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class Halo
-{
- /**
- * The radius attribute from the xml-scheme.
- * @var int
- */
- var $radius = "";
-
- /**
- * The Fill object from the xml-scheme.
- *
- * @see Fill
- * @var string
- */
- var $fill = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<Halo>\n";
- if ($this->radius != "") $temp .= $offset." <Radius>".htmlspecialchars($this->radius)."</Radius>\n";
- if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
- $temp .= $offset."</Halo>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "<hr class=\"sep\">\n";
- $temp .= $offset."<table>\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." Halo\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"halo\">\n<br />";
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletehalo&id=".$this->parent."\">löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." Radius: <input name=\"".$id."_radius\" value=\"".htmlspecialchars($this->radius)."\"><br>\n";
- if ($this->fill != "") {
- $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." "); }
- else {
- $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
- }
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_radius"]))
- {
- $this->radius = $_REQUEST[$id."_radius"];
- }
- if (isset($_REQUEST[$id."_fill"]))
- {
- $this->fill = new Fill();
- $this->fill->generateObjectFromPost($id."_fill");
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/Halo.php (from rev 2404, branches/2.5/http/sld/classes/Halo.php)
===================================================================
--- trunk/mapbender/http/sld/classes/Halo.php (rev 0)
+++ trunk/mapbender/http/sld/classes/Halo.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,125 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the Halo-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Halo
+{
+ /**
+ * The radius attribute from the xml-scheme.
+ * @var int
+ */
+ var $radius = "";
+
+ /**
+ * The Fill object from the xml-scheme.
+ *
+ * @see Fill
+ * @var string
+ */
+ var $fill = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Halo>\n";
+ if ($this->radius != "") $temp .= $offset." <Radius>".htmlspecialchars($this->radius)."</Radius>\n";
+ if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
+ $temp .= $offset."</Halo>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "<hr class=\"sep\">\n";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Halo\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"halo\">\n<br />";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletehalo&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Radius: <input name=\"".$id."_radius\" value=\"".htmlspecialchars($this->radius)."\"><br>\n";
+ if ($this->fill != "") {
+ $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." "); }
+ else {
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_radius"]))
+ {
+ $this->radius = $_REQUEST[$id."_radius"];
+ }
+ if (isset($_REQUEST[$id."_fill"]))
+ {
+ $this->fill = new Fill();
+ $this->fill->generateObjectFromPost($id."_fill");
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/LabelPlacement.php
===================================================================
--- branches/2.5/http/sld/classes/LabelPlacement.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/LabelPlacement.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,125 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the LabelPlacement-element
- *
- * This implementation only supports PointPlacement for Labels, because UMN-Mapservers's implementation is limited to PointPlacement, too.
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class LabelPlacement
-{
- /**
- * The Placement object from the xml-scheme.
- * Only PointPlacement is supported in UMN-MapServer.
- *
- * @see Pointplacement
- * @var object
- */
- var $placement = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * Default constructor that automatically creates a PointPlacement object.
- */
- function LabelPlacement()
- {
- //Only PointPlacement is supported by MapServer
- $this->placement = new PointPlacement();
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<LabelPlacement>\n";
- $temp .= $this->placement->generateXml($offset." ");
- $temp .= $offset."</LabelPlacement>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "<hr class=\"sep\">\n";
- $temp .= $offset."<table>\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." LabelPlacement<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"labelplacement\">\n";
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletelabelplacement&id=".$this->parent."\">löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- $temp .= $this->placement->generateHtmlForm($id."_placement", $offset." ");
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- //Todo - Unterscheidung von PointPlacement und anderen Placements (wenn vorhanden)
- //not supported by Mapserver
- if (isset($_REQUEST[$id."_placement"]))
- {
- $this->placement = new PointPlacement();
- $this->placement->generateObjectFromPost($id."_placement");
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/LabelPlacement.php (from rev 2404, branches/2.5/http/sld/classes/LabelPlacement.php)
===================================================================
--- trunk/mapbender/http/sld/classes/LabelPlacement.php (rev 0)
+++ trunk/mapbender/http/sld/classes/LabelPlacement.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,125 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the LabelPlacement-element
+ *
+ * This implementation only supports PointPlacement for Labels, because UMN-Mapservers's implementation is limited to PointPlacement, too.
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class LabelPlacement
+{
+ /**
+ * The Placement object from the xml-scheme.
+ * Only PointPlacement is supported in UMN-MapServer.
+ *
+ * @see Pointplacement
+ * @var object
+ */
+ var $placement = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Default constructor that automatically creates a PointPlacement object.
+ */
+ function LabelPlacement()
+ {
+ //Only PointPlacement is supported by MapServer
+ $this->placement = new PointPlacement();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<LabelPlacement>\n";
+ $temp .= $this->placement->generateXml($offset." ");
+ $temp .= $offset."</LabelPlacement>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "<hr class=\"sep\">\n";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." LabelPlacement<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"labelplacement\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletelabelplacement&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $this->placement->generateHtmlForm($id."_placement", $offset." ");
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ //Todo - Unterscheidung von PointPlacement und anderen Placements (wenn vorhanden)
+ //not supported by Mapserver
+ if (isset($_REQUEST[$id."_placement"]))
+ {
+ $this->placement = new PointPlacement();
+ $this->placement->generateObjectFromPost($id."_placement");
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/LegendGraphic.php
===================================================================
--- branches/2.5/http/sld/classes/LegendGraphic.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/LegendGraphic.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,154 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the LegendGraphic-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class LegendGraphic extends Rule
-{
- /**
- * The Graphic object from the xml-scheme.
- *
- * @see Graphic
- * @var object
- */
- var $graphic = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<LegendGraphic>\n";
- //Graphic must occur once
- if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
- $temp .= $offset."</LegendGraphic>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table width='100%' border='0' cellpadding='1' cellspacing='0'>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text' valign='top' width='136'>\n";
- $temp .= $offset." LegendGraphic:\n";
- $temp .= $offset." </td>\n";
-
- if ($this->graphic != "")
- {
- $temp .= $offset."<td rowspan='2'>\n";
- $temp .= $offset."<td>\n";
- $temp .= $offset."<td rowspan='2' style='border:1px solid black; background-color:#FFFFFF'>\n";
- $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
- $temp .= $offset."<td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset."<td>\n";
- $temp .= $offset." \n";
- $temp .= $offset."</td>\n";
- $temp .= $offset." </tr>\n";
- }
- else
- {
- $temp .= $offset."<td>\n";
- $temp .= $offset." \n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."<td class='text' style='border:1px solid black; border-bottom:none; background-color:#FFFFFF'>\n";
- $temp .= $offset." Graphic:\n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- //--------------------------
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td valign='bottom'>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"legendgraphic\">\n";
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletelegendgraphic&id=".$this->parent."\">\n";
- $temp .= $offset." <img src='./img/minus.gif' border='0' alt='LegendGraphic löschen'> löschen\n";
- $temp .= $offset." </a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset."<td>\n";
- $temp .= $offset." \n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."<td style='border:1px solid black; border-top:none; background-color:#FFFFFF'>\n";
- $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addgraphic&id=".$this->id."\">\n";
- $temp .= $offset." <img src='./img/plus.gif' border='0' alt='Graphic hinzufügen'> hinzufügen</a><br>\n";
- $temp .= $offset."</td>\n";
- $temp .= $offset." </tr>\n";
- }
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_graphic"]))
- {
- $this->graphic = new Graphic();
- $this->graphic->generateObjectFromPost($id."_graphic");
- }
- }
-
- /**
- * Function that adds a graphic object.
- * Not sure if this function is neccessary / in use!
- */
- function addGraphic()
- {
- $this->graphic = new Graphic();
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/LegendGraphic.php (from rev 2404, branches/2.5/http/sld/classes/LegendGraphic.php)
===================================================================
--- trunk/mapbender/http/sld/classes/LegendGraphic.php (rev 0)
+++ trunk/mapbender/http/sld/classes/LegendGraphic.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,154 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the LegendGraphic-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class LegendGraphic extends Rule
+{
+ /**
+ * The Graphic object from the xml-scheme.
+ *
+ * @see Graphic
+ * @var object
+ */
+ var $graphic = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<LegendGraphic>\n";
+ //Graphic must occur once
+ if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
+ $temp .= $offset."</LegendGraphic>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table width='100%' border='0' cellpadding='1' cellspacing='0'>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text' valign='top' width='136'>\n";
+ $temp .= $offset." LegendGraphic:\n";
+ $temp .= $offset." </td>\n";
+
+ if ($this->graphic != "")
+ {
+ $temp .= $offset."<td rowspan='2'>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."<td rowspan='2' style='border:1px solid black; background-color:#FFFFFF'>\n";
+ $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset." </tr>\n";
+ }
+ else
+ {
+ $temp .= $offset."<td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td class='text' style='border:1px solid black; border-bottom:none; background-color:#FFFFFF'>\n";
+ $temp .= $offset." Graphic:\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ //--------------------------
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td valign='bottom'>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"legendgraphic\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletelegendgraphic&id=".$this->parent."\">\n";
+ $temp .= $offset." <img src='./img/minus.gif' border='0' alt='LegendGraphic löschen'> löschen\n";
+ $temp .= $offset." </a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td style='border:1px solid black; border-top:none; background-color:#FFFFFF'>\n";
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addgraphic&id=".$this->id."\">\n";
+ $temp .= $offset." <img src='./img/plus.gif' border='0' alt='Graphic hinzufügen'> hinzufügen</a><br>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset." </tr>\n";
+ }
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_graphic"]))
+ {
+ $this->graphic = new Graphic();
+ $this->graphic->generateObjectFromPost($id."_graphic");
+ }
+ }
+
+ /**
+ * Function that adds a graphic object.
+ * Not sure if this function is neccessary / in use!
+ */
+ function addGraphic()
+ {
+ $this->graphic = new Graphic();
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/LineSymbolizer.php
===================================================================
--- branches/2.5/http/sld/classes/LineSymbolizer.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/LineSymbolizer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,129 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the LineSymbolizer-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class LineSymbolizer extends Rule
-{
- /**
- * The Stroke object from the xml-scheme.
- *
- * @see Stroke
- * @var object
- */
- var $stroke = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
-
- function LineSymbolizer()
- {
- //$this->stroke = new Stroke();
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<LineSymbolizer>\n";
- if ($this->stroke != "") $temp .= $this->stroke->generateXml($offset." ");
- $temp .= $offset."</LineSymbolizer>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black; width:100%;\">\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td class='text' style=\"width: 130px;\">\n";
-
- $temp .= $offset." LineSymbolizer<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"linesymbolizer\">\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
-
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- if ($this->stroke != "")
- {
- $temp .= $this->stroke->generateHtmlForm($id."_stroke", $offset." ");
- }
- else
- {
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addstroke&id=".$this->id."\">Stroke hinzufügen</a>\n";
- }
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- $temp .= $offset."<br>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_stroke"]))
- {
- $this->stroke = new Stroke();
- $this->stroke->generateObjectFromPost($id."_stroke");
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/LineSymbolizer.php (from rev 2404, branches/2.5/http/sld/classes/LineSymbolizer.php)
===================================================================
--- trunk/mapbender/http/sld/classes/LineSymbolizer.php (rev 0)
+++ trunk/mapbender/http/sld/classes/LineSymbolizer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,129 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the LineSymbolizer-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class LineSymbolizer extends Rule
+{
+ /**
+ * The Stroke object from the xml-scheme.
+ *
+ * @see Stroke
+ * @var object
+ */
+ var $stroke = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+
+ function LineSymbolizer()
+ {
+ //$this->stroke = new Stroke();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<LineSymbolizer>\n";
+ if ($this->stroke != "") $temp .= $this->stroke->generateXml($offset." ");
+ $temp .= $offset."</LineSymbolizer>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black; width:100%;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td class='text' style=\"width: 130px;\">\n";
+
+ $temp .= $offset." LineSymbolizer<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"linesymbolizer\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ if ($this->stroke != "")
+ {
+ $temp .= $this->stroke->generateHtmlForm($id."_stroke", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addstroke&id=".$this->id."\">Stroke hinzufügen</a>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_stroke"]))
+ {
+ $this->stroke = new Stroke();
+ $this->stroke->generateObjectFromPost($id."_stroke");
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/Mark.php
===================================================================
--- branches/2.5/http/sld/classes/Mark.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/Mark.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,179 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the Mark-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class Mark
-{
- /**
- * The wellknownname element from the xml-scheme.
- * @var string
- */
- var $wellknownname = "";
-
- /**
- * The Fill object from the xml-scheme.
- *
- * @see Fill
- * @var object
- */
- var $fill = "";
-
- /**
- * The Stroke object from the xml-scheme.
- *
- * @see Stroke
- * @var object
- */
- var $stroke = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<Mark>\n";
- if ($this->wellknownname != "") $temp .= $offset." <WellKnownName>".htmlspecialchars($this->wellknownname)."</WellKnownName>\n";
- if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
- if ($this->stroke != "") $temp .= $this->stroke->generateXml($offset." ");
- $temp .= $offset."</Mark>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table style=\"border: 1px solid black;\">\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 100px\">\n";
- $temp .= $offset." Mark<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"mark\">\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deleteexternalgraphicormark&id=".$this->parent."&number=".$number."\">löschen</a>\n";
-
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." WellKnownName:\n";
- $temp .= $offset." <select name=\"".$id."_wellknownname\" onchange=\"document.getElementById('sld_editor_form').submit();\">\n";
- $temp .= $offset." <option value=\"square\"";
- if ($this->wellknownname == "square") $temp .= " selected";
- $temp .= ">square</option>\n";
- $temp .= $offset." <option value=\"circle\"";
- if ($this->wellknownname == "circle") $temp .= " selected";
- $temp .= ">circle</option>\n";
- $temp .= $offset." <option value=\"triangle\"";
- if ($this->wellknownname == "triangle") $temp .= " selected";
- $temp .= ">triangle</option>\n";
- $temp .= $offset." <option value=\"star\"";
- if ($this->wellknownname == "star") $temp .= " selected";
- $temp .= ">star</option>\n";
- $temp .= $offset." <option value=\"cross\"";
- if ($this->wellknownname == "cross") $temp .= " selected";
- $temp .= ">cross</option>\n";
- $temp .= $offset."<option value=\"x\"";
- if ($this->wellknownname == "x") $temp .= " selected";
- $temp .= ">x</option>\n";
- $temp .= $offset." </select>\n";
- $temp .= $offset." <br>\n";
- //TODO - Zeilenumbruch
- if ($this->fill != "")
- {
- $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
- }
- else
- {
- $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
- }
- if ($this->stroke != "")
- {
- $temp .= $this->stroke->generateHtmlForm($id."_stroke", $offset." ");
- }
- else
- {
- $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addstroke&id=".$this->id."\">Stroke hinzufügen</a><br>\n";
- }
-
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."</table>\n";
- $temp .= $offset."<br>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_wellknownname"]))
- {
- $this->wellknownname = $_REQUEST[$id."_wellknownname"];
- }
- if (isset($_REQUEST[$id."_fill"]))
- {
- $this->fill = new Fill();
- $this->fill->generateObjectFromPost($id."_fill");
- }
- if (isset($_REQUEST[$id."_stroke"]))
- {
- $this->stroke = new Stroke();
- $this->stroke->generateObjectFromPost($id."_stroke");
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/Mark.php (from rev 2404, branches/2.5/http/sld/classes/Mark.php)
===================================================================
--- trunk/mapbender/http/sld/classes/Mark.php (rev 0)
+++ trunk/mapbender/http/sld/classes/Mark.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,179 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the Mark-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Mark
+{
+ /**
+ * The wellknownname element from the xml-scheme.
+ * @var string
+ */
+ var $wellknownname = "";
+
+ /**
+ * The Fill object from the xml-scheme.
+ *
+ * @see Fill
+ * @var object
+ */
+ var $fill = "";
+
+ /**
+ * The Stroke object from the xml-scheme.
+ *
+ * @see Stroke
+ * @var object
+ */
+ var $stroke = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Mark>\n";
+ if ($this->wellknownname != "") $temp .= $offset." <WellKnownName>".htmlspecialchars($this->wellknownname)."</WellKnownName>\n";
+ if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
+ if ($this->stroke != "") $temp .= $this->stroke->generateXml($offset." ");
+ $temp .= $offset."</Mark>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table style=\"border: 1px solid black;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px\">\n";
+ $temp .= $offset." Mark<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"mark\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deleteexternalgraphicormark&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." WellKnownName:\n";
+ $temp .= $offset." <select name=\"".$id."_wellknownname\" onchange=\"document.getElementById('sld_editor_form').submit();\">\n";
+ $temp .= $offset." <option value=\"square\"";
+ if ($this->wellknownname == "square") $temp .= " selected";
+ $temp .= ">square</option>\n";
+ $temp .= $offset." <option value=\"circle\"";
+ if ($this->wellknownname == "circle") $temp .= " selected";
+ $temp .= ">circle</option>\n";
+ $temp .= $offset." <option value=\"triangle\"";
+ if ($this->wellknownname == "triangle") $temp .= " selected";
+ $temp .= ">triangle</option>\n";
+ $temp .= $offset." <option value=\"star\"";
+ if ($this->wellknownname == "star") $temp .= " selected";
+ $temp .= ">star</option>\n";
+ $temp .= $offset." <option value=\"cross\"";
+ if ($this->wellknownname == "cross") $temp .= " selected";
+ $temp .= ">cross</option>\n";
+ $temp .= $offset."<option value=\"x\"";
+ if ($this->wellknownname == "x") $temp .= " selected";
+ $temp .= ">x</option>\n";
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." <br>\n";
+ //TODO - Zeilenumbruch
+ if ($this->fill != "")
+ {
+ $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
+ }
+ if ($this->stroke != "")
+ {
+ $temp .= $this->stroke->generateHtmlForm($id."_stroke", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addstroke&id=".$this->id."\">Stroke hinzufügen</a><br>\n";
+ }
+
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_wellknownname"]))
+ {
+ $this->wellknownname = $_REQUEST[$id."_wellknownname"];
+ }
+ if (isset($_REQUEST[$id."_fill"]))
+ {
+ $this->fill = new Fill();
+ $this->fill->generateObjectFromPost($id."_fill");
+ }
+ if (isset($_REQUEST[$id."_stroke"]))
+ {
+ $this->stroke = new Stroke();
+ $this->stroke->generateObjectFromPost($id."_stroke");
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/NamedLayer.php
===================================================================
--- branches/2.5/http/sld/classes/NamedLayer.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/NamedLayer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,138 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the NamedLayer-element
- *
- * @package sld_classes
- * @see StyledLayerDescriptor::$layers
- * @author Markus Krzyzanowski
- */
-class NamedLayer extends StyledLayerDescriptor
-{
- /**
- * The name attribute from the xml-scheme.
- * @var string
- */
- var $name = "";
- //Probably not supported by Mapserver - TODO
- //var $layerfeatureconstraints = "";
- /**
- * Array containing the style-objects of the layer.
- *
- * @see UserStyle
- * @var array
- */
- var $styles = array();
- // $id and $parent for the $objects session array
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<NamedLayer>\n";
- $temp .= $offset." <Name>".htmlspecialchars($this->name)."</Name>\n";
- foreach($this->styles as $style)
- {
- $temp .= $style->generateXml($offset." ");
- }
- $temp .= $offset."</NamedLayer>\n";
- return $temp;
- }
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text_head'>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"namedlayer\">\n";
- $temp .= $offset." <em> Layer: ".htmlspecialchars($this->name)."</em>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".htmlspecialchars($this->name)."\">\n";
- $style_id = 0;
- foreach ($this->styles as $style)
- {
- $temp .= $style->generateHtmlForm($id."_style_".$style_id, $offset." ");
- $style_id++;
- }
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $this->name = $_REQUEST[$id."_name"];
- $countStyles = 0;
- while (isset($_REQUEST[$id."_style_".$countStyles]))
- {
- $style = "";
- if ($_REQUEST[$id."_style_".$countStyles] == "userstyle")
- {
- $style = new UserStyle();
- }
- else
- {
- //Todo evtl: namedstyle erstellen
- //NamedStyle is currently not supported by UMN-MapServer!
- //$style = new NamedStyle();
- }
- $style->generateObjectFromPost($id."_style_".$countStyles);
- $this->styles[] = $style;
- $countStyles++;
- }
- }
-}
-
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/NamedLayer.php (from rev 2404, branches/2.5/http/sld/classes/NamedLayer.php)
===================================================================
--- trunk/mapbender/http/sld/classes/NamedLayer.php (rev 0)
+++ trunk/mapbender/http/sld/classes/NamedLayer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,138 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the NamedLayer-element
+ *
+ * @package sld_classes
+ * @see StyledLayerDescriptor::$layers
+ * @author Markus Krzyzanowski
+ */
+class NamedLayer extends StyledLayerDescriptor
+{
+ /**
+ * The name attribute from the xml-scheme.
+ * @var string
+ */
+ var $name = "";
+ //Probably not supported by Mapserver - TODO
+ //var $layerfeatureconstraints = "";
+ /**
+ * Array containing the style-objects of the layer.
+ *
+ * @see UserStyle
+ * @var array
+ */
+ var $styles = array();
+ // $id and $parent for the $objects session array
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<NamedLayer>\n";
+ $temp .= $offset." <Name>".htmlspecialchars($this->name)."</Name>\n";
+ foreach($this->styles as $style)
+ {
+ $temp .= $style->generateXml($offset." ");
+ }
+ $temp .= $offset."</NamedLayer>\n";
+ return $temp;
+ }
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text_head'>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"namedlayer\">\n";
+ $temp .= $offset." <em> Layer: ".htmlspecialchars($this->name)."</em>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".htmlspecialchars($this->name)."\">\n";
+ $style_id = 0;
+ foreach ($this->styles as $style)
+ {
+ $temp .= $style->generateHtmlForm($id."_style_".$style_id, $offset." ");
+ $style_id++;
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ $countStyles = 0;
+ while (isset($_REQUEST[$id."_style_".$countStyles]))
+ {
+ $style = "";
+ if ($_REQUEST[$id."_style_".$countStyles] == "userstyle")
+ {
+ $style = new UserStyle();
+ }
+ else
+ {
+ //Todo evtl: namedstyle erstellen
+ //NamedStyle is currently not supported by UMN-MapServer!
+ //$style = new NamedStyle();
+ }
+ $style->generateObjectFromPost($id."_style_".$countStyles);
+ $this->styles[] = $style;
+ $countStyles++;
+ }
+ }
+}
+
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/ParameterValue.php
===================================================================
--- branches/2.5/http/sld/classes/ParameterValue.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/ParameterValue.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,75 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the ParameterValueType type of elements
- *
- * @package sld_classes
- * @author Michael Schulz
- */
-class ParameterValue
-{
- /**
- * The value attribute from the xml-scheme.
- * @var string
- */
- var $value = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml()
- {
- $temp = "<PropertyName>".$this->value."</PropertyName>";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = $this->value;
- return $temp;
- }
-
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/ParameterValue.php (from rev 2404, branches/2.5/http/sld/classes/ParameterValue.php)
===================================================================
--- trunk/mapbender/http/sld/classes/ParameterValue.php (rev 0)
+++ trunk/mapbender/http/sld/classes/ParameterValue.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,75 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the ParameterValueType type of elements
+ *
+ * @package sld_classes
+ * @author Michael Schulz
+ */
+class ParameterValue
+{
+ /**
+ * The value attribute from the xml-scheme.
+ * @var string
+ */
+ var $value = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml()
+ {
+ $temp = "<PropertyName>".$this->value."</PropertyName>";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = $this->value;
+ return $temp;
+ }
+
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/PointPlacement.php
===================================================================
--- branches/2.5/http/sld/classes/PointPlacement.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/PointPlacement.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,151 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the PointPlacement-element
- *
- * Creating an instance of this class will also create the anchorpoint and displacement objects for this instance.
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class PointPlacement
-{
- /**
- * The anchorpoint object from the xml-scheme.
- *
- * @see AnchorPoint
- * @var object
- */
- var $anchorpoint = "";
-
- /**
- * The displacement object from the xml-scheme.
- *
- * @see Displacement
- * @var object
- */
- var $displacement = "";
-
- /**
- * The rotation attribute from the xml-scheme.
- *
- * Not sure if this feature is supported in UMN-MapServer.
- *
- * @var int
- */
- var $rotation = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * Default constructor that automatically creates an AnchorPoint and a Displacement object.
- */
- function PointPlacement()
- {
- $this->anchorpoint = new AnchorPoint();
- $this->displacement = new Displacement();
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<PointPlacement>\n";
- $temp .= $this->anchorpoint->generateXml($offset." ");
- $temp .= $this->displacement->generateXml($offset." ");
- if ($this->rotation != "") $temp .= $offset." <Rotation>".htmlspecialchars($this->rotation)."</Rotation>\n";
- $temp .= $offset."</PointPlacement>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"pointplacement\">\n";
- $temp .= $offset."<table>\n";
-
- $temp .= $this->anchorpoint->generateHtmlForm($id."_anchorpoint", $offset." ");
- $temp .= $this->displacement->generateHtmlForm($id."_displacement", $offset." ");
-
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." Rotation:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_rotation\" value=\"".htmlspecialchars($this->rotation)."\"><br>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_anchorpoint"]))
- {
- $this->anchorpoint = new AnchorPoint();
- $this->anchorpoint->generateObjectFromPost($id."_anchorpoint");
- }
- if (isset($_REQUEST[$id."_displacement"]))
- {
- $this->displacement = new Displacement();
- $this->displacement->generateObjectFromPost($id."_displacement");
- }
- if (isset($_REQUEST[$id."_rotation"]))
- {
- $this->rotation = $_REQUEST[$id."_rotation"];
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/PointPlacement.php (from rev 2404, branches/2.5/http/sld/classes/PointPlacement.php)
===================================================================
--- trunk/mapbender/http/sld/classes/PointPlacement.php (rev 0)
+++ trunk/mapbender/http/sld/classes/PointPlacement.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,151 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the PointPlacement-element
+ *
+ * Creating an instance of this class will also create the anchorpoint and displacement objects for this instance.
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class PointPlacement
+{
+ /**
+ * The anchorpoint object from the xml-scheme.
+ *
+ * @see AnchorPoint
+ * @var object
+ */
+ var $anchorpoint = "";
+
+ /**
+ * The displacement object from the xml-scheme.
+ *
+ * @see Displacement
+ * @var object
+ */
+ var $displacement = "";
+
+ /**
+ * The rotation attribute from the xml-scheme.
+ *
+ * Not sure if this feature is supported in UMN-MapServer.
+ *
+ * @var int
+ */
+ var $rotation = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Default constructor that automatically creates an AnchorPoint and a Displacement object.
+ */
+ function PointPlacement()
+ {
+ $this->anchorpoint = new AnchorPoint();
+ $this->displacement = new Displacement();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<PointPlacement>\n";
+ $temp .= $this->anchorpoint->generateXml($offset." ");
+ $temp .= $this->displacement->generateXml($offset." ");
+ if ($this->rotation != "") $temp .= $offset." <Rotation>".htmlspecialchars($this->rotation)."</Rotation>\n";
+ $temp .= $offset."</PointPlacement>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"pointplacement\">\n";
+ $temp .= $offset."<table>\n";
+
+ $temp .= $this->anchorpoint->generateHtmlForm($id."_anchorpoint", $offset." ");
+ $temp .= $this->displacement->generateHtmlForm($id."_displacement", $offset." ");
+
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Rotation:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_rotation\" value=\"".htmlspecialchars($this->rotation)."\"><br>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_anchorpoint"]))
+ {
+ $this->anchorpoint = new AnchorPoint();
+ $this->anchorpoint->generateObjectFromPost($id."_anchorpoint");
+ }
+ if (isset($_REQUEST[$id."_displacement"]))
+ {
+ $this->displacement = new Displacement();
+ $this->displacement->generateObjectFromPost($id."_displacement");
+ }
+ if (isset($_REQUEST[$id."_rotation"]))
+ {
+ $this->rotation = $_REQUEST[$id."_rotation"];
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/PointSymbolizer.php
===================================================================
--- branches/2.5/http/sld/classes/PointSymbolizer.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/PointSymbolizer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,137 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the PointSymbolizer-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class PointSymbolizer extends Rule
-{
- /**
- * The Graphic object from the xml-scheme.
- *
- * @see Graphic
- * @var object
- */
- var $graphic = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
-
- function PointSymbolizer()
- {
- //$this->graphic = new Graphic();
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<PointSymbolizer>\n";
- if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
- $temp .= $offset."</PointSymbolizer>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black; width:100%;\">\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 130px;\">\n";
- $temp .= $offset." PointSymbolizer<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"pointsymbolizer\">\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
-
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- if ($this->graphic != "")
- {
- $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
- }
- else
- {
- $temp .= $offset."Graphic: <a class='edit' href=\"sld_function_handler.php?function=addgraphic&id=".$this->id."\">Graphic hinzufügen</a>\n";
- }
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- $temp .= $offset."<br>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_graphic"]))
- {
- $this->graphic = new Graphic();
- $this->graphic->generateObjectFromPost($id."_graphic");
- }
- }
-
- /**
- * Function that creates a new Graphic object.
- *
- * Not sure if this function is neccessary / in use!
- */
- function addGraphic()
- {
- $this->graphic = new Graphic();
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/PointSymbolizer.php (from rev 2404, branches/2.5/http/sld/classes/PointSymbolizer.php)
===================================================================
--- trunk/mapbender/http/sld/classes/PointSymbolizer.php (rev 0)
+++ trunk/mapbender/http/sld/classes/PointSymbolizer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,137 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the PointSymbolizer-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class PointSymbolizer extends Rule
+{
+ /**
+ * The Graphic object from the xml-scheme.
+ *
+ * @see Graphic
+ * @var object
+ */
+ var $graphic = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+
+ function PointSymbolizer()
+ {
+ //$this->graphic = new Graphic();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<PointSymbolizer>\n";
+ if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
+ $temp .= $offset."</PointSymbolizer>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black; width:100%;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 130px;\">\n";
+ $temp .= $offset." PointSymbolizer<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"pointsymbolizer\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ if ($this->graphic != "")
+ {
+ $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."Graphic: <a class='edit' href=\"sld_function_handler.php?function=addgraphic&id=".$this->id."\">Graphic hinzufügen</a>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_graphic"]))
+ {
+ $this->graphic = new Graphic();
+ $this->graphic->generateObjectFromPost($id."_graphic");
+ }
+ }
+
+ /**
+ * Function that creates a new Graphic object.
+ *
+ * Not sure if this function is neccessary / in use!
+ */
+ function addGraphic()
+ {
+ $this->graphic = new Graphic();
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/PolygonSymbolizer.php
===================================================================
--- branches/2.5/http/sld/classes/PolygonSymbolizer.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/PolygonSymbolizer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,151 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the PolygonSymbolizer-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class PolygonSymbolizer extends Rule
-{
- /**
- * The Fill object from the xml-scheme.
- *
- * @see Fill
- * @var object
- */
- var $fill = "";
-
- /**
- * The Stroke object from the xml-scheme.
- *
- * @see Stroke
- * @var object
- */
- var $stroke = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
-
- function PolygonSymbolizer()
- {
- //$this->fill = new Fill();
- //$this->stroke = new Stroke();
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<PolygonSymbolizer>\n";
- if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
- if ($this->stroke != "") $temp .= $this->stroke->generateXml($offset." ");
- $temp .= $offset."</PolygonSymbolizer>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black; width:100%;\">\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 130px;\">\n";
- $temp .= $offset." PolygonSymbolizer<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"polygonsymbolizer\">\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
-
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- if ($this->fill != "")
- {
- $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
- }
- else
- {
- $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
- }
- if ($this->stroke != "")
- {
- $temp .= $this->stroke->generateHtmlForm($id."_stroke", $offset." ");
- }
- else
- {
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addstroke&id=".$this->id."\">Stroke hinzufügen</a>\n";
- }
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- $temp .= $offset."<br>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_fill"]))
- {
- $this->fill = new Fill();
- $this->fill->generateObjectFromPost($id."_fill");
- }
- if (isset($_REQUEST[$id."_stroke"]))
- {
- $this->stroke = new Stroke();
- $this->stroke->generateObjectFromPost($id."_stroke");
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/PolygonSymbolizer.php (from rev 2404, branches/2.5/http/sld/classes/PolygonSymbolizer.php)
===================================================================
--- trunk/mapbender/http/sld/classes/PolygonSymbolizer.php (rev 0)
+++ trunk/mapbender/http/sld/classes/PolygonSymbolizer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,151 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the PolygonSymbolizer-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class PolygonSymbolizer extends Rule
+{
+ /**
+ * The Fill object from the xml-scheme.
+ *
+ * @see Fill
+ * @var object
+ */
+ var $fill = "";
+
+ /**
+ * The Stroke object from the xml-scheme.
+ *
+ * @see Stroke
+ * @var object
+ */
+ var $stroke = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+
+ function PolygonSymbolizer()
+ {
+ //$this->fill = new Fill();
+ //$this->stroke = new Stroke();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<PolygonSymbolizer>\n";
+ if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
+ if ($this->stroke != "") $temp .= $this->stroke->generateXml($offset." ");
+ $temp .= $offset."</PolygonSymbolizer>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black; width:100%;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 130px;\">\n";
+ $temp .= $offset." PolygonSymbolizer<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"polygonsymbolizer\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ if ($this->fill != "")
+ {
+ $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
+ }
+ if ($this->stroke != "")
+ {
+ $temp .= $this->stroke->generateHtmlForm($id."_stroke", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addstroke&id=".$this->id."\">Stroke hinzufügen</a>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_fill"]))
+ {
+ $this->fill = new Fill();
+ $this->fill->generateObjectFromPost($id."_fill");
+ }
+ if (isset($_REQUEST[$id."_stroke"]))
+ {
+ $this->stroke = new Stroke();
+ $this->stroke->generateObjectFromPost($id."_stroke");
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/PropertyIsBetween.php
===================================================================
--- branches/2.5/http/sld/classes/PropertyIsBetween.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/PropertyIsBetween.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,152 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the PropertyIsBetween-element
- *
- * @package filter_classes
- * @author Markus Krzyzanowski
- */
-class PropertyIsBetween
-{
- /**
- * The property name
- * @var string
- */
- var $ogcPropertyName = "";
-
- /**
- * The lower boundary for this property
- * @var float
- */
- var $upperBoundary = "";
-
- /**
- * The upper boundary for this property
- * @var float
- */
- var $lowerBoundary = "";
-
- /**
- * Index of this object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<ogc:PropertyIsBetween>\n";
- $temp .= $offset." <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
- $temp .= $offset." <ogc:LowerBoundary><ogc:Literal>".$this->lowerBoundary."</ogc:Literal></ogc:LowerBoundary>\n";
- $temp .= $offset." <ogc:UpperBoundary><ogc:Literal>".$this->upperBoundary."</ogc:Literal></ogc:UpperBoundary>\n";
- $temp .= $offset."</ogc:PropertyIsBetween>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id = "", $offset = "")
- {
- $temp = "";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"propertyIsBetween\">\n";
- $temp .= $offset." PropertyName\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td style=\"width: 50px; text-align: center; font-size: large;\">=</td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." \n";
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
-
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." LowerBoundary\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td style=\"width: 50px; text-align: center; font-size: large;\">=</td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_lowerboundary\" value=\"".$this->lowerBoundary."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." \n";
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
-
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." UpperBoundary\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td style=\"width: 50px; text-align: center; font-size: large;\">=</td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_upperboundary\" value=\"".$this->upperBoundary."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
- $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
- $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
-
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
- $this->lowerBoundary = $_REQUEST[$id."_lowerboundary"];
- $this->upperBoundary = $_REQUEST[$id."_upperboundary"];
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/PropertyIsBetween.php (from rev 2404, branches/2.5/http/sld/classes/PropertyIsBetween.php)
===================================================================
--- trunk/mapbender/http/sld/classes/PropertyIsBetween.php (rev 0)
+++ trunk/mapbender/http/sld/classes/PropertyIsBetween.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,152 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the PropertyIsBetween-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class PropertyIsBetween
+{
+ /**
+ * The property name
+ * @var string
+ */
+ var $ogcPropertyName = "";
+
+ /**
+ * The lower boundary for this property
+ * @var float
+ */
+ var $upperBoundary = "";
+
+ /**
+ * The upper boundary for this property
+ * @var float
+ */
+ var $lowerBoundary = "";
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ogc:PropertyIsBetween>\n";
+ $temp .= $offset." <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
+ $temp .= $offset." <ogc:LowerBoundary><ogc:Literal>".$this->lowerBoundary."</ogc:Literal></ogc:LowerBoundary>\n";
+ $temp .= $offset." <ogc:UpperBoundary><ogc:Literal>".$this->upperBoundary."</ogc:Literal></ogc:UpperBoundary>\n";
+ $temp .= $offset."</ogc:PropertyIsBetween>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"propertyIsBetween\">\n";
+ $temp .= $offset." PropertyName\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width: 50px; text-align: center; font-size: large;\">=</td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." LowerBoundary\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width: 50px; text-align: center; font-size: large;\">=</td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_lowerboundary\" value=\"".$this->lowerBoundary."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." UpperBoundary\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width: 50px; text-align: center; font-size: large;\">=</td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_upperboundary\" value=\"".$this->upperBoundary."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
+ $this->lowerBoundary = $_REQUEST[$id."_lowerboundary"];
+ $this->upperBoundary = $_REQUEST[$id."_upperboundary"];
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/PropertyIsLike.php
===================================================================
--- branches/2.5/http/sld/classes/PropertyIsLike.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/PropertyIsLike.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,173 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the PropertyIsLike-element
- *
- * @package filter_classes
- * @author Markus Krzyzanowski
- */
-class PropertyIsLike
-{
- /**
- * wildcard attribute
- * @var string
- */
- var $wildCard = "*";
-
- /**
- * singleChar attribute
- * @var string
- */
- var $singleChar = "#";
-
- /**
- * escape character attribute
- * @var string
- */
- var $escape = "!";
-
- /**
- * Name of the Property
- * @var string
- */
- var $ogcPropertyName = "";
-
- /**
- * Regular Expression using the above variables as escape + ... chars.
- * @var string
- */
- var $ogcLiteral = "";
-
- /**
- * Index of this object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<ogc:PropertyIsLike";
- $temp .= " wildCard=\"".$this->wildCard."\"";
- $temp .= " singleChar=\"".$this->singleChar."\"";
- $temp .= " escape=\"".$this->escape."\"";
- $temp .= ">\n";
- $temp .= $offset. " <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
- $temp .= $offset. " <ogc:Literal>".$this->ogcLiteral."</ogc:Literal>\n";
- $temp .= $offset."</ogc:PropertyIsLike>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id = "", $offset = "")
- {
- $temp = "";
-
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td colspan=\"2\">\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"propertyIsLike\">\n";
- $temp .= $offset." WildCard\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_wildcard\" value=\"".$this->wildCard."\">";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td> </td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td colspan=\"2\">\n";
- $temp .= $offset." singleChar\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_singlechar\" value=\"".$this->singleChar."\">";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td> </td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td colspan=\"2\">\n";
- $temp .= $offset." Escape\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_escape\" value=\"".$this->escape."\">";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td> </td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td style=\"width:50px; text-align: center;\">\n";
- $temp .= $offset." LIKE";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_ogcliteral\" value=\"".$this->ogcLiteral."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
- $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">\n";
- $temp .= $offset." <img src='./img/minus.gif' border='0'> löschen</a>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
-
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $this->wildCard = $_REQUEST[$id."_wildcard"];
- $this->singleChar = $_REQUEST[$id."_singlechar"];
- $this->escape = $_REQUEST[$id."_escape"];
- $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
- $this->ogcLiteral = $_REQUEST[$id."_ogcliteral"];
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/PropertyIsLike.php (from rev 2404, branches/2.5/http/sld/classes/PropertyIsLike.php)
===================================================================
--- trunk/mapbender/http/sld/classes/PropertyIsLike.php (rev 0)
+++ trunk/mapbender/http/sld/classes/PropertyIsLike.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,173 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the PropertyIsLike-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class PropertyIsLike
+{
+ /**
+ * wildcard attribute
+ * @var string
+ */
+ var $wildCard = "*";
+
+ /**
+ * singleChar attribute
+ * @var string
+ */
+ var $singleChar = "#";
+
+ /**
+ * escape character attribute
+ * @var string
+ */
+ var $escape = "!";
+
+ /**
+ * Name of the Property
+ * @var string
+ */
+ var $ogcPropertyName = "";
+
+ /**
+ * Regular Expression using the above variables as escape + ... chars.
+ * @var string
+ */
+ var $ogcLiteral = "";
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ogc:PropertyIsLike";
+ $temp .= " wildCard=\"".$this->wildCard."\"";
+ $temp .= " singleChar=\"".$this->singleChar."\"";
+ $temp .= " escape=\"".$this->escape."\"";
+ $temp .= ">\n";
+ $temp .= $offset. " <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
+ $temp .= $offset. " <ogc:Literal>".$this->ogcLiteral."</ogc:Literal>\n";
+ $temp .= $offset."</ogc:PropertyIsLike>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"2\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"propertyIsLike\">\n";
+ $temp .= $offset." WildCard\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_wildcard\" value=\"".$this->wildCard."\">";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td> </td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"2\">\n";
+ $temp .= $offset." singleChar\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_singlechar\" value=\"".$this->singleChar."\">";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td> </td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"2\">\n";
+ $temp .= $offset." Escape\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_escape\" value=\"".$this->escape."\">";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td> </td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width:50px; text-align: center;\">\n";
+ $temp .= $offset." LIKE";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_ogcliteral\" value=\"".$this->ogcLiteral."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">\n";
+ $temp .= $offset." <img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->wildCard = $_REQUEST[$id."_wildcard"];
+ $this->singleChar = $_REQUEST[$id."_singlechar"];
+ $this->escape = $_REQUEST[$id."_escape"];
+ $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
+ $this->ogcLiteral = $_REQUEST[$id."_ogcliteral"];
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/PropertyIsNull.php
===================================================================
--- branches/2.5/http/sld/classes/PropertyIsNull.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/PropertyIsNull.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,119 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the PropertyIsNull-element
- *
- * @package filter_classes
- * @author Markus Krzyzanowski
- */
-class PropertyIsNull
-{
- /**
- * Name of the Property
- * @var string
- */
- var $ogcPropertyName = "";
-
- /**
- * String. Not sure was this is used for in ogc:filter.
- * An "isNull" comparison usually does not require a literal string.
- * @var string
- */
- var $ogcLiteral = "";
-
- /**
- * Index of this object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<ogc:PropertyIsNull>\n";
- $temp .= $offset. " <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
- $temp .= $offset. " <ogc:Literal>".$this->ogcLiteral."</ogc:Literal>\n";
- $temp .= $offset."</ogc:PropertyIsNull>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id = "", $offset = "")
- {
- $temp = "";
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"propertyIsNull\">\n";
- $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td style=\"width:50px; text-align: center;\">\n";
- $temp .= $offset." NULL";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_ogcliteral\" value=\"".$this->ogcLiteral."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $number = split("_", $id);
- $number = $number[count($number)-1];
- $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
- $temp .= $offset." <img src='./img/minus.gif' border='0'> löschen</a>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
- $this->ogcLiteral = $_REQUEST[$id."_ogcliteral"];
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/PropertyIsNull.php (from rev 2404, branches/2.5/http/sld/classes/PropertyIsNull.php)
===================================================================
--- trunk/mapbender/http/sld/classes/PropertyIsNull.php (rev 0)
+++ trunk/mapbender/http/sld/classes/PropertyIsNull.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,119 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the PropertyIsNull-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class PropertyIsNull
+{
+ /**
+ * Name of the Property
+ * @var string
+ */
+ var $ogcPropertyName = "";
+
+ /**
+ * String. Not sure was this is used for in ogc:filter.
+ * An "isNull" comparison usually does not require a literal string.
+ * @var string
+ */
+ var $ogcLiteral = "";
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ogc:PropertyIsNull>\n";
+ $temp .= $offset. " <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
+ $temp .= $offset. " <ogc:Literal>".$this->ogcLiteral."</ogc:Literal>\n";
+ $temp .= $offset."</ogc:PropertyIsNull>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"propertyIsNull\">\n";
+ $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width:50px; text-align: center;\">\n";
+ $temp .= $offset." NULL";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_ogcliteral\" value=\"".$this->ogcLiteral."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
+ $temp .= $offset." <img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
+ $this->ogcLiteral = $_REQUEST[$id."_ogcliteral"];
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/RasterSymbolizer.php
===================================================================
--- branches/2.5/http/sld/classes/RasterSymbolizer.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/RasterSymbolizer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,160 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the RasterSymbolizer-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class RasterSymbolizer extends Rule
-{
- /**
- * The Opacity element from the xml-scheme.
- * This element is not implemented as an object.
- *
- * @var string
- */
- var $opacity = "";
-
- /**
- * The ColorMap object from the xml-scheme.
- *
- * @see ColorMap
- * @var object
- */
- var $colormap = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
-
- function RasterSymbolizer()
- {
- //$this->colormap = new ColorMap();
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<RasterSymbolizer>\n";
- if ($this->opacity != "") $temp .= $offset." <Opacity>".htmlspecialchars($this->opacity)."</Opacity>\n";
- if ($this->colormap != "") $temp .= $this->colormap->generateXml($offset." ");
- $temp .= $offset."</RasterSymbolizer>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black;width:100%\">\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 130px;\">\n";
-
- $temp .= $offset." RasterSymbolizer<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"rastersymbolizer\">\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
-
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
-
- $temp .= $offset." </td>\n";
-
- $temp .= $offset." <td>\n";
-
- $temp .= $offset." <table>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." Opacity:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_opacity\" value=\"".htmlspecialchars($this->opacity)."\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- if ($this->colormap != "")
- {
- $temp .= $this->colormap->generateHtmlForm($id."_colormap", $offset." ");
- }
- else
- {
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td colspan=\"2\">\n";
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addcolormap&id=".$this->id."\">ColorMap hinzufügen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- }
- $temp .= $offset." </table>\n";
-
-
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- $temp .= $offset."<br>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_opacity"]))
- {
- $this->opacity = $_REQUEST[$id."_opacity"];
- }
- if (isset($_REQUEST[$id."_colormap"]))
- {
- $this->colormap = new ColorMap();
- $this->colormap->generateObjectFromPost($id."_colormap");
- }
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/RasterSymbolizer.php (from rev 2404, branches/2.5/http/sld/classes/RasterSymbolizer.php)
===================================================================
--- trunk/mapbender/http/sld/classes/RasterSymbolizer.php (rev 0)
+++ trunk/mapbender/http/sld/classes/RasterSymbolizer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,160 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the RasterSymbolizer-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class RasterSymbolizer extends Rule
+{
+ /**
+ * The Opacity element from the xml-scheme.
+ * This element is not implemented as an object.
+ *
+ * @var string
+ */
+ var $opacity = "";
+
+ /**
+ * The ColorMap object from the xml-scheme.
+ *
+ * @see ColorMap
+ * @var object
+ */
+ var $colormap = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+
+ function RasterSymbolizer()
+ {
+ //$this->colormap = new ColorMap();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<RasterSymbolizer>\n";
+ if ($this->opacity != "") $temp .= $offset." <Opacity>".htmlspecialchars($this->opacity)."</Opacity>\n";
+ if ($this->colormap != "") $temp .= $this->colormap->generateXml($offset." ");
+ $temp .= $offset."</RasterSymbolizer>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black;width:100%\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 130px;\">\n";
+
+ $temp .= $offset." RasterSymbolizer<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"rastersymbolizer\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Opacity:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_opacity\" value=\"".htmlspecialchars($this->opacity)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ if ($this->colormap != "")
+ {
+ $temp .= $this->colormap->generateHtmlForm($id."_colormap", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td colspan=\"2\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addcolormap&id=".$this->id."\">ColorMap hinzufügen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ }
+ $temp .= $offset." </table>\n";
+
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_opacity"]))
+ {
+ $this->opacity = $_REQUEST[$id."_opacity"];
+ }
+ if (isset($_REQUEST[$id."_colormap"]))
+ {
+ $this->colormap = new ColorMap();
+ $this->colormap->generateObjectFromPost($id."_colormap");
+ }
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/Rule.php
===================================================================
--- branches/2.5/http/sld/classes/Rule.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/Rule.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,378 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the Rule-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class Rule extends FeatureTypeStyle
-{
- /**
- * The name attribute from the xml-scheme.
- * @var string
- */
- var $name = "";
-
- /**
- * The title attribute from the xml-scheme.
- * @var string
- */
- var $title = "";
-
- /**
- * The LegendGraphic element from the xml-scheme.
- * @see LegendGraphic
- * @var object
- */
- var $legendgraphic = "";
-
- /**
- * The complete filter expression.
- *
- * The parsing an editing of the filter expressions is not done in the main sld editor.
- * This field contains the complete filter expression without any parsing.
- * The parsing is done in sld_filter_parse.php using the classes in sld_filter_classes.php.
- * Editing is possible in sld_edit_filter.php. This page is opened in a popup-window.
- *
- * @see sld_filter_classes.php
- * @var string
- */
- var $filter = "";
-
- /**
- * The miscaledenominator attribute from the xml-scheme.
- * @var int
- */
- var $minscaledenominator = "";
-
- /**
- * The maxscaledenominator attribute from the xml-scheme.
- * @var int
- */
- var $maxscaledenominator = "";
-
- /**
- * Array containing the different symbolizers for this rule.
- * @var array
- */
- var $symbolizers = array();
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<Rule>\n";
- if ($this->name != "") $temp .= $offset." <Name>".htmlspecialchars($this->name)."</Name>\n";
- if ($this->title != "") $temp .= $offset." <Title>".htmlspecialchars($this->title)."</Title>\n";
- if ($this->legendgraphic != "") $temp .= $this->legendgraphic->generateXml($offset." ");
-
- if ($this->filter != "") $temp .= $offset." ".$this->filter."\n";
- if ($this->minscaledenominator != "") $temp .= $offset." <MinScaleDenominator>".htmlspecialchars($this->minscaledenominator)."</MinScaleDenominator>\n";
- if ($this->maxscaledenominator != "") $temp .= $offset." <MaxScaleDenominator>".htmlspecialchars($this->maxscaledenominator)."</MaxScaleDenominator>\n";
- foreach($this->symbolizers as $symbolizer)
- {
- $temp .= $symbolizer->generateXml($offset." ");
- }
- $temp .= $offset."</Rule>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<td rowspan=\"2\" valign='top'>\n";
-
- //Table in the first cell for the attributes of this rule
- ###### -----------> Fenster Rule Eigenschaften
- $temp .= $offset." <table class='edit_label_bg2' border=\"0\" cellspacing=\"2\" cellpadding=\"1\">\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text'>\n";
- $temp .= $offset." Rule:\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"rule\">\n";
- $temp .= $offset." </td>\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
-
- $temp .= $offset." <td>\n";
- $temp .= $offset." \n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text'>Name:</td>\n";
- $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_name\" value=\"".htmlspecialchars($this->name)."\"></td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text'>Title:</td>\n";
- $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_title\" value=\"".htmlspecialchars($this->title)."\"></td>\n";
- $temp .= $offset." </tr>\n";
-
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text'>";
- $temp .= $offset." Filter:";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."_filter\" value=\"".htmlspecialchars($this->filter)."\">\n";
- $temp .= $offset." <img src='./img/lightning.png' class='hand' border='0' alt='Filter bearbeiten'";
- $temp .= "onClick=\"window.open('sld_edit_filter.php?".$urlParameters."&sld_form_element_id=".$id."_filter&sld_objects_rule_id=".$this->id."','editFilter',";
- $temp .= " 'width=1000, height=800, resizable=yes');\">\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
-
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text'>Minscale:</td>\n";
- $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_minscale\" value=\"".$this->minscaledenominator."\"></td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td class='edit_label_bg edit_label_text'>Maxscale:</td>\n";
- $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_maxscale\" value=\"".$this->maxscaledenominator."\"></td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deleterule&id=".$this->parent."&number=".$number."\">\n";
- $temp .= $offset." <img src='./img/minus.gif' border='0' alt='Rule löschen'> löschen\n";
- $temp .= $offset." </a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." ";
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." </table>\n";
- //End Table in first cell
-
- $temp .= $offset."</td>\n";
- $temp .= $offset."<td>\n";
- $temp .= $offset."-\n";
- $temp .= $offset."</td>\n";
-
-
- $temp .= $offset."<td>\n";
- //Second cell for the symbolizers and the legendgraphic
- // Table1 in second cell
- $temp .= $offset."<table class='edit_label_bg2' border=\"0\" cellspacing=\"2\" cellpadding=\"1\">\n";
- $temp .= $offset."<tr>\n";
- ########### -----------> LEGENDGRAPHIC
- if ($this->legendgraphic != "")
- {
- $temp .= $offset."<td>\n";
- $temp .= $this->legendgraphic->generateHtmlForm($id."_legendgraphic", $offset." ");
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- }
- else
- {
- $temp .= $offset."<td class='edit_label_bg edit_label_text' width='136'>\n";
- $temp .= $offset."LegendGraphic:\n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."<td>\n";
- $temp .= $offset." \n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset."<td>\n";
- $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addlegendgraphic&id=".$this->id."\">\n";
- $temp .= $offset."<img src='./img/plus.gif' border='0' alt='LegendGraphic hinzufügen'> hinzufügen</a>\n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."<td>\n";
- $temp .= $offset." \n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- }
- $temp .= $offset."</table>\n";
- //End Table1 in second cell
-
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
-
- $temp .= $offset."<tr>\n";
- $temp .= $offset."<td>\n";
- $temp .= $offset."-\n";
- $temp .= $offset."</td>\n";
-
- $temp .= $offset."<td>\n";
-
- // Table in second cell
- $temp .= $offset."<table class='edit_label_bg2' border=\"0\" cellspacing=\"2\" cellpadding=\"1\">\n";
- ########### -----------> SYMBOLIZER
- $temp .= $offset."<tr>\n";
- $temp .= $offset."<td class='edit_label_bg edit_label_text' valign='top'>\n";
- $temp .= $offset." <select class=\"edit_label_text\" name=\"".$id."_newsymbolizer\">\n";
- $temp .= $offset." <option value=\"textsymbolizer\">Textsymbolizer</option>\n";
- $temp .= $offset." <option value=\"polygonsymbolizer\">Polygonsymbolizer</option>\n";
- $temp .= $offset." <option value=\"pointsymbolizer\">Pointsymbolizer</option>\n";
- $temp .= $offset." <option value=\"rastersymbolizer\">Rastersymbolizer</option>\n";
- $temp .= $offset." <option value=\"linesymbolizer\">Linesymbolizer</option>\n";
- $temp .= $offset." </select>\n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset."<td>\n";
- $symbolizer_id = 0;
- foreach ($this->symbolizers as $symbolizer)
- {
- $temp .= $symbolizer->generateHtmlForm($id."_symbolizer_".$symbolizer_id, $offset." ");
- $symbolizer_id++;
- }
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."<tr>\n";
- $temp .= $offset."<td valign='bottom'>\n";
- $temp .= $offset."<input class=\"edit\" type=\"button\" value=\"hinzufügen\"";
- //Javascript to make a http request
- $temp .= " onClick=\"url='sld_function_handler.php?function=addsymbolizer&id=".$this->id."&symbolizer=';";
- $temp .= " url += ".$id."_newsymbolizer.value;";
- $temp .= " location.href = url;\"";
- $temp .= ">\n";
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- $temp .= $offset."</table>\n";
- //End Table in second cell
-
- $temp .= $offset."</td>\n";
- $temp .= $offset."</tr>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $this->name = $_REQUEST[$id."_name"];
- $this->title = $_REQUEST[$id."_title"];
-
- $this->filter = $_REQUEST[$id."_filter"];
-
- $this->minscaledenominator = $_REQUEST[$id."_minscale"];
- $this->maxscaledenominator = $_REQUEST[$id."_maxscale"];
- if (isset($_REQUEST[$id."_legendgraphic"]))
- {
- $this->legendgraphic = new LegendGraphic();
- $this->legendgraphic->generateObjectFromPost($id."_legendgraphic");
- }
- $countSymbolizers = 0;
- while (isset($_REQUEST[$id."_symbolizer_".$countSymbolizers]))
- {
- $symbolizer = "";
- if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "linesymbolizer")
- {
- $symbolizer = new LineSymbolizer();
- }
- else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "polygonsymbolizer")
- {
- $symbolizer = new PolygonSymbolizer();
- }
- else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "pointsymbolizer")
- {
- $symbolizer = new PointSymbolizer();
- }
- else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "textsymbolizer")
- {
- $symbolizer = new TextSymbolizer();
- }
- else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "rastersymbolizer")
- {
- $symbolizer = new RasterSymbolizer();
- }
-
- $symbolizer->generateObjectFromPost($id."_symbolizer_".$countSymbolizers);
- $this->symbolizers[] = $symbolizer;
- $countSymbolizers++;
- }
- }
-
- /**
- * Function that adds a symbolizer to the symbolizers array.
- *
- * This function is called from sld_function_handler.php
- *
- * @param string $symbolizer string containing the type of the symbolizer that has to be added
- */
- function addSymbolizer($symbolizer)
- {
- if ($symbolizer == "linesymbolizer")
- {
- $this->symbolizers[] = new LineSymbolizer();
- }
- else if ($symbolizer == "textsymbolizer")
- {
- $this->symbolizers[] = new TextSymbolizer();
- }
- else if ($symbolizer == "polygonsymbolizer")
- {
- $this->symbolizers[] = new PolygonSymbolizer();
- }
- else if ($symbolizer == "rastersymbolizer")
- {
- $this->symbolizers[] = new RasterSymbolizer();
- }
- else if ($symbolizer == "pointsymbolizer")
- {
- $this->symbolizers[] = new PointSymbolizer();
- }
- }
-
- /**
- * Deletes the symbolizer at the given index from the symbolizers array.
- *
- * This function is called from sld_function_handler.php
- *
- * @param int $index index of the symbolizer that should be deleted.
- */
- function deleteSymbolizer($index)
- {
- array_splice($this->symbolizers, $index, 1);
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/Rule.php (from rev 2404, branches/2.5/http/sld/classes/Rule.php)
===================================================================
--- trunk/mapbender/http/sld/classes/Rule.php (rev 0)
+++ trunk/mapbender/http/sld/classes/Rule.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,378 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the Rule-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Rule extends FeatureTypeStyle
+{
+ /**
+ * The name attribute from the xml-scheme.
+ * @var string
+ */
+ var $name = "";
+
+ /**
+ * The title attribute from the xml-scheme.
+ * @var string
+ */
+ var $title = "";
+
+ /**
+ * The LegendGraphic element from the xml-scheme.
+ * @see LegendGraphic
+ * @var object
+ */
+ var $legendgraphic = "";
+
+ /**
+ * The complete filter expression.
+ *
+ * The parsing an editing of the filter expressions is not done in the main sld editor.
+ * This field contains the complete filter expression without any parsing.
+ * The parsing is done in sld_filter_parse.php using the classes in sld_filter_classes.php.
+ * Editing is possible in sld_edit_filter.php. This page is opened in a popup-window.
+ *
+ * @see sld_filter_classes.php
+ * @var string
+ */
+ var $filter = "";
+
+ /**
+ * The miscaledenominator attribute from the xml-scheme.
+ * @var int
+ */
+ var $minscaledenominator = "";
+
+ /**
+ * The maxscaledenominator attribute from the xml-scheme.
+ * @var int
+ */
+ var $maxscaledenominator = "";
+
+ /**
+ * Array containing the different symbolizers for this rule.
+ * @var array
+ */
+ var $symbolizers = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Rule>\n";
+ if ($this->name != "") $temp .= $offset." <Name>".htmlspecialchars($this->name)."</Name>\n";
+ if ($this->title != "") $temp .= $offset." <Title>".htmlspecialchars($this->title)."</Title>\n";
+ if ($this->legendgraphic != "") $temp .= $this->legendgraphic->generateXml($offset." ");
+
+ if ($this->filter != "") $temp .= $offset." ".$this->filter."\n";
+ if ($this->minscaledenominator != "") $temp .= $offset." <MinScaleDenominator>".htmlspecialchars($this->minscaledenominator)."</MinScaleDenominator>\n";
+ if ($this->maxscaledenominator != "") $temp .= $offset." <MaxScaleDenominator>".htmlspecialchars($this->maxscaledenominator)."</MaxScaleDenominator>\n";
+ foreach($this->symbolizers as $symbolizer)
+ {
+ $temp .= $symbolizer->generateXml($offset." ");
+ }
+ $temp .= $offset."</Rule>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<td rowspan=\"2\" valign='top'>\n";
+
+ //Table in the first cell for the attributes of this rule
+ ###### -----------> Fenster Rule Eigenschaften
+ $temp .= $offset." <table class='edit_label_bg2' border=\"0\" cellspacing=\"2\" cellpadding=\"1\">\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>\n";
+ $temp .= $offset." Rule:\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"rule\">\n";
+ $temp .= $offset." </td>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>Name:</td>\n";
+ $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_name\" value=\"".htmlspecialchars($this->name)."\"></td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>Title:</td>\n";
+ $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_title\" value=\"".htmlspecialchars($this->title)."\"></td>\n";
+ $temp .= $offset." </tr>\n";
+
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>";
+ $temp .= $offset." Filter:";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_filter\" value=\"".htmlspecialchars($this->filter)."\">\n";
+ $temp .= $offset." <img src='./img/lightning.png' class='hand' border='0' alt='Filter bearbeiten'";
+ $temp .= "onClick=\"window.open('sld_edit_filter.php?".$urlParameters."&sld_form_element_id=".$id."_filter&sld_objects_rule_id=".$this->id."','editFilter',";
+ $temp .= " 'width=1000, height=800, resizable=yes');\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>Minscale:</td>\n";
+ $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_minscale\" value=\"".$this->minscaledenominator."\"></td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>Maxscale:</td>\n";
+ $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_maxscale\" value=\"".$this->maxscaledenominator."\"></td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deleterule&id=".$this->parent."&number=".$number."\">\n";
+ $temp .= $offset." <img src='./img/minus.gif' border='0' alt='Rule löschen'> löschen\n";
+ $temp .= $offset." </a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." ";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+ //End Table in first cell
+
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."-\n";
+ $temp .= $offset."</td>\n";
+
+
+ $temp .= $offset."<td>\n";
+ //Second cell for the symbolizers and the legendgraphic
+ // Table1 in second cell
+ $temp .= $offset."<table class='edit_label_bg2' border=\"0\" cellspacing=\"2\" cellpadding=\"1\">\n";
+ $temp .= $offset."<tr>\n";
+ ########### -----------> LEGENDGRAPHIC
+ if ($this->legendgraphic != "")
+ {
+ $temp .= $offset."<td>\n";
+ $temp .= $this->legendgraphic->generateHtmlForm($id."_legendgraphic", $offset." ");
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+ else
+ {
+ $temp .= $offset."<td class='edit_label_bg edit_label_text' width='136'>\n";
+ $temp .= $offset."LegendGraphic:\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addlegendgraphic&id=".$this->id."\">\n";
+ $temp .= $offset."<img src='./img/plus.gif' border='0' alt='LegendGraphic hinzufügen'> hinzufügen</a>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+ $temp .= $offset."</table>\n";
+ //End Table1 in second cell
+
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."-\n";
+ $temp .= $offset."</td>\n";
+
+ $temp .= $offset."<td>\n";
+
+ // Table in second cell
+ $temp .= $offset."<table class='edit_label_bg2' border=\"0\" cellspacing=\"2\" cellpadding=\"1\">\n";
+ ########### -----------> SYMBOLIZER
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td class='edit_label_bg edit_label_text' valign='top'>\n";
+ $temp .= $offset." <select class=\"edit_label_text\" name=\"".$id."_newsymbolizer\">\n";
+ $temp .= $offset." <option value=\"textsymbolizer\">Textsymbolizer</option>\n";
+ $temp .= $offset." <option value=\"polygonsymbolizer\">Polygonsymbolizer</option>\n";
+ $temp .= $offset." <option value=\"pointsymbolizer\">Pointsymbolizer</option>\n";
+ $temp .= $offset." <option value=\"rastersymbolizer\">Rastersymbolizer</option>\n";
+ $temp .= $offset." <option value=\"linesymbolizer\">Linesymbolizer</option>\n";
+ $temp .= $offset." </select>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td>\n";
+ $symbolizer_id = 0;
+ foreach ($this->symbolizers as $symbolizer)
+ {
+ $temp .= $symbolizer->generateHtmlForm($id."_symbolizer_".$symbolizer_id, $offset." ");
+ $symbolizer_id++;
+ }
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td valign='bottom'>\n";
+ $temp .= $offset."<input class=\"edit\" type=\"button\" value=\"hinzufügen\"";
+ //Javascript to make a http request
+ $temp .= " onClick=\"url='sld_function_handler.php?function=addsymbolizer&id=".$this->id."&symbolizer=';";
+ $temp .= " url += ".$id."_newsymbolizer.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."</table>\n";
+ //End Table in second cell
+
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ $this->title = $_REQUEST[$id."_title"];
+
+ $this->filter = $_REQUEST[$id."_filter"];
+
+ $this->minscaledenominator = $_REQUEST[$id."_minscale"];
+ $this->maxscaledenominator = $_REQUEST[$id."_maxscale"];
+ if (isset($_REQUEST[$id."_legendgraphic"]))
+ {
+ $this->legendgraphic = new LegendGraphic();
+ $this->legendgraphic->generateObjectFromPost($id."_legendgraphic");
+ }
+ $countSymbolizers = 0;
+ while (isset($_REQUEST[$id."_symbolizer_".$countSymbolizers]))
+ {
+ $symbolizer = "";
+ if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "linesymbolizer")
+ {
+ $symbolizer = new LineSymbolizer();
+ }
+ else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "polygonsymbolizer")
+ {
+ $symbolizer = new PolygonSymbolizer();
+ }
+ else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "pointsymbolizer")
+ {
+ $symbolizer = new PointSymbolizer();
+ }
+ else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "textsymbolizer")
+ {
+ $symbolizer = new TextSymbolizer();
+ }
+ else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "rastersymbolizer")
+ {
+ $symbolizer = new RasterSymbolizer();
+ }
+
+ $symbolizer->generateObjectFromPost($id."_symbolizer_".$countSymbolizers);
+ $this->symbolizers[] = $symbolizer;
+ $countSymbolizers++;
+ }
+ }
+
+ /**
+ * Function that adds a symbolizer to the symbolizers array.
+ *
+ * This function is called from sld_function_handler.php
+ *
+ * @param string $symbolizer string containing the type of the symbolizer that has to be added
+ */
+ function addSymbolizer($symbolizer)
+ {
+ if ($symbolizer == "linesymbolizer")
+ {
+ $this->symbolizers[] = new LineSymbolizer();
+ }
+ else if ($symbolizer == "textsymbolizer")
+ {
+ $this->symbolizers[] = new TextSymbolizer();
+ }
+ else if ($symbolizer == "polygonsymbolizer")
+ {
+ $this->symbolizers[] = new PolygonSymbolizer();
+ }
+ else if ($symbolizer == "rastersymbolizer")
+ {
+ $this->symbolizers[] = new RasterSymbolizer();
+ }
+ else if ($symbolizer == "pointsymbolizer")
+ {
+ $this->symbolizers[] = new PointSymbolizer();
+ }
+ }
+
+ /**
+ * Deletes the symbolizer at the given index from the symbolizers array.
+ *
+ * This function is called from sld_function_handler.php
+ *
+ * @param int $index index of the symbolizer that should be deleted.
+ */
+ function deleteSymbolizer($index)
+ {
+ array_splice($this->symbolizers, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/Stroke.php
===================================================================
--- branches/2.5/http/sld/classes/Stroke.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/Stroke.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,202 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the Stroke-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class Stroke
-{
- //choice
- //GraphicFill and GraphicStroke are not supported by Mapserver
- //var $graphicfill = "";
- //var $graphicstroke = "";
- //end choice
-
- /**
- * Array containing the CssParameter objects from the xml-scheme.
- *
- * @see CssParameter
- * @var array
- */
- var $cssparameters = array();
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<Stroke>\n";
- //if ($this->graphicfill != "") $temp .= $this->graphicfill->generateXml($offset." ");
- //if ($this->graphicstroke != "") $temp .= $this->graphicstroke->generateXml($offset." ");
- foreach ($this->cssparameters as $cssparameter)
- {
- $temp .= $cssparameter->generateXml($offset." ");
- }
- $temp .= $offset."</Stroke>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = $offset."<hr class=\"sep\">\n";
- $temp .= $offset."<table>\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td style=\"width: 100px;\">\n";
- $temp .= $offset." Stroke<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"stroke\">\n";
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletestroke&id=".$this->parent."\">löschen</a>\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td valign=\"top\">\n";
-
-// if ($this->graphicfill == "" && $this->graphicstroke == "")
-// {
-// //Add new Graphicfill or Graphicstroke TODO!!!
-// $temp .= $offset."<select name=\"".$id."_newgraphicfillorgraphicstroke\">\n";
-// $temp .= $offset."<option value=\"graphicfill\">GraphicFill</option>\n";
-// $temp .= $offset."<option value=\"graphicstroke\">GraphicStroke</option>\n";
-// $temp .= $offset."</select>\n";
-// $temp .= $offset."<input type=\"button\" value=\"GraphicFill oder GraphicStroke hinzufügen\"";
-// $temp .= $offset." onClick=\"url='sld_function_handler.php?function=addgraphicfillorgraphicstroke&id=".$id."&graphicfillorgraphicstroke=';";
-// $temp .= $offset." url += ".$id."_newgraphicfillorgraphicstroke.value;";
-// $temp .= $offset." location.href = url;\"";
-// $temp .= $offset."><br>\n";
-// }
-// else if ($this->graphicfill != "")
-// {
-// $this->graphicfill->generateHtmlForm($id."_graphicfill");
-// }
-// else if ($this->graphicstroke != "")
-// {
-// $this->graphicstroke->generateHtmlForm($id."_graphicstroke");
-// }
-
-
- $cssparameter_id = 0;
- foreach ($this->cssparameters as $cssparameter)
- {
- $temp .= $cssparameter->generateHtmlForm($id."_cssparameter_".$cssparameter_id, $offset." ");
- $cssparameter_id++;
- }
-
-
- $temp .= $offset." <select name=\"".$id."_newcssparameter\">\n";
- //Some of the options are not supported by Mapserver
- $temp .= $offset." <option value=\"stroke\">stroke</option>\n";
- $temp .= $offset." <option value=\"stroke-width\">stroke-width</option>\n";
- $temp .= $offset." <option value=\"stroke-dasharray\">stroke-dasharray</option>\n";
- $temp .= $offset." </select>\n";
-
-
- $temp .= $offset." <input type=\"button\" value=\"hinzufügen\"";
- //Javascript to make a http request
- $temp .= " onClick=\"url='sld_function_handler.php?function=addcssparameter&id=".$this->id."&cssparameter=';";
- $temp .= " url += ".$id."_newcssparameter.value;";
- $temp .= " location.href = url;\"";
- $temp .= ">\n";
-
-
-
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
-// if (isset($_REQUEST[$id."_graphicfill"]))
-// {
-// $this->graphicfill = new GraphicFill();
-// $this->graphicfill->generateObjectFromPost($id."_graphicfill");
-// }
-// if (isset($_REQUEST[$id."_graphicstroke"]))
-// {
-// $this->graphicstroke = new GraphicStroke();
-// $this->graphicstroke->generateObjectFromPost($id."_graphicstroke");
-// }
- $countCssParameters = 0;
- while (isset($_REQUEST[$id."_cssparameter_".$countCssParameters]))
- {
- $cssParameter = new CssParameter();
- $cssParameter->generateObjectFromPost($id."_cssparameter_".$countCssParameters);
- $this->cssparameters[] = $cssParameter;
- $countCssParameters++;
- }
- }
-
- /**
- * Adds a new CssParameter to the array.
- * @param string $cssParameter name attribute of the CssParameter that has to be created.
- */
- function addCssParameter($cssParameter)
- {
- $newCssParameter = new CssParameter();
- $newCssParameter->name = $cssParameter;
- $this->cssparameters[] = $newCssParameter;
- }
-
- /**
- * Deletes a CssParameter from the array at the given index.
- * @param int $index index of the CssParameter that has to be deleted.
- */
- function deleteCssParameter($index)
- {
- array_splice($this->cssparameters, $index, 1);
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/Stroke.php (from rev 2404, branches/2.5/http/sld/classes/Stroke.php)
===================================================================
--- trunk/mapbender/http/sld/classes/Stroke.php (rev 0)
+++ trunk/mapbender/http/sld/classes/Stroke.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,202 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the Stroke-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Stroke
+{
+ //choice
+ //GraphicFill and GraphicStroke are not supported by Mapserver
+ //var $graphicfill = "";
+ //var $graphicstroke = "";
+ //end choice
+
+ /**
+ * Array containing the CssParameter objects from the xml-scheme.
+ *
+ * @see CssParameter
+ * @var array
+ */
+ var $cssparameters = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Stroke>\n";
+ //if ($this->graphicfill != "") $temp .= $this->graphicfill->generateXml($offset." ");
+ //if ($this->graphicstroke != "") $temp .= $this->graphicstroke->generateXml($offset." ");
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateXml($offset." ");
+ }
+ $temp .= $offset."</Stroke>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = $offset."<hr class=\"sep\">\n";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Stroke<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"stroke\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletestroke&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td valign=\"top\">\n";
+
+// if ($this->graphicfill == "" && $this->graphicstroke == "")
+// {
+// //Add new Graphicfill or Graphicstroke TODO!!!
+// $temp .= $offset."<select name=\"".$id."_newgraphicfillorgraphicstroke\">\n";
+// $temp .= $offset."<option value=\"graphicfill\">GraphicFill</option>\n";
+// $temp .= $offset."<option value=\"graphicstroke\">GraphicStroke</option>\n";
+// $temp .= $offset."</select>\n";
+// $temp .= $offset."<input type=\"button\" value=\"GraphicFill oder GraphicStroke hinzufügen\"";
+// $temp .= $offset." onClick=\"url='sld_function_handler.php?function=addgraphicfillorgraphicstroke&id=".$id."&graphicfillorgraphicstroke=';";
+// $temp .= $offset." url += ".$id."_newgraphicfillorgraphicstroke.value;";
+// $temp .= $offset." location.href = url;\"";
+// $temp .= $offset."><br>\n";
+// }
+// else if ($this->graphicfill != "")
+// {
+// $this->graphicfill->generateHtmlForm($id."_graphicfill");
+// }
+// else if ($this->graphicstroke != "")
+// {
+// $this->graphicstroke->generateHtmlForm($id."_graphicstroke");
+// }
+
+
+ $cssparameter_id = 0;
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateHtmlForm($id."_cssparameter_".$cssparameter_id, $offset." ");
+ $cssparameter_id++;
+ }
+
+
+ $temp .= $offset." <select name=\"".$id."_newcssparameter\">\n";
+ //Some of the options are not supported by Mapserver
+ $temp .= $offset." <option value=\"stroke\">stroke</option>\n";
+ $temp .= $offset." <option value=\"stroke-width\">stroke-width</option>\n";
+ $temp .= $offset." <option value=\"stroke-dasharray\">stroke-dasharray</option>\n";
+ $temp .= $offset." </select>\n";
+
+
+ $temp .= $offset." <input type=\"button\" value=\"hinzufügen\"";
+ //Javascript to make a http request
+ $temp .= " onClick=\"url='sld_function_handler.php?function=addcssparameter&id=".$this->id."&cssparameter=';";
+ $temp .= " url += ".$id."_newcssparameter.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">\n";
+
+
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+// if (isset($_REQUEST[$id."_graphicfill"]))
+// {
+// $this->graphicfill = new GraphicFill();
+// $this->graphicfill->generateObjectFromPost($id."_graphicfill");
+// }
+// if (isset($_REQUEST[$id."_graphicstroke"]))
+// {
+// $this->graphicstroke = new GraphicStroke();
+// $this->graphicstroke->generateObjectFromPost($id."_graphicstroke");
+// }
+ $countCssParameters = 0;
+ while (isset($_REQUEST[$id."_cssparameter_".$countCssParameters]))
+ {
+ $cssParameter = new CssParameter();
+ $cssParameter->generateObjectFromPost($id."_cssparameter_".$countCssParameters);
+ $this->cssparameters[] = $cssParameter;
+ $countCssParameters++;
+ }
+ }
+
+ /**
+ * Adds a new CssParameter to the array.
+ * @param string $cssParameter name attribute of the CssParameter that has to be created.
+ */
+ function addCssParameter($cssParameter)
+ {
+ $newCssParameter = new CssParameter();
+ $newCssParameter->name = $cssParameter;
+ $this->cssparameters[] = $newCssParameter;
+ }
+
+ /**
+ * Deletes a CssParameter from the array at the given index.
+ * @param int $index index of the CssParameter that has to be deleted.
+ */
+ function deleteCssParameter($index)
+ {
+ array_splice($this->cssparameters, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/StyledLayerDescriptor.php
===================================================================
--- branches/2.5/http/sld/classes/StyledLayerDescriptor.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/StyledLayerDescriptor.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,212 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * This file contains the class definitions for the sld-editor.
- *
- * This class is the implementation of the StyledLayerDescriptor-element of the sld-xml-scheme.
- * This element builds up the root of every sld-document.
- * This class is directly referred to in the sld_main.php.
- *
- * @package sld_classes
- * @author Markus Krzyzanowski, Design for all HTML-output by Bao Ngan
- */
-class StyledLayerDescriptor
-{
- /**
- * The name attribute from the xml-scheme.
- * @var string
- */
- var $name = "";
- /**
- * The title attribute from the xml-scheme.
- * @var string
- */
- var $title = "";
- /**
- * The abstract attribute from the xml-scheme.
- * @var string
- */
- var $abstract = "";
- /**
- * Array containing the layers of the sld.
- * @see NamedLayer
- * @var array
- */
- var $layers = array();
- /**
- * The version attribute from the xml-scheme.
- * @var string
- */
- var $version = "";
-
- /**
- * Index of this object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
- /**
- * Index of this object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * Generates the sld-document as an xml-string and returns it.
- *
- * Calls the generateXml-function of its child objects.
- * This object only has layers as childs, all other child-elements of
- * StyledLayerDescriptor are modelled as primitive datatypes
- *
- * @param string $offset string that should be added at the beginning
- * of every line of xml that is being created. Should only contain
- * a number of whitespaces to format the output and provide a
- * good readability.
- *
- * @return string the created sld-document
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<StyledLayerDescriptor";
- if ($this->version != "") $temp .= " version=\"".htmlspecialchars($this->version)."\"";
- $temp .= " xsi:schemaLocation=\"http://www.opengis.net/sld StyledLayerDescriptor.xsd\"";
- $temp .= " xmlns=\"http://www.opengis.net/sld\"";
- $temp .= " xmlns:ogc=\"http://www.opengis.net/ogc\"";
- $temp .= " xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
- $temp .= " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
- $temp .= ">\n";
- if ($this->name != "") $temp .= $offset." <Name>".htmlspecialchars($this->name)."</Name>\n";
- if ($this->title != "") $temp .= $offset." <Title>".htmlspecialchars($this->title)."</Title>\n";
- if ($this->abstract != "") $temp .= $offset." <Abstract>".htmlspecialchars($this->abstract)."</Abstract>\n";
-
-
- foreach($this->layers as $layer)
- {
- $temp .= $layer->generateXml($offset." ");
- }
- $temp .= $offset."</StyledLayerDescriptor>\n";
- return $temp;
- }
-
-
- /**
- * Generates a html-form-fragment
- * that contains form-elements (e.g. input) for every member of this class.
- * Some of these are hidden fields and so they are not editable by the user.
- * The reason for this is that some values should not be changed (such as the layer name)
- * or they are to complicated for end-users that are not familiar to the sld-xml-scheme.
- *
- * Calls the generateHtmlForm-function of its child objects.
- *
- * @param string $id string identifying the form-elements belonging to this object
- * @param string $offset string for formatting the output
- * @return string the created html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- //Commented out, because these options should not be changed by the end user
- //$temp .= $offset."<table style=\"border: 1px solid black\">\n";
- //$temp .= $offset."<tr>\n";
- //$temp .= $offset."<td>Name:</td>\n";
- //$temp .= $offset."<td><input name=\"name\" value=\"".$this->name."\"></td>\n";
- //$temp .= $offset."</tr>\n";
- //$temp .= $offset."<tr>\n";
- //$temp .= $offset."<td>Title:</td>\n";
- //$temp .= $offset."<td><input name=\"title\" value=\"".$this->title."\"></td>\n";
- //$temp .= $offset."</tr>\n";
- //$temp .= $offset."<tr>\n";
- //$temp .= $offset."<td>Abstract:</td>\n";
- //$temp .= $offset."<td><input name=\"abstract\" value=\"".$this->abstract."\"></td>\n";
- //$temp .= $offset."</tr>\n";
- //$temp .= $offset."<tr>\n";
- //$temp .= $offset."<td>Version:</td>\n";
- //$temp .= $offset."<td><input name=\"version\" value=\"".$this->version."\"></td>\n";
- //$temp .= $offset."</tr>\n";
- //$temp .= $offset."</table>\n";
- //$temp .= $offset."<br>\n";
-
- //Hidden fields to hold the values
- $temp .= $offset."<input type=\"hidden\" name=\"name\" value=\"".htmlspecialchars($this->name)."\">\n";
- $temp .= $offset."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($this->title)."\">\n";
- $temp .= $offset."<input type=\"hidden\" name=\"abstract\" value=\"".htmlspecialchars($this->abstract)."\">\n";
- $temp .= $offset."<input type=\"hidden\" name=\"version\" value=\"".htmlspecialchars($this->version)."\">\n";
-
- $layer_id = 0;
- foreach ($this->layers as $layer)
- {
- $temp .= $layer->generateHtmlForm("layer_".$layer_id, $offset." ");
- $layer_id++;
- }
- return $temp;
- }
-
- /**
- * Populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- * this parameter has no use for this object, because it is only called without a value
- * in other classes this parameter should have the same value, that was used in
- * generateHtmlForm(...) for the $id to create the html-form
- *
- */
- function generateObjectFromPost($id = "")
- {
- $this->version = $_REQUEST[$id."version"];
- $this->name = $_REQUEST[$id."name"];
- $this->title = $_REQUEST[$id."title"];
- $this->abstract = $_REQUEST[$id."abstract"];
- $countLayers = 0;
- while (isset($_REQUEST[$id."layer_".$countLayers]))
- {
- if ($_REQUEST[$id."layer_".$countLayers] == "namedlayer")
- {
- $layer = new NamedLayer();
- }
- else
- {
- //Todo evtl: userlayer erstellen
- $layer = new NamedLayer();
- }
- $layer->generateObjectFromPost($id."layer_".$countLayers);
- $this->layers[] = $layer;
- $countLayers++;
- }
- }
-}
-
-/**
- * Loads classes by name
- *
- * If the php interpreter finds a class that is needed in a module or class
- * and it is not yet included via include, then it tries to load this class
- * with the given name in the current context. No need for includes ...
- *
- * @param string $class_name
- */
-function __autoload($class_name) {
- if (file_exists(dirname(__FILE__). "/{$class_name}.php"))
- require_once $class_name . '.php';
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/StyledLayerDescriptor.php (from rev 2404, branches/2.5/http/sld/classes/StyledLayerDescriptor.php)
===================================================================
--- trunk/mapbender/http/sld/classes/StyledLayerDescriptor.php (rev 0)
+++ trunk/mapbender/http/sld/classes/StyledLayerDescriptor.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,212 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * This file contains the class definitions for the sld-editor.
+ *
+ * This class is the implementation of the StyledLayerDescriptor-element of the sld-xml-scheme.
+ * This element builds up the root of every sld-document.
+ * This class is directly referred to in the sld_main.php.
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski, Design for all HTML-output by Bao Ngan
+ */
+class StyledLayerDescriptor
+{
+ /**
+ * The name attribute from the xml-scheme.
+ * @var string
+ */
+ var $name = "";
+ /**
+ * The title attribute from the xml-scheme.
+ * @var string
+ */
+ var $title = "";
+ /**
+ * The abstract attribute from the xml-scheme.
+ * @var string
+ */
+ var $abstract = "";
+ /**
+ * Array containing the layers of the sld.
+ * @see NamedLayer
+ * @var array
+ */
+ var $layers = array();
+ /**
+ * The version attribute from the xml-scheme.
+ * @var string
+ */
+ var $version = "";
+
+ /**
+ * Index of this object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Generates the sld-document as an xml-string and returns it.
+ *
+ * Calls the generateXml-function of its child objects.
+ * This object only has layers as childs, all other child-elements of
+ * StyledLayerDescriptor are modelled as primitive datatypes
+ *
+ * @param string $offset string that should be added at the beginning
+ * of every line of xml that is being created. Should only contain
+ * a number of whitespaces to format the output and provide a
+ * good readability.
+ *
+ * @return string the created sld-document
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<StyledLayerDescriptor";
+ if ($this->version != "") $temp .= " version=\"".htmlspecialchars($this->version)."\"";
+ $temp .= " xsi:schemaLocation=\"http://www.opengis.net/sld StyledLayerDescriptor.xsd\"";
+ $temp .= " xmlns=\"http://www.opengis.net/sld\"";
+ $temp .= " xmlns:ogc=\"http://www.opengis.net/ogc\"";
+ $temp .= " xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
+ $temp .= " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
+ $temp .= ">\n";
+ if ($this->name != "") $temp .= $offset." <Name>".htmlspecialchars($this->name)."</Name>\n";
+ if ($this->title != "") $temp .= $offset." <Title>".htmlspecialchars($this->title)."</Title>\n";
+ if ($this->abstract != "") $temp .= $offset." <Abstract>".htmlspecialchars($this->abstract)."</Abstract>\n";
+
+
+ foreach($this->layers as $layer)
+ {
+ $temp .= $layer->generateXml($offset." ");
+ }
+ $temp .= $offset."</StyledLayerDescriptor>\n";
+ return $temp;
+ }
+
+
+ /**
+ * Generates a html-form-fragment
+ * that contains form-elements (e.g. input) for every member of this class.
+ * Some of these are hidden fields and so they are not editable by the user.
+ * The reason for this is that some values should not be changed (such as the layer name)
+ * or they are to complicated for end-users that are not familiar to the sld-xml-scheme.
+ *
+ * Calls the generateHtmlForm-function of its child objects.
+ *
+ * @param string $id string identifying the form-elements belonging to this object
+ * @param string $offset string for formatting the output
+ * @return string the created html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ //Commented out, because these options should not be changed by the end user
+ //$temp .= $offset."<table style=\"border: 1px solid black\">\n";
+ //$temp .= $offset."<tr>\n";
+ //$temp .= $offset."<td>Name:</td>\n";
+ //$temp .= $offset."<td><input name=\"name\" value=\"".$this->name."\"></td>\n";
+ //$temp .= $offset."</tr>\n";
+ //$temp .= $offset."<tr>\n";
+ //$temp .= $offset."<td>Title:</td>\n";
+ //$temp .= $offset."<td><input name=\"title\" value=\"".$this->title."\"></td>\n";
+ //$temp .= $offset."</tr>\n";
+ //$temp .= $offset."<tr>\n";
+ //$temp .= $offset."<td>Abstract:</td>\n";
+ //$temp .= $offset."<td><input name=\"abstract\" value=\"".$this->abstract."\"></td>\n";
+ //$temp .= $offset."</tr>\n";
+ //$temp .= $offset."<tr>\n";
+ //$temp .= $offset."<td>Version:</td>\n";
+ //$temp .= $offset."<td><input name=\"version\" value=\"".$this->version."\"></td>\n";
+ //$temp .= $offset."</tr>\n";
+ //$temp .= $offset."</table>\n";
+ //$temp .= $offset."<br>\n";
+
+ //Hidden fields to hold the values
+ $temp .= $offset."<input type=\"hidden\" name=\"name\" value=\"".htmlspecialchars($this->name)."\">\n";
+ $temp .= $offset."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($this->title)."\">\n";
+ $temp .= $offset."<input type=\"hidden\" name=\"abstract\" value=\"".htmlspecialchars($this->abstract)."\">\n";
+ $temp .= $offset."<input type=\"hidden\" name=\"version\" value=\"".htmlspecialchars($this->version)."\">\n";
+
+ $layer_id = 0;
+ foreach ($this->layers as $layer)
+ {
+ $temp .= $layer->generateHtmlForm("layer_".$layer_id, $offset." ");
+ $layer_id++;
+ }
+ return $temp;
+ }
+
+ /**
+ * Populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ * this parameter has no use for this object, because it is only called without a value
+ * in other classes this parameter should have the same value, that was used in
+ * generateHtmlForm(...) for the $id to create the html-form
+ *
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->version = $_REQUEST[$id."version"];
+ $this->name = $_REQUEST[$id."name"];
+ $this->title = $_REQUEST[$id."title"];
+ $this->abstract = $_REQUEST[$id."abstract"];
+ $countLayers = 0;
+ while (isset($_REQUEST[$id."layer_".$countLayers]))
+ {
+ if ($_REQUEST[$id."layer_".$countLayers] == "namedlayer")
+ {
+ $layer = new NamedLayer();
+ }
+ else
+ {
+ //Todo evtl: userlayer erstellen
+ $layer = new NamedLayer();
+ }
+ $layer->generateObjectFromPost($id."layer_".$countLayers);
+ $this->layers[] = $layer;
+ $countLayers++;
+ }
+ }
+}
+
+/**
+ * Loads classes by name
+ *
+ * If the php interpreter finds a class that is needed in a module or class
+ * and it is not yet included via include, then it tries to load this class
+ * with the given name in the current context. No need for includes ...
+ *
+ * @param string $class_name
+ */
+function __autoload($class_name) {
+ if (file_exists(dirname(__FILE__). "/{$class_name}.php"))
+ require_once $class_name . '.php';
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/TextSymbolizer.php
===================================================================
--- branches/2.5/http/sld/classes/TextSymbolizer.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/TextSymbolizer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,224 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the TextSymbolizer-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class TextSymbolizer extends Rule
-{
- /**
- * The Label element from the xml-scheme.
- * This element is not implemented as an object.
- * Although it is an object, we'll use a workaround ...
- * <Label>Townname: <ogc:PropertyValue>NAME</ogc:PropertyValue></Label> should be possible
- *
- * @var object
- */
- var $label = "";
-
- /**
- * The Font object from the xml-scheme.
- *
- * @see Font
- * @var object
- */
- var $font = "";
-
- /**
- * The Labelplacement object from the xml-scheme.
- *
- * @see LabelPlacement
- * @var object
- */
- var $labelplacement = "";
-
- //Halo is not supported by Mapserver
- var $halo = "";
-
- //Fill is not supported by Mapserver - only solid color
- var $fill = "";
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
-
- function TextSymbolizer()
- {
- //$this->label = new ParameterValue();
- //$this->labelplacement = new LabelPlacement();
- //$this->fill = new Fill();
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<TextSymbolizer>\n";
- #if ($this->label != "") $temp .= $offset." <Label>".htmlspecialchars($this->label)."</Label>\n";
- if ($this->label != "") $temp .= $offset." <Label>".$this->label->generateXml()."</Label>\n";
- if ($this->font != "") $temp .= $this->font->generateXml($offset." ");
- if ($this->labelplacement != "") $temp .= $this->labelplacement->generateXml($offset." ");
- if ($this->halo != "") $temp .= $this->halo->generateXml($offset." ");
- if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
- $temp .= $offset."</TextSymbolizer>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset= "")
- {
- $temp = "";
- $label_value = "";
- $temp .= $offset."<table bgcolor=\"#FFFFFF\" cellspacing='2' cellpadding='0' style=\"border: 1px solid black; width:100%;\">\n";
- $temp .= $offset." <tr valign=\"top\">\n";
- $temp .= $offset." <td class='text' style=\"width: 130px;\">\n";
- $temp .= $offset." TextSymbolizer<br>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"textsymbolizer\">\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
-
- $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
-
- $temp .= $offset." <table>";
- $temp .= $offset." <tr>\n";
- $temp .= $offset." <td style=\"width: 100px\">\n";
- $temp .= $offset." Label:\n";
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_label\" id=\"".$id."_label\" value=\"";
- if ($this->label != "")
- $label_value = $this->label->generateHtmlForm($id."_label","");
- $temp .= $label_value;
- $temp .= "\">\n";
- //experimental
- $temp_elements = $_SESSION["sld_objects"][3]->generateElementsHtml($id."_label",$label_value);
- $temp .= $offset.$temp_elements;
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset." </table>\n";
-
- if ($this->font != "")
- {
- $temp .= $this->font->generateHtmlForm($id."_font", $offset." ");
- }
- else
- {
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addfont&id=".$this->id."\">Font hinzufügen</a><br>\n";
- }
- if ($this->labelplacement != "")
- {
- $temp .= $this->labelplacement->generateHtmlForm($id."_labelplacement", $offset." ");
- }
- else
- {
- $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addlabelplacement&id=".$this->id."\">Labelplacement hinzufügen</a><br>\n";
- }
- //Halo is not supported - removed from source
- if ($this->halo != "")
- {
- $temp .= $this->halo->generateHtmlForm($id."_halo", $offset." ");
- }
- else
- {
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addhalo&id=".$this->id."\">Halo hinzufügen</a><br>\n";
- }
-
- if ($this->fill != "")
- {
- $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
- }
- else
- {
- $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
- }
- $temp .= $offset." </td>\n";
- $temp .= $offset." </tr>\n";
- $temp .= $offset."</table>\n";
- $temp .= $offset."<br>\n";
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- if (isset($_REQUEST[$id."_label"]))
- {
- $this->label = new ParameterValue();
- $this->label->value = $_REQUEST[$id."_label"];
- }
- if (isset($_REQUEST[$id."_font"]))
- {
- $this->font = new Font();
- $this->font->generateObjectFromPost($id."_font");
- }
- if (isset($_REQUEST[$id."_labelplacement"]))
- {
- $this->labelplacement = new LabelPlacement();
- $this->labelplacement->generateObjectFromPost($id."_labelplacement");
- }
- if (isset($_REQUEST[$id."_halo"]))
- {
- $this->halo = new Halo();
- $this->halo->generateObjectFromPost($id."_halo");
- }
- if (isset($_REQUEST[$id."_fill"]))
- {
- $this->fill = new Fill();
- $this->fill->generateObjectFromPost($id."_fill");
- }
- }
-}
-?>
Copied: trunk/mapbender/http/sld/classes/TextSymbolizer.php (from rev 2404, branches/2.5/http/sld/classes/TextSymbolizer.php)
===================================================================
--- trunk/mapbender/http/sld/classes/TextSymbolizer.php (rev 0)
+++ trunk/mapbender/http/sld/classes/TextSymbolizer.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,224 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the TextSymbolizer-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class TextSymbolizer extends Rule
+{
+ /**
+ * The Label element from the xml-scheme.
+ * This element is not implemented as an object.
+ * Although it is an object, we'll use a workaround ...
+ * <Label>Townname: <ogc:PropertyValue>NAME</ogc:PropertyValue></Label> should be possible
+ *
+ * @var object
+ */
+ var $label = "";
+
+ /**
+ * The Font object from the xml-scheme.
+ *
+ * @see Font
+ * @var object
+ */
+ var $font = "";
+
+ /**
+ * The Labelplacement object from the xml-scheme.
+ *
+ * @see LabelPlacement
+ * @var object
+ */
+ var $labelplacement = "";
+
+ //Halo is not supported by Mapserver
+ var $halo = "";
+
+ //Fill is not supported by Mapserver - only solid color
+ var $fill = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+
+ function TextSymbolizer()
+ {
+ //$this->label = new ParameterValue();
+ //$this->labelplacement = new LabelPlacement();
+ //$this->fill = new Fill();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<TextSymbolizer>\n";
+ #if ($this->label != "") $temp .= $offset." <Label>".htmlspecialchars($this->label)."</Label>\n";
+ if ($this->label != "") $temp .= $offset." <Label>".$this->label->generateXml()."</Label>\n";
+ if ($this->font != "") $temp .= $this->font->generateXml($offset." ");
+ if ($this->labelplacement != "") $temp .= $this->labelplacement->generateXml($offset." ");
+ if ($this->halo != "") $temp .= $this->halo->generateXml($offset." ");
+ if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
+ $temp .= $offset."</TextSymbolizer>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset= "")
+ {
+ $temp = "";
+ $label_value = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" cellspacing='2' cellpadding='0' style=\"border: 1px solid black; width:100%;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td class='text' style=\"width: 130px;\">\n";
+ $temp .= $offset." TextSymbolizer<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"textsymbolizer\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <table>";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td style=\"width: 100px\">\n";
+ $temp .= $offset." Label:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_label\" id=\"".$id."_label\" value=\"";
+ if ($this->label != "")
+ $label_value = $this->label->generateHtmlForm($id."_label","");
+ $temp .= $label_value;
+ $temp .= "\">\n";
+ //experimental
+ $temp_elements = $_SESSION["sld_objects"][3]->generateElementsHtml($id."_label",$label_value);
+ $temp .= $offset.$temp_elements;
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+
+ if ($this->font != "")
+ {
+ $temp .= $this->font->generateHtmlForm($id."_font", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addfont&id=".$this->id."\">Font hinzufügen</a><br>\n";
+ }
+ if ($this->labelplacement != "")
+ {
+ $temp .= $this->labelplacement->generateHtmlForm($id."_labelplacement", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addlabelplacement&id=".$this->id."\">Labelplacement hinzufügen</a><br>\n";
+ }
+ //Halo is not supported - removed from source
+ if ($this->halo != "")
+ {
+ $temp .= $this->halo->generateHtmlForm($id."_halo", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addhalo&id=".$this->id."\">Halo hinzufügen</a><br>\n";
+ }
+
+ if ($this->fill != "")
+ {
+ $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_label"]))
+ {
+ $this->label = new ParameterValue();
+ $this->label->value = $_REQUEST[$id."_label"];
+ }
+ if (isset($_REQUEST[$id."_font"]))
+ {
+ $this->font = new Font();
+ $this->font->generateObjectFromPost($id."_font");
+ }
+ if (isset($_REQUEST[$id."_labelplacement"]))
+ {
+ $this->labelplacement = new LabelPlacement();
+ $this->labelplacement->generateObjectFromPost($id."_labelplacement");
+ }
+ if (isset($_REQUEST[$id."_halo"]))
+ {
+ $this->halo = new Halo();
+ $this->halo->generateObjectFromPost($id."_halo");
+ }
+ if (isset($_REQUEST[$id."_fill"]))
+ {
+ $this->fill = new Fill();
+ $this->fill->generateObjectFromPost($id."_fill");
+ }
+ }
+}
+?>
Deleted: trunk/mapbender/http/sld/classes/UnaryLogicOp.php
===================================================================
--- branches/2.5/http/sld/classes/UnaryLogicOp.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/UnaryLogicOp.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,191 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the UnaryLogicOp-element
- *
- * @package filter_classes
- * @author Markus Krzyzanowski
- */
-class UnaryLogicOp
-{
- /**
- * Defines the type of logical operation.
- * Possible value: not
- * @var string
- */
- var $name = "";
-
- /**
- * Array containing the operations of this filter
- * @see UnaryLogicOp
- * @see BinaryLogicOp
- * @see BinaryComparisonOp
- * @see PropertyIsLike
- * @see PropertyIsNull
- * @see PropertyIsBetween
- * @var array
- */
- var $operations = array();
-
- /**
- * Index of this object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $id = "";
-
- /**
- * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * constructor tha directly fills the $name variable
- * @param string $name the type of this logical operation
- */
- function UnaryLogicOp($name)
- {
- $this->name = $name;
- }
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<".$this->name.">\n";
- foreach($this->operations as $operation)
- {
- $temp .= $operation->generateXml($offset." ");
- }
- $temp .= $offset."</".$this->name.">\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id = "", $offset = "")
- {
- $temp = "";
-
- $temp .= $offset."<tr>\n";
- $temp .= $offset." <td>\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"unaryLogicOp\">\n";
- $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".$this->name."\">\n";
- $temp .= $offset." ".$this->name."<br>\n";
-
- $number = split("_", $id);
- $number = $number[count($number)-1];
- $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
- $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
-
- $temp .= $offset." </td>\n";
- $temp .= $offset." <td colspan=\"3\" valign=\"top\">\n";
- //Only 1 operation
- if (count($this->operations) < 1)
- {
- $addOperationModule = new AddOperationModule($this->id, $id);
- $temp .= $addOperationModule->generateHtmlForm($offset." ");
- }
- else
- {
- $temp .= $offset." <table>\n";
- $displayOperationModule = new DisplayOperationModule();
- $temp .= $displayOperationModule->generateHtmlForm($offset." ", $this->operations, $id);
- $temp .= $offset." </table>\n";
- }
-
- $temp .= $offset." </td>\n";
- $temp .= $offset."</tr>\n";
-
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $this->name = $_REQUEST[$id."_name"];
- $countOperations = 0;
- while (isset($_REQUEST[$id."_operation_".$countOperations]))
- {
- if ($_REQUEST[$id."_operation_".$countOperations] == "binaryComparisonOp")
- {
- $operation = new BinaryComparisonOp();
- }
-// if ($_REQUEST[$id."_operation_".$countOperations] == "unaryComparisonOp")
-// {
-// $operation = new UnaryComparisonOp();
-// }
- if ($_REQUEST[$id."_operation_".$countOperations] == "binaryLogicOp")
- {
- $operation = new BinaryLogicOp();
- }
- if ($_REQUEST[$id."_operation_".$countOperations] == "unaryLogicOp")
- {
- $operation = new UnaryLogicOp();
- }
- if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsLike")
- {
- $operation = new PropertyIsLike();
- }
- if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsNull")
- {
- $operation = new PropertyIsNull();
- }
- if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsBetween")
- {
- $operation = new PropertyIsBetween();
- }
- $operation->generateObjectFromPost($id."_operation_".$countOperations);
- $this->operations[] = $operation;
- $countOperations++;
- }
- }
-
- /**
- * deletes the rule with the given index from the $operations array
- * @param int $index index of the operation that has to be deleted
- */
- function deleteOperation($index)
- {
- array_splice($this->operations, $index, 1);
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/UnaryLogicOp.php (from rev 2404, branches/2.5/http/sld/classes/UnaryLogicOp.php)
===================================================================
--- trunk/mapbender/http/sld/classes/UnaryLogicOp.php (rev 0)
+++ trunk/mapbender/http/sld/classes/UnaryLogicOp.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,191 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the UnaryLogicOp-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class UnaryLogicOp
+{
+ /**
+ * Defines the type of logical operation.
+ * Possible value: not
+ * @var string
+ */
+ var $name = "";
+
+ /**
+ * Array containing the operations of this filter
+ * @see UnaryLogicOp
+ * @see BinaryLogicOp
+ * @see BinaryComparisonOp
+ * @see PropertyIsLike
+ * @see PropertyIsNull
+ * @see PropertyIsBetween
+ * @var array
+ */
+ var $operations = array();
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * constructor tha directly fills the $name variable
+ * @param string $name the type of this logical operation
+ */
+ function UnaryLogicOp($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<".$this->name.">\n";
+ foreach($this->operations as $operation)
+ {
+ $temp .= $operation->generateXml($offset." ");
+ }
+ $temp .= $offset."</".$this->name.">\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"unaryLogicOp\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".$this->name."\">\n";
+ $temp .= $offset." ".$this->name."<br>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td colspan=\"3\" valign=\"top\">\n";
+ //Only 1 operation
+ if (count($this->operations) < 1)
+ {
+ $addOperationModule = new AddOperationModule($this->id, $id);
+ $temp .= $addOperationModule->generateHtmlForm($offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <table>\n";
+ $displayOperationModule = new DisplayOperationModule();
+ $temp .= $displayOperationModule->generateHtmlForm($offset." ", $this->operations, $id);
+ $temp .= $offset." </table>\n";
+ }
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ $countOperations = 0;
+ while (isset($_REQUEST[$id."_operation_".$countOperations]))
+ {
+ if ($_REQUEST[$id."_operation_".$countOperations] == "binaryComparisonOp")
+ {
+ $operation = new BinaryComparisonOp();
+ }
+// if ($_REQUEST[$id."_operation_".$countOperations] == "unaryComparisonOp")
+// {
+// $operation = new UnaryComparisonOp();
+// }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "binaryLogicOp")
+ {
+ $operation = new BinaryLogicOp();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "unaryLogicOp")
+ {
+ $operation = new UnaryLogicOp();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsLike")
+ {
+ $operation = new PropertyIsLike();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsNull")
+ {
+ $operation = new PropertyIsNull();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsBetween")
+ {
+ $operation = new PropertyIsBetween();
+ }
+ $operation->generateObjectFromPost($id."_operation_".$countOperations);
+ $this->operations[] = $operation;
+ $countOperations++;
+ }
+ }
+
+ /**
+ * deletes the rule with the given index from the $operations array
+ * @param int $index index of the operation that has to be deleted
+ */
+ function deleteOperation($index)
+ {
+ array_splice($this->operations, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/classes/UserStyle.php
===================================================================
--- branches/2.5/http/sld/classes/UserStyle.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/classes/UserStyle.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,110 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Implementation of the UserStyle-element
- *
- * @package sld_classes
- * @author Markus Krzyzanowski
- */
-class UserStyle extends NamedLayer
-{
- /**
- * Array containing the FeatureTypeStyle-objects.
- *
- * @see FeatureTypeStyle
- * @var string
- */
- var $featuretypestyles = array();
-
- /**
- * Index identifying the object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $id = "";
- /**
- * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
- * @var int
- */
- var $parent = "";
-
- /**
- * creates the xml for this object and its child objects
- *
- * @param string $offset string used for formatting the output
- * @return string containing the xml-fragment
- */
- function generateXml($offset = "")
- {
- $temp = $offset."<UserStyle>\n";
- foreach($this->featuretypestyles as $style)
- {
- $temp .= $style->generateXml($offset." ");
- }
- $temp .= $offset."</UserStyle>\n";
- return $temp;
- }
-
- /**
- * creates the html-form-fragment for this object
- *
- * @param $id string containing a prefix that should be used to identify this
- * object's html fields. This must be done, so that the generateObjectFromPost(...)
- * function can address the fields belonging to this object in the http-post.
- *
- * @param string $offset string used for formatting the output
- * @return string containing the html-form-fragment
- */
- function generateHtmlForm($id, $offset = "")
- {
- $temp = "";
- $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"userstyle\">\n";
- $featuretypestyle_id = 0;
- foreach ($this->featuretypestyles as $featuretypestyle)
- {
- $temp .= $featuretypestyle->generateHtmlForm($id."_featuretypestyle_".$featuretypestyle_id, $offset);
- $featuretypestyle_id++;
- }
- return $temp;
- }
-
- /**
- * populates the member fields of a new object from the data in the http-post-request
- * to rebuild the object after the submission of the html-form.
- *
- * creates its own child objects from the post parameters and calls their
- * generateObjectFromPost(...) function
- *
- * @param string $id string that contains a prefix for the html-form-fields
- * that is common to all of the fields belonging to this object
- */
- function generateObjectFromPost($id = "")
- {
- $countFeatureTypeStyles = 0;
- while (isset($_REQUEST[$id."_featuretypestyle_".$countFeatureTypeStyles]))
- {
- $featuretypestyle = new FeatureTypeStyle();
- $featuretypestyle->generateObjectFromPost($id."_featuretypestyle_".$countFeatureTypeStyles);
- $this->featuretypestyles[] = $featuretypestyle;
- $countFeatureTypeStyles++;
- }
- }
-}
-
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/classes/UserStyle.php (from rev 2404, branches/2.5/http/sld/classes/UserStyle.php)
===================================================================
--- trunk/mapbender/http/sld/classes/UserStyle.php (rev 0)
+++ trunk/mapbender/http/sld/classes/UserStyle.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,110 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Implementation of the UserStyle-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class UserStyle extends NamedLayer
+{
+ /**
+ * Array containing the FeatureTypeStyle-objects.
+ *
+ * @see FeatureTypeStyle
+ * @var string
+ */
+ var $featuretypestyles = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<UserStyle>\n";
+ foreach($this->featuretypestyles as $style)
+ {
+ $temp .= $style->generateXml($offset." ");
+ }
+ $temp .= $offset."</UserStyle>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"userstyle\">\n";
+ $featuretypestyle_id = 0;
+ foreach ($this->featuretypestyles as $featuretypestyle)
+ {
+ $temp .= $featuretypestyle->generateHtmlForm($id."_featuretypestyle_".$featuretypestyle_id, $offset);
+ $featuretypestyle_id++;
+ }
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countFeatureTypeStyles = 0;
+ while (isset($_REQUEST[$id."_featuretypestyle_".$countFeatureTypeStyles]))
+ {
+ $featuretypestyle = new FeatureTypeStyle();
+ $featuretypestyle->generateObjectFromPost($id."_featuretypestyle_".$countFeatureTypeStyles);
+ $this->featuretypestyles[] = $featuretypestyle;
+ $countFeatureTypeStyles++;
+ }
+ }
+}
+
+?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/img (from rev 2404, branches/2.5/http/sld/img)
Deleted: trunk/mapbender/http/sld/img/lightning.png
===================================================================
(Binary files differ)
Copied: trunk/mapbender/http/sld/img/lightning.png (from rev 2404, branches/2.5/http/sld/img/lightning.png)
===================================================================
(Binary files differ)
Deleted: trunk/mapbender/http/sld/img/map_magnify.png
===================================================================
(Binary files differ)
Copied: trunk/mapbender/http/sld/img/map_magnify.png (from rev 2404, branches/2.5/http/sld/img/map_magnify.png)
===================================================================
(Binary files differ)
Deleted: trunk/mapbender/http/sld/img/minus.gif
===================================================================
(Binary files differ)
Copied: trunk/mapbender/http/sld/img/minus.gif (from rev 2404, branches/2.5/http/sld/img/minus.gif)
===================================================================
(Binary files differ)
Deleted: trunk/mapbender/http/sld/img/plus.gif
===================================================================
(Binary files differ)
Copied: trunk/mapbender/http/sld/img/plus.gif (from rev 2404, branches/2.5/http/sld/img/plus.gif)
===================================================================
(Binary files differ)
Deleted: trunk/mapbender/http/sld/img/script.png
===================================================================
(Binary files differ)
Copied: trunk/mapbender/http/sld/img/script.png (from rev 2404, branches/2.5/http/sld/img/script.png)
===================================================================
(Binary files differ)
Deleted: trunk/mapbender/http/sld/img/script_code_red.png
===================================================================
(Binary files differ)
Copied: trunk/mapbender/http/sld/img/script_code_red.png (from rev 2404, branches/2.5/http/sld/img/script_code_red.png)
===================================================================
(Binary files differ)
Deleted: trunk/mapbender/http/sld/img/script_link.png
===================================================================
(Binary files differ)
Copied: trunk/mapbender/http/sld/img/script_link.png (from rev 2404, branches/2.5/http/sld/img/script_link.png)
===================================================================
(Binary files differ)
Deleted: trunk/mapbender/http/sld/img/script_save.png
===================================================================
(Binary files differ)
Copied: trunk/mapbender/http/sld/img/script_save.png (from rev 2404, branches/2.5/http/sld/img/script_save.png)
===================================================================
(Binary files differ)
Deleted: trunk/mapbender/http/sld/sld_config.php
===================================================================
--- branches/2.5/http/sld/sld_config.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/sld_config.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,77 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * This file contains some global configuration variables for the sld-editor
- *
- * @package sld_config
- * @author Markus Krzyzanowski
- */
-
-include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-include_once(dirname(__FILE__)."/sld_parse.php");
-
-// this should come from mapbender.conf
-$SLD_MAIN = "sld_main.php?".$urlParameters;
-$SLD_FUNCTION_HANDLER = "sld_function_handler.php?".$urlParameters;
-$MAPBENDER_URL = "http://".$_SERVER["HTTP_HOST"].dirname($_SERVER['PHP_SELF']);
-
-function char_encode($s){
- if(CHARSET == 'UTF-8'){
- $s = utf8_encode($s);
- }
- return $s;
-}
-
-if (isset($_REQUEST["sld_wms_id"]) && isset($_REQUEST["sld_gui_id"]))
-{
- $_SESSION["sld_wms_id"] = $_REQUEST["sld_wms_id"];
- $_SESSION["sld_gui_id"] = $_REQUEST["sld_gui_id"];
-}
-
-if (isset($_REQUEST["sld_layer_name"]))
-{
- $_SESSION["sld_layer_name"] = $_REQUEST["sld_layer_name"];
-}
-
-if (isset($_SESSION["sld_wms_id"]) && isset($_SESSION["sld_layer_name"]))
-{
- $layer_name = $_SESSION["sld_layer_name"];
- $wms_id = $_SESSION["sld_wms_id"];
-
- //Read from DB
- require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
- $con = db_connect($DBSERVER,$OWNER,$PW);
- db_select_db($DB,$con);
- $sql = "SELECT * FROM wms WHERE wms_id = $1";
- $v = array($wms_id);
- $t = array('i');
- $res = db_prep_query($sql,$v,$t);
-
- $mapfileUrl = "";
- if ( db_fetch_row($res, 0) )
- {
- $mapfileUrl = db_result($res, 0, "wms_getmap");
- //echo $mapfileUrl;
- }
-
-}
-
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/sld_config.php (from rev 2404, branches/2.5/http/sld/sld_config.php)
===================================================================
--- trunk/mapbender/http/sld/sld_config.php (rev 0)
+++ trunk/mapbender/http/sld/sld_config.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,77 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * This file contains some global configuration variables for the sld-editor
+ *
+ * @package sld_config
+ * @author Markus Krzyzanowski
+ */
+
+include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+include_once(dirname(__FILE__)."/sld_parse.php");
+
+// this should come from mapbender.conf
+$SLD_MAIN = "sld_main.php?".$urlParameters;
+$SLD_FUNCTION_HANDLER = "sld_function_handler.php?".$urlParameters;
+$MAPBENDER_URL = "http://".$_SERVER["HTTP_HOST"].dirname($_SERVER['PHP_SELF']);
+
+function char_encode($s){
+ if(CHARSET == 'UTF-8'){
+ $s = utf8_encode($s);
+ }
+ return $s;
+}
+
+if (isset($_REQUEST["sld_wms_id"]) && isset($_REQUEST["sld_gui_id"]))
+{
+ $_SESSION["sld_wms_id"] = $_REQUEST["sld_wms_id"];
+ $_SESSION["sld_gui_id"] = $_REQUEST["sld_gui_id"];
+}
+
+if (isset($_REQUEST["sld_layer_name"]))
+{
+ $_SESSION["sld_layer_name"] = $_REQUEST["sld_layer_name"];
+}
+
+if (isset($_SESSION["sld_wms_id"]) && isset($_SESSION["sld_layer_name"]))
+{
+ $layer_name = $_SESSION["sld_layer_name"];
+ $wms_id = $_SESSION["sld_wms_id"];
+
+ //Read from DB
+ require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db($DB,$con);
+ $sql = "SELECT * FROM wms WHERE wms_id = $1";
+ $v = array($wms_id);
+ $t = array('i');
+ $res = db_prep_query($sql,$v,$t);
+
+ $mapfileUrl = "";
+ if ( db_fetch_row($res, 0) )
+ {
+ $mapfileUrl = db_result($res, 0, "wms_getmap");
+ //echo $mapfileUrl;
+ }
+
+}
+
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/sld_edit_filter.php
===================================================================
--- branches/2.5/http/sld/sld_edit_filter.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/sld_edit_filter.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,275 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD/
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * This file contains the source of the filter-expression-editor-module.
- * This was separated from the sld-editor's parsing and functionhandling
- * due to readability reasons.
- * Contains all the source for displaying the form and the functionhandling.
- *
- * @package filter_editor
- * @author Markus Krzyzanowski
- */
-
-
-
-
-include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
-require_once(dirname(__FILE__)."/sld_config.php");
-include_once(dirname(__FILE__)."/sld_filter_parse.php");
-
-//get the neccessary variables from the request or from the session
-//if from request set up the session variables
-
-$sld_objects = $_SESSION["sld_objects"];
-
-if ( isset($_REQUEST["sld_form_element_id"]) && isset($_REQUEST["sld_objects_rule_id"]) )
-{
- $first_load = 1;
- $sld_form_element_id = $_REQUEST["sld_form_element_id"];
- $_SESSION["sld_form_element_id"] = $sld_form_element_id;
-
- $sld_objects_rule_id = $_REQUEST["sld_objects_rule_id"];
- $_SESSION["sld_objects_rule_id"] = $sld_objects_rule_id;
-
- $filter = $sld_objects[$sld_objects_rule_id]->filter;
- $_SESSION["sld_filter"] = $filter;
-}
-else
-{
- $first_load = 0;
- $sld_form_element_id = $_SESSION["sld_form_element_id"];
- $sld_objects_rule_id = $_SESSION["sld_objects_rule_id"];
- $filter = $_SESSION["sld_filter"];
-}
-
-//Parse the Filter Expression
-$filterObj = parseFilter($filter);
-if ($filterObj == "")
-{
- //$filterObj = new Filter();
-}
-
-
-
-//Function handling
-if (isset($_REQUEST["function"]))
-{
- $function = $_REQUEST["function"];
- //Handle the requested functions
- if ($function == "addoperation")
- {
- if ( isset($_REQUEST["id"]) && isset($_REQUEST["operation"]) )
- {
- $operation = $_REQUEST["operation"];
-
- switch(strtoupper($operation))
- {
- case "OR":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryLogicOp("Or");
- break;
- case "AND":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryLogicOp("And");
- break;
- case "NOT":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new UnaryLogicOp("Not");
- break;
- case "PROPERTYISEQUALTO":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsEqualTo");
- break;
- case "PROPERTYISNOTEQUALTO":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsNotEqualTo");
- break;
- case "PROPERTYISGREATERTHAN":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsGreaterThan");
- break;
- case "PROPERTYISGREATERTHANOREQUALTO":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsGreaterThanOrEqualTo");
- break;
- case "PROPERTYISLESSTHAN":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsLessThan");
- break;
- case "PROPERTYISLESSTHANOREQUALTO":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsLessThanOrEqualTo");
- break;
- case "PROPERTYISLIKE":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new PropertyIsLike();
- break;
- case "PROPERTYISNULL":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new PropertyIsNull();
- break;
- case "PROPERTYISBETWEEN":
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new PropertyIsBetween();
- break;
- }
- $_SESSION["sld_filter"] = $_SESSION["sld_filter_objects"][0]->generateXml();
- }
- }
- else if ($function == "deleteoperation")
- {
- if ( isset($_REQUEST["id"]) && isset($_REQUEST["number"]) )
- {
- $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->deleteOperation($_REQUEST["number"]);
- $_SESSION["sld_filter"] = $_SESSION["sld_filter_objects"][0]->generateXml();
- }
- }
- else if ($function == "addfilter")
- {
- if ( isset($_REQUEST["type"]) )
- {
- if ($_REQUEST["type"] == "filter")
- {
- $_SESSION["sld_filter_objects"][0] = new Filter();
- $_SESSION["sld_filter"] = $_SESSION["sld_filter_objects"][0]->generateXml();
- }
- else if ($_REQUEST["type"] == "elsefilter")
- {
- $_SESSION["sld_filter_objects"][0] = new ElseFilter();
- $_SESSION["sld_filter"] = $_SESSION["sld_filter_objects"][0]->generateXml();
- }
- }
- }
- else if ($function == "deletefilter")
- {
- $_SESSION["sld_filter_objects"][0] = "";
- $_SESSION["sld_filter"] = "";
- }
- else if ($function == "save")
- {
- if( isset($_REQUEST["filter"]) )
- {
- $filter = new Filter();
- $filter->generateObjectFromPost();
- $_SESSION["sld_filter"] = $filter->generateXml();
- }
- else if( isset($_REQUEST["elsefilter"]) )
- {
- $filter = new ElseFilter();
- $_SESSION["sld_filter"] = $filter->generateXml();
- }
- else
- {
- $_SESSION["sld_filter"] = "";
- }
- }
- else
- {
- echo "Die Funktion: ".$function." wird nicht unterst�tzt.";
- exit();
- }
-
-
- header("Location: sld_edit_filter.php?".$urlParameters);
- exit();
-}
-else
-{
- //Write the new filter expression to the sld objects
- if ($filterObj != "")
- {
- $sld_objects[$sld_objects_rule_id]->filter = $filterObj->generateXml();
- }
- else
- {
- $sld_objects[$sld_objects_rule_id]->filter = "";
- }
- //display the html form
- echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
- echo "<html>\n";
- echo "<head>\n";
- echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n";
- echo "<meta HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n";
- echo "<META HTTP-EQUIV=\"PRAGMA\" CONTENT=\"NO-CACHE\">\n";
- echo "<title>Filter-Editor</title>\n";
- echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/sldEditor.css\">\n";
- echo "<script Language=\"JavaScript\">\n";
-
- //write the filter expression into the hidden field in the sld editor on load automatically
- echo "function setFilter()\n";
- echo "{\n";
- echo "var filter = document.getElementById(\"filter_textarea\").value;\n";
- echo "window.opener.document.getElementById(\"sld_editor_form\").".$sld_form_element_id.".value = filter;\n";
- echo "//window.opener.document.getElementById(\"sld_editor_form\").submit();\n";
- echo "}\n";
-
- echo "function updateFilter()\n";
- echo "{\n";
- echo "//var filter = document.getElementById(\"filter_textarea\").value;\n";
- echo "//window.opener.document.getElementById(\"sld_editor_form\").".$sld_form_element_id.".value = filter;\n";
- echo "window.opener.document.getElementById(\"sld_editor_form\").submit();\n";
- echo "}\n";
-
- echo "</script>\n";
- echo "</head>\n";
- echo "<body";
- if ($first_load != 1) echo " onLoad=\"setFilter();\"";
- echo ">\n";
-
- echo "<form name=\"editFilter\" action=\"sld_edit_filter.php?".$urlParameters."\" method=\"post\">\n";
-
- echo "<table cellspacing=\"0\" cellpadding=\"0\">\n";
- echo "<tr align=\"center\"><td class=\"bg2 text3\">Filter bearbeiten</td></tr>\n";
- echo "<tr><td class=\"line_left2 line_down2 line_right2 bg text1\">\n";
-
- if ($filterObj != "")
- {
- echo "<input type=\"hidden\" name=\"function\" value=\"save\">\n";
- echo $filterObj->generateHtmlForm();
- echo "<input class=\"edit hand\" type=\"submit\" value=\"Aktualisieren\">\n";
- echo "<input class=\"edit hand\" type=\"button\" value=\"Änderungen speichern\" onclick=\"updateFilter()\">\n";
-
- }
- else
- {
- echo "Filter oder ElseFilter?<br>";
- echo "<input type=\"radio\" name=\"type\" value=\"filter\" onClick=\"submit()\">Filter<br>\n";
- echo "<input type=\"radio\" name=\"type\" value=\"elsefilter\" onClick=\"submit()\">ElseFilter<br>\n";
- echo "<input type=\"hidden\" name=\"function\" value=\"addfilter\">\n";
- }
- echo "</td></tr>\n";
-
- echo "<tr><td> </td></tr>\n";
-
- echo "<tr align=\"center\"><td class=\"bg2 text3\">Vorschau</td></tr>\n";
- echo "<tr><td class=\"line_left2 line_down2 line_right2 bg text1\">\n";
-
- if ($filterObj != "")
- {
- echo "<pre>\n";
- echo htmlspecialchars($filterObj->generateXml());
- print_r ($_SESSION["sld_filter_objects"]);
- echo "</pre>\n";
- echo "<textarea id=\"filter_textarea\" style=\"visibility:hidden;\">\n";
- echo htmlspecialchars($filterObj->generateXml());
- echo "</textarea>\n";
- }
- else
- {
- echo " \n";
- }
-
- echo "</td></tr>\n";
- echo "</table>\n";
- echo "</form>\n";
-
- echo "</body>\n";
- echo "</html>";
-
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/sld_edit_filter.php (from rev 2404, branches/2.5/http/sld/sld_edit_filter.php)
===================================================================
--- trunk/mapbender/http/sld/sld_edit_filter.php (rev 0)
+++ trunk/mapbender/http/sld/sld_edit_filter.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,275 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD/
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * This file contains the source of the filter-expression-editor-module.
+ * This was separated from the sld-editor's parsing and functionhandling
+ * due to readability reasons.
+ * Contains all the source for displaying the form and the functionhandling.
+ *
+ * @package filter_editor
+ * @author Markus Krzyzanowski
+ */
+
+
+
+
+include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
+require_once(dirname(__FILE__)."/sld_config.php");
+include_once(dirname(__FILE__)."/sld_filter_parse.php");
+
+//get the neccessary variables from the request or from the session
+//if from request set up the session variables
+
+$sld_objects = $_SESSION["sld_objects"];
+
+if ( isset($_REQUEST["sld_form_element_id"]) && isset($_REQUEST["sld_objects_rule_id"]) )
+{
+ $first_load = 1;
+ $sld_form_element_id = $_REQUEST["sld_form_element_id"];
+ $_SESSION["sld_form_element_id"] = $sld_form_element_id;
+
+ $sld_objects_rule_id = $_REQUEST["sld_objects_rule_id"];
+ $_SESSION["sld_objects_rule_id"] = $sld_objects_rule_id;
+
+ $filter = $sld_objects[$sld_objects_rule_id]->filter;
+ $_SESSION["sld_filter"] = $filter;
+}
+else
+{
+ $first_load = 0;
+ $sld_form_element_id = $_SESSION["sld_form_element_id"];
+ $sld_objects_rule_id = $_SESSION["sld_objects_rule_id"];
+ $filter = $_SESSION["sld_filter"];
+}
+
+//Parse the Filter Expression
+$filterObj = parseFilter($filter);
+if ($filterObj == "")
+{
+ //$filterObj = new Filter();
+}
+
+
+
+//Function handling
+if (isset($_REQUEST["function"]))
+{
+ $function = $_REQUEST["function"];
+ //Handle the requested functions
+ if ($function == "addoperation")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_REQUEST["operation"]) )
+ {
+ $operation = $_REQUEST["operation"];
+
+ switch(strtoupper($operation))
+ {
+ case "OR":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryLogicOp("Or");
+ break;
+ case "AND":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryLogicOp("And");
+ break;
+ case "NOT":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new UnaryLogicOp("Not");
+ break;
+ case "PROPERTYISEQUALTO":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsEqualTo");
+ break;
+ case "PROPERTYISNOTEQUALTO":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsNotEqualTo");
+ break;
+ case "PROPERTYISGREATERTHAN":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsGreaterThan");
+ break;
+ case "PROPERTYISGREATERTHANOREQUALTO":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsGreaterThanOrEqualTo");
+ break;
+ case "PROPERTYISLESSTHAN":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsLessThan");
+ break;
+ case "PROPERTYISLESSTHANOREQUALTO":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsLessThanOrEqualTo");
+ break;
+ case "PROPERTYISLIKE":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new PropertyIsLike();
+ break;
+ case "PROPERTYISNULL":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new PropertyIsNull();
+ break;
+ case "PROPERTYISBETWEEN":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new PropertyIsBetween();
+ break;
+ }
+ $_SESSION["sld_filter"] = $_SESSION["sld_filter_objects"][0]->generateXml();
+ }
+ }
+ else if ($function == "deleteoperation")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_REQUEST["number"]) )
+ {
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->deleteOperation($_REQUEST["number"]);
+ $_SESSION["sld_filter"] = $_SESSION["sld_filter_objects"][0]->generateXml();
+ }
+ }
+ else if ($function == "addfilter")
+ {
+ if ( isset($_REQUEST["type"]) )
+ {
+ if ($_REQUEST["type"] == "filter")
+ {
+ $_SESSION["sld_filter_objects"][0] = new Filter();
+ $_SESSION["sld_filter"] = $_SESSION["sld_filter_objects"][0]->generateXml();
+ }
+ else if ($_REQUEST["type"] == "elsefilter")
+ {
+ $_SESSION["sld_filter_objects"][0] = new ElseFilter();
+ $_SESSION["sld_filter"] = $_SESSION["sld_filter_objects"][0]->generateXml();
+ }
+ }
+ }
+ else if ($function == "deletefilter")
+ {
+ $_SESSION["sld_filter_objects"][0] = "";
+ $_SESSION["sld_filter"] = "";
+ }
+ else if ($function == "save")
+ {
+ if( isset($_REQUEST["filter"]) )
+ {
+ $filter = new Filter();
+ $filter->generateObjectFromPost();
+ $_SESSION["sld_filter"] = $filter->generateXml();
+ }
+ else if( isset($_REQUEST["elsefilter"]) )
+ {
+ $filter = new ElseFilter();
+ $_SESSION["sld_filter"] = $filter->generateXml();
+ }
+ else
+ {
+ $_SESSION["sld_filter"] = "";
+ }
+ }
+ else
+ {
+ echo "Die Funktion: ".$function." wird nicht unterst�tzt.";
+ exit();
+ }
+
+
+ header("Location: sld_edit_filter.php?".$urlParameters);
+ exit();
+}
+else
+{
+ //Write the new filter expression to the sld objects
+ if ($filterObj != "")
+ {
+ $sld_objects[$sld_objects_rule_id]->filter = $filterObj->generateXml();
+ }
+ else
+ {
+ $sld_objects[$sld_objects_rule_id]->filter = "";
+ }
+ //display the html form
+ echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
+ echo "<html>\n";
+ echo "<head>\n";
+ echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n";
+ echo "<meta HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n";
+ echo "<META HTTP-EQUIV=\"PRAGMA\" CONTENT=\"NO-CACHE\">\n";
+ echo "<title>Filter-Editor</title>\n";
+ echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/sldEditor.css\">\n";
+ echo "<script Language=\"JavaScript\">\n";
+
+ //write the filter expression into the hidden field in the sld editor on load automatically
+ echo "function setFilter()\n";
+ echo "{\n";
+ echo "var filter = document.getElementById(\"filter_textarea\").value;\n";
+ echo "window.opener.document.getElementById(\"sld_editor_form\").".$sld_form_element_id.".value = filter;\n";
+ echo "//window.opener.document.getElementById(\"sld_editor_form\").submit();\n";
+ echo "}\n";
+
+ echo "function updateFilter()\n";
+ echo "{\n";
+ echo "//var filter = document.getElementById(\"filter_textarea\").value;\n";
+ echo "//window.opener.document.getElementById(\"sld_editor_form\").".$sld_form_element_id.".value = filter;\n";
+ echo "window.opener.document.getElementById(\"sld_editor_form\").submit();\n";
+ echo "}\n";
+
+ echo "</script>\n";
+ echo "</head>\n";
+ echo "<body";
+ if ($first_load != 1) echo " onLoad=\"setFilter();\"";
+ echo ">\n";
+
+ echo "<form name=\"editFilter\" action=\"sld_edit_filter.php?".$urlParameters."\" method=\"post\">\n";
+
+ echo "<table cellspacing=\"0\" cellpadding=\"0\">\n";
+ echo "<tr align=\"center\"><td class=\"bg2 text3\">Filter bearbeiten</td></tr>\n";
+ echo "<tr><td class=\"line_left2 line_down2 line_right2 bg text1\">\n";
+
+ if ($filterObj != "")
+ {
+ echo "<input type=\"hidden\" name=\"function\" value=\"save\">\n";
+ echo $filterObj->generateHtmlForm();
+ echo "<input class=\"edit hand\" type=\"submit\" value=\"Aktualisieren\">\n";
+ echo "<input class=\"edit hand\" type=\"button\" value=\"Änderungen speichern\" onclick=\"updateFilter()\">\n";
+
+ }
+ else
+ {
+ echo "Filter oder ElseFilter?<br>";
+ echo "<input type=\"radio\" name=\"type\" value=\"filter\" onClick=\"submit()\">Filter<br>\n";
+ echo "<input type=\"radio\" name=\"type\" value=\"elsefilter\" onClick=\"submit()\">ElseFilter<br>\n";
+ echo "<input type=\"hidden\" name=\"function\" value=\"addfilter\">\n";
+ }
+ echo "</td></tr>\n";
+
+ echo "<tr><td> </td></tr>\n";
+
+ echo "<tr align=\"center\"><td class=\"bg2 text3\">Vorschau</td></tr>\n";
+ echo "<tr><td class=\"line_left2 line_down2 line_right2 bg text1\">\n";
+
+ if ($filterObj != "")
+ {
+ echo "<pre>\n";
+ echo htmlspecialchars($filterObj->generateXml());
+ print_r ($_SESSION["sld_filter_objects"]);
+ echo "</pre>\n";
+ echo "<textarea id=\"filter_textarea\" style=\"visibility:hidden;\">\n";
+ echo htmlspecialchars($filterObj->generateXml());
+ echo "</textarea>\n";
+ }
+ else
+ {
+ echo " \n";
+ }
+
+ echo "</td></tr>\n";
+ echo "</table>\n";
+ echo "</form>\n";
+
+ echo "</body>\n";
+ echo "</html>";
+
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/sld_filter_parse.php
===================================================================
--- branches/2.5/http/sld/sld_filter_parse.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/sld_filter_parse.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,369 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD/
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * This file parses the filter expressions and creates the corresponding objects.
- *
- * @package filter_editor
- * @author Markus Krzyzanowski
- */
-
-
-
-include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-
-/**
- * Parses a given filter expression and creates the object structure.
- * @param string $data filter expression that has to be parsed
- * @return Filter root object of the filter expression
- */
-function parseFilter($data)
-{
- $xml_parser = xml_parser_create_ns();
- xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0);
- xml_parse_into_struct($xml_parser, $data, $vals, $index);
- xml_parser_free($xml_parser);
-
-
- $filter;
- $parent = array();
- $objects = array();
- $parentactual = 0;
-
- for ($i=0; $i<count($vals); $i++)
- {
- $element = $vals[$i];
- $tag = $element["tag"];
- $tagname=strtoupper($tag);
- switch($tagname)
- {
- case "FILTER":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = false;
- $parentactual = 0;
- $filter = new Filter();
- $filter->id = 0;
- $filter->parent = false;
- $objects[] = &$filter;
- if ($element["type"] == "complete")
- {
- $parentactual = false;
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "ELSEFILTER":
- if ($element["type"] == "complete")
- {
- $parent[] = false;
- $parentactual = 0;
- $filter = new ElseFilter();
- $filter->id = 0;
- $filter->parent = false;
- $objects[] = &$filter;
- }
- break;
- case "OR":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new BinaryLogicOp("Or");
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "AND":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new BinaryLogicOp("And");
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "NOT":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new UnaryLogicOp("Not");
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "PROPERTYISEQUALTO":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsEqualTo");
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "PROPERTYISNOTEQUALTO":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsNotEqualTo");
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "PROPERTYISGREATERTHAN":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsGreaterThan");
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "PROPERTYISGREATERTHANOREQUALTO":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsGreaterThanOrEqualTo");
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "PROPERTYISLESSTHAN":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsLessThan");
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "PROPERTYISLESSTHANOREQUALTO":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsLessThanOrEqualTo");
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "PROPERTYISLIKE":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new PropertyIsLike();
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[count($parent)-1]->wildCard = $element["attributes"]["wildCard"];
- $objects[count($parent)-1]->singleChar = $element["attributes"]["singleChar"];
- $objects[count($parent)-1]->escape = $element["attributes"]["escape"];
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "PROPERTYISNULL":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new PropertyIsNull();
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "PROPERTYISBETWEEN":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new PropertyIsBetween();
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
-
- case "LITERAL":
- if ($element["type"] == "complete")
- {
- if ($boundary == "upper")
- {
- $objects[$parentactual]->upperBoundary = $element["value"];
- }
- else if ($boundary == "lower")
- {
- $objects[$parentactual]->lowerBoundary = $element["value"];
- }
- else
- {
- $objects[$parentactual]->ogcLiteral = $element["value"];
- }
- }
- break;
- case "PROPERTYNAME":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->ogcPropertyName = $element["value"];
- }
- break;
- case "LOWERBOUNDARY":
- if ($element["type"] == "open")
- {
- $boundary = "lower";
- }
- else if ($element["type"] == "close")
- {
- $boundary = "";
- }
- break;
- case "UPPERBOUNDARY":
- if ($element["type"] == "open")
- {
- $boundary = "upper";
- }
- else if ($element["type"] == "close")
- {
- $boundary = "";
- }
- break;
- }
- }
-
- $_SESSION["sld_filter_objects"] = $objects;
-
- return $filter;
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/sld_filter_parse.php (from rev 2404, branches/2.5/http/sld/sld_filter_parse.php)
===================================================================
--- trunk/mapbender/http/sld/sld_filter_parse.php (rev 0)
+++ trunk/mapbender/http/sld/sld_filter_parse.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,369 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD/
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * This file parses the filter expressions and creates the corresponding objects.
+ *
+ * @package filter_editor
+ * @author Markus Krzyzanowski
+ */
+
+
+
+include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+
+/**
+ * Parses a given filter expression and creates the object structure.
+ * @param string $data filter expression that has to be parsed
+ * @return Filter root object of the filter expression
+ */
+function parseFilter($data)
+{
+ $xml_parser = xml_parser_create_ns();
+ xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0);
+ xml_parse_into_struct($xml_parser, $data, $vals, $index);
+ xml_parser_free($xml_parser);
+
+
+ $filter;
+ $parent = array();
+ $objects = array();
+ $parentactual = 0;
+
+ for ($i=0; $i<count($vals); $i++)
+ {
+ $element = $vals[$i];
+ $tag = $element["tag"];
+ $tagname=strtoupper($tag);
+ switch($tagname)
+ {
+ case "FILTER":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = false;
+ $parentactual = 0;
+ $filter = new Filter();
+ $filter->id = 0;
+ $filter->parent = false;
+ $objects[] = &$filter;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = false;
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "ELSEFILTER":
+ if ($element["type"] == "complete")
+ {
+ $parent[] = false;
+ $parentactual = 0;
+ $filter = new ElseFilter();
+ $filter->id = 0;
+ $filter->parent = false;
+ $objects[] = &$filter;
+ }
+ break;
+ case "OR":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryLogicOp("Or");
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "AND":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryLogicOp("And");
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "NOT":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new UnaryLogicOp("Not");
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "PROPERTYISEQUALTO":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsEqualTo");
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "PROPERTYISNOTEQUALTO":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsNotEqualTo");
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "PROPERTYISGREATERTHAN":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsGreaterThan");
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "PROPERTYISGREATERTHANOREQUALTO":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsGreaterThanOrEqualTo");
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "PROPERTYISLESSTHAN":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsLessThan");
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "PROPERTYISLESSTHANOREQUALTO":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("PropertyIsLessThanOrEqualTo");
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "PROPERTYISLIKE":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new PropertyIsLike();
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[count($parent)-1]->wildCard = $element["attributes"]["wildCard"];
+ $objects[count($parent)-1]->singleChar = $element["attributes"]["singleChar"];
+ $objects[count($parent)-1]->escape = $element["attributes"]["escape"];
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "PROPERTYISNULL":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new PropertyIsNull();
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "PROPERTYISBETWEEN":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new PropertyIsBetween();
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[$parentactual]->operations[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+
+ case "LITERAL":
+ if ($element["type"] == "complete")
+ {
+ if ($boundary == "upper")
+ {
+ $objects[$parentactual]->upperBoundary = $element["value"];
+ }
+ else if ($boundary == "lower")
+ {
+ $objects[$parentactual]->lowerBoundary = $element["value"];
+ }
+ else
+ {
+ $objects[$parentactual]->ogcLiteral = $element["value"];
+ }
+ }
+ break;
+ case "PROPERTYNAME":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->ogcPropertyName = $element["value"];
+ }
+ break;
+ case "LOWERBOUNDARY":
+ if ($element["type"] == "open")
+ {
+ $boundary = "lower";
+ }
+ else if ($element["type"] == "close")
+ {
+ $boundary = "";
+ }
+ break;
+ case "UPPERBOUNDARY":
+ if ($element["type"] == "open")
+ {
+ $boundary = "upper";
+ }
+ else if ($element["type"] == "close")
+ {
+ $boundary = "";
+ }
+ break;
+ }
+ }
+
+ $_SESSION["sld_filter_objects"] = $objects;
+
+ return $filter;
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/sld_function_getusersld.php
===================================================================
--- branches/2.5/http/sld/sld_function_getusersld.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/sld_function_getusersld.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,140 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * This file realizes the function handling for the sld editor.
- * Requests from the sld_edit_form are forwarded to this page.
- * After processing the requested function this file forwards to the
- * sld_main.php.
- * Only if the request is to get the sld it will not forward to sld_main.php -
- * in this case this file will return the requested sld-document instead.
- *
- * @package sld_function_handler
- * @author Markus Krzyzanowski
- */
-
-include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
-include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-include_once(dirname(__FILE__)."/sld_parse.php");
-
-/**
- * This function saves the data into the database
- * @param string $data the content of the sld-document to be stored inside the database
- */
-
-if (isset($_REQUEST["function"]))
-{
- // the function "getusersld" is called by the mapserver to get the user's sld
- if ($_REQUEST["function"] == "getusersld")
- {
- if ( isset($_REQUEST["sld_layer_id"]) && isset($_REQUEST["sld_gui_id"]) && isset($_REQUEST["user_id"]) )
- { //Used for the preview
- $con = db_connect($DBSERVER,$OWNER,$PW);
- db_select_db($DB,$con);
- $sql = "SELECT * FROM sld_user_layer WHERE fkey_gui_id=$1 AND fkey_layer_id=$2 AND fkey_mb_user_id=$3";
- $v = array($_REQUEST["sld_gui_id"], $_REQUEST["sld_layer_id"], $_REQUEST["user_id"]);
- $t = array('s', 'i', 'i');
- $res = db_prep_query($sql,$v,$t);
-
- if ( db_fetch_row($res, 0) )
- {
- //forcesld is used for the preview image to force the sld
- if ( db_result($res, 0, "use_sld") == "1" || $_REQUEST["forcesld"] == "1" )
- {
- echo db_result($res, 0, "sld_xml");
- }
- }
- } //Used for mapbender integration - old deprecated
- else if ( isset($_REQUEST["sld_layer_names"]) && isset($_REQUEST["user_id"]) )
- {
- $layer_names = split(",", urldecode($_REQUEST["sld_layer_names"]));
-
- $con = db_connect($DBSERVER,$OWNER,$PW);
- db_select_db($DB,$con);
-
- /*$sld_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<StyledLayerDescriptor version=\"1.0.0\">\n";*/
- $sld_xml = "<StyledLayerDescriptor version=\"1.0.0\" xmlns=\"http://www.opengis.net/sld\" xmlns:ogc=\"http://www.opengis.net/ogc\">\n";
-
- foreach ($layer_names as $layer_name)
- {
- $sql = "SELECT * FROM layer WHERE layer_name=$1";
- $v = array($layer_name);
- $t = array('s');
- $res = db_prep_query($sql,$v,$t);
-
- $layer_id = "";
- if ( db_fetch_row($res, 0) )
- {
- $layer_id = db_result($res, 0, "fkey_layer_id");
- $sql = "SELECT * FROM sld_user_layer WHERE fkey_layer_id=$1 AND fkey_mb_user_id=$2";
- $v = array($layer_id, $_REQUEST["user_id"]);
- $t = array('i', 'i');
- $res = db_prep_query($sql,$v,$t);
-
- if ( db_fetch_row($res, 0) )
- {
- if ( db_result($res, 0, "use_sld") == "1" )
- {
- $data = db_result($res, 0, "sld_xml");
- $styledlayerdescriptor = parseSld($data);
- $sld_xml .= $styledlayerdescriptor->layers[0]->generateXml(" ");
- }
- }
- }
- }
- $sld_xml .= "</StyledLayerDescriptor>";
- echo $sld_xml;
- } //Used for mapbender integration
- else if ( isset($_REQUEST["sld_wms_id"]) && isset($_REQUEST["sld_gui_id"]) )
- {
-
- $con = db_connect($DBSERVER,$OWNER,$PW);
- db_select_db($DB,$con);
- $sql = "SELECT fkey_layer_id FROM gui_layer WHERE fkey_gui_id=$1 AND gui_layer_wms_id=$2";
- $v = array($_REQUEST["sld_gui_id"], $_REQUEST["sld_wms_id"]);
- $t = array('s', 'i');
- $res = db_prep_query($sql,$v,$t);
-
- $sld_xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
- $sld_xml .= "<StyledLayerDescriptor version=\"1.0.0\" xmlns=\"http://www.opengis.net/sld\" xmlns:ogc=\"http://www.opengis.net/ogc\">\n";
-
- while ($row = db_fetch_row($res))
- {
- $layer_id = $row[0];
- $sql = "SELECT * FROM sld_user_layer WHERE fkey_layer_id=$1 AND fkey_gui_id=$2";
- $v = array($layer_id, $_REQUEST["sld_gui_id"]);
- $t = array('i', 's');
- $res2 = db_prep_query($sql,$v,$t);
-
- if ( db_fetch_row($res2, 0) )
- {
- if ( db_result($res2, 0, "use_sld") == "1" )
- {
- $data = db_result($res2, 0, "sld_xml");
- $styledlayerdescriptor = parseSld($data);
- $sld_xml .= $styledlayerdescriptor->layers[0]->generateXml(" ");
- }
- }
- }
- $sld_xml .= "</StyledLayerDescriptor>";
- echo $sld_xml;
- }
- }
-}
-?>
Copied: trunk/mapbender/http/sld/sld_function_getusersld.php (from rev 2404, branches/2.5/http/sld/sld_function_getusersld.php)
===================================================================
--- trunk/mapbender/http/sld/sld_function_getusersld.php (rev 0)
+++ trunk/mapbender/http/sld/sld_function_getusersld.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,140 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * This file realizes the function handling for the sld editor.
+ * Requests from the sld_edit_form are forwarded to this page.
+ * After processing the requested function this file forwards to the
+ * sld_main.php.
+ * Only if the request is to get the sld it will not forward to sld_main.php -
+ * in this case this file will return the requested sld-document instead.
+ *
+ * @package sld_function_handler
+ * @author Markus Krzyzanowski
+ */
+
+include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
+include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+include_once(dirname(__FILE__)."/sld_parse.php");
+
+/**
+ * This function saves the data into the database
+ * @param string $data the content of the sld-document to be stored inside the database
+ */
+
+if (isset($_REQUEST["function"]))
+{
+ // the function "getusersld" is called by the mapserver to get the user's sld
+ if ($_REQUEST["function"] == "getusersld")
+ {
+ if ( isset($_REQUEST["sld_layer_id"]) && isset($_REQUEST["sld_gui_id"]) && isset($_REQUEST["user_id"]) )
+ { //Used for the preview
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db($DB,$con);
+ $sql = "SELECT * FROM sld_user_layer WHERE fkey_gui_id=$1 AND fkey_layer_id=$2 AND fkey_mb_user_id=$3";
+ $v = array($_REQUEST["sld_gui_id"], $_REQUEST["sld_layer_id"], $_REQUEST["user_id"]);
+ $t = array('s', 'i', 'i');
+ $res = db_prep_query($sql,$v,$t);
+
+ if ( db_fetch_row($res, 0) )
+ {
+ //forcesld is used for the preview image to force the sld
+ if ( db_result($res, 0, "use_sld") == "1" || $_REQUEST["forcesld"] == "1" )
+ {
+ echo db_result($res, 0, "sld_xml");
+ }
+ }
+ } //Used for mapbender integration - old deprecated
+ else if ( isset($_REQUEST["sld_layer_names"]) && isset($_REQUEST["user_id"]) )
+ {
+ $layer_names = split(",", urldecode($_REQUEST["sld_layer_names"]));
+
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db($DB,$con);
+
+ /*$sld_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<StyledLayerDescriptor version=\"1.0.0\">\n";*/
+ $sld_xml = "<StyledLayerDescriptor version=\"1.0.0\" xmlns=\"http://www.opengis.net/sld\" xmlns:ogc=\"http://www.opengis.net/ogc\">\n";
+
+ foreach ($layer_names as $layer_name)
+ {
+ $sql = "SELECT * FROM layer WHERE layer_name=$1";
+ $v = array($layer_name);
+ $t = array('s');
+ $res = db_prep_query($sql,$v,$t);
+
+ $layer_id = "";
+ if ( db_fetch_row($res, 0) )
+ {
+ $layer_id = db_result($res, 0, "fkey_layer_id");
+ $sql = "SELECT * FROM sld_user_layer WHERE fkey_layer_id=$1 AND fkey_mb_user_id=$2";
+ $v = array($layer_id, $_REQUEST["user_id"]);
+ $t = array('i', 'i');
+ $res = db_prep_query($sql,$v,$t);
+
+ if ( db_fetch_row($res, 0) )
+ {
+ if ( db_result($res, 0, "use_sld") == "1" )
+ {
+ $data = db_result($res, 0, "sld_xml");
+ $styledlayerdescriptor = parseSld($data);
+ $sld_xml .= $styledlayerdescriptor->layers[0]->generateXml(" ");
+ }
+ }
+ }
+ }
+ $sld_xml .= "</StyledLayerDescriptor>";
+ echo $sld_xml;
+ } //Used for mapbender integration
+ else if ( isset($_REQUEST["sld_wms_id"]) && isset($_REQUEST["sld_gui_id"]) )
+ {
+
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db($DB,$con);
+ $sql = "SELECT fkey_layer_id FROM gui_layer WHERE fkey_gui_id=$1 AND gui_layer_wms_id=$2";
+ $v = array($_REQUEST["sld_gui_id"], $_REQUEST["sld_wms_id"]);
+ $t = array('s', 'i');
+ $res = db_prep_query($sql,$v,$t);
+
+ $sld_xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
+ $sld_xml .= "<StyledLayerDescriptor version=\"1.0.0\" xmlns=\"http://www.opengis.net/sld\" xmlns:ogc=\"http://www.opengis.net/ogc\">\n";
+
+ while ($row = db_fetch_row($res))
+ {
+ $layer_id = $row[0];
+ $sql = "SELECT * FROM sld_user_layer WHERE fkey_layer_id=$1 AND fkey_gui_id=$2";
+ $v = array($layer_id, $_REQUEST["sld_gui_id"]);
+ $t = array('i', 's');
+ $res2 = db_prep_query($sql,$v,$t);
+
+ if ( db_fetch_row($res2, 0) )
+ {
+ if ( db_result($res2, 0, "use_sld") == "1" )
+ {
+ $data = db_result($res2, 0, "sld_xml");
+ $styledlayerdescriptor = parseSld($data);
+ $sld_xml .= $styledlayerdescriptor->layers[0]->generateXml(" ");
+ }
+ }
+ }
+ $sld_xml .= "</StyledLayerDescriptor>";
+ echo $sld_xml;
+ }
+ }
+}
+?>
Deleted: trunk/mapbender/http/sld/sld_function_handler.php
===================================================================
--- branches/2.5/http/sld/sld_function_handler.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/sld_function_handler.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,452 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * This file realizes the function handling for the sld editor.
- * Requests from the sld_edit_form are forwarded to this page.
- * After processing the requested function this file forwards to the
- * sld_main.php.
- * Only if the request is to get the sld it will not forward to sld_main.php -
- * in this case this file will return the requested sld-document instead.
- *
- * @package sld_function_handler
- * @author Markus Krzyzanowski
- */
-
-include_once(dirname(__FILE__)."/sld_config.php");
-include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-
-/**
- * This function saves the data into the database
- * @param string $data the content of the sld-document to be stored inside the database
- */
-function saveSld($data)
-{
- $con = db_connect($DBSERVER,$OWNER,$PW);
- db_select_db($DB,$con);
- $sql = "UPDATE sld_user_layer SET sld_xml=$1 WHERE fkey_gui_id=$2 AND fkey_layer_id=$3 AND fkey_mb_user_id=$4";
- $v = array($data, $_SESSION["sld_gui_id"], $_SESSION["sld_layer_id"], $_SESSION["mb_user_id"]);
- $t = array('s', 's', 'i', 'i');
- $res = db_prep_query($sql,$v,$t);
-}
-
-
-if (isset($_REQUEST["function"]))
-{
- //MAIN FUNCTIONS:
- if ($_REQUEST["function"] == "getdefaultsld")
- {
- $file = $mapfileUrl."VERSION=1.1.1&REQUEST=GetStyles&LAYERS=".urlencode($layer_name);
- $data = readSld($file);
- $data = char_encode($data);
- saveSld($data);
- }
- else if ($_REQUEST["function"] == "save")
- {
- $styledlayerdescriptor = new StyledLayerDescriptor();
- $styledlayerdescriptor->generateObjectFromPost();
- saveSld($styledlayerdescriptor->generateXml());
- }
- /* the function "getusersld" is called by the mapserver to get the user's sld
- else if ($_REQUEST["function"] == "getusersld")
- {
- if ( isset($_REQUEST["sld_layer_id"]) && isset($_REQUEST["sld_gui_id"]) && isset($_REQUEST["user_id"]) )
- { //Used for the preview
- $con = db_connect($DBSERVER,$OWNER,$PW);
- db_select_db($DB,$con);
- $sql = "SELECT * FROM sld_user_layer WHERE fkey_gui_id=$1 AND fkey_layer_id=$2 AND fkey_mb_user_id=$3";
- $v = array($_REQUEST["sld_gui_id"], $_REQUEST["sld_layer_id"], $_REQUEST["user_id"]);
- $t = array('s', 'i', 'i');
- $res = db_prep_query($sql,$v,$t);
- if ( db_fetch_row($res, 0) )
- {
- //forcesld is used for the preview image to force the sld
- if ( db_result($res, 0, "use_sld") == "1" || $_REQUEST["forcesld"] == "1" )
- {
- echo db_result($res, 0, "sld_xml");
- }
- }
- } //Used for mapbender integration - old deprecated
- else if ( isset($_REQUEST["layer_names"]) && isset($_REQUEST["user_id"]) )
- {
- $layer_names = split(",", urldecode($_REQUEST["layer_names"]));
-
- $con = db_connect($DBSERVER,$OWNER,$PW);
- db_select_db($DB,$con);
-
- #$sld_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<StyledLayerDescriptor version=\"1.0.0\">\n";
- $sld_xml = "<StyledLayerDescriptor version=\"1.0.0\" xmlns=\"http://www.opengis.net/sld\" xmlns:ogc=\"http://www.opengis.net/ogc\">\n";
-
- foreach ($layer_names as $layer_name)
- {
- $sql = "SELECT * FROM layer WHERE layer_name=$1";
- $v = array($layer_name);
- $t = array('s');
- $res = db_prep_query($sql,$v,$t);
-
- $layer_id = "";
- if ( db_fetch_row($res, 0) )
- {
- $layer_id = db_result($res, 0, "fkey_layer_id");
- $sql = "SELECT * FROM sld_user_layer WHERE fkey_layer_id=$1 AND fkey_mb_user_id=$2";
- $v = array($layer_id, $_REQUEST["user_id"]);
- $t = array('i', 'i');
- $res = db_prep_query($sql,$v,$t);
- if ( db_fetch_row($res, 0) )
- {
- if ( db_result($res, 0, "use_sld") == "1" )
- {
- $data = db_result($res, 0, "sld_xml");
- $styledlayerdescriptor = parseSld($data);
- $sld_xml .= $styledlayerdescriptor->layers[0]->generateXml(" ");
- }
- }
- }
- }
- $sld_xml .= "</StyledLayerDescriptor>";
- echo $sld_xml;
- } //Used for mapbender integration
- else if ( isset($_REQUEST["sld_wms_id"]) && isset($_REQUEST["sld_gui_id"]) )
- {
-
- $con = db_connect($DBSERVER,$OWNER,$PW);
- db_select_db($DB,$con);
- $sql = "SELECT fkey_layer_id FROM gui_layer WHERE fkey_gui_id=$1 AND gui_layer_wms_id=$2";
- $v = array($_REQUEST["sld_gui_id"], $_REQUEST["sld_wms_id"]);
- $t = array('s', 'i');
- $res = db_prep_query($sql,$v,$t);
-
- $sld_xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
- $sld_xml .= "<StyledLayerDescriptor version=\"1.0.0\" xmlns=\"http://www.opengis.net/sld\" xmlns:ogc=\"http://www.opengis.net/ogc\">\n";
-
- while ($row = db_fetch_row($res))
- {
- $layer_id = $row[0];
- $sql = "SELECT * FROM sld_user_layer WHERE fkey_layer_id=$1 AND fkey_gui_id=$2";
- $v = array($layer_id, $_REQUEST["sld_gui_id"]);
- $t = array('i', 's');
- $res2 = db_prep_query($sql,$v,$t);
- if ( db_fetch_row($res2, 0) )
- {
- if ( db_result($res2, 0, "use_sld") == "1" )
- {
- $data = db_result($res2, 0, "sld_xml");
- $styledlayerdescriptor = parseSld($data);
- $sld_xml .= $styledlayerdescriptor->layers[0]->generateXml(" ");
- }
- }
- }
- $sld_xml .= "</StyledLayerDescriptor>";
- echo $sld_xml;
- }
- } */
- // sets whether the user wishes to use a sld for this layer
- else if ($_REQUEST["function"] == "usesld")
- {
- if ( isset($_REQUEST["use_sld"]) )
- {
- $con = db_connect($DBSERVER,$OWNER,$PW);
- db_select_db($DB,$con);
- $sql = "UPDATE sld_user_layer SET use_sld=$1 WHERE fkey_gui_id=$2 AND fkey_layer_id=$3 AND fkey_mb_user_id=$4";
- $v = array($_REQUEST["use_sld"], $_SESSION["sld_gui_id"], $_SESSION["sld_layer_id"], $_SESSION["mb_user_id"]);
- $t = array('i', 's', 'i', 'i');
- $res = db_prep_query($sql,$v,$t);
-
- # update gui_wms_sldurl
- if ($_REQUEST["use_sld"]=="1") {
- $sld_url = $_REQUEST["mb_sld_url"];
- $sql = "UPDATE gui_wms SET gui_wms_sldurl=$1 WHERE fkey_gui_id=$2 AND fkey_wms_id=$3";
- $v = array($sld_url, $_SESSION["sld_gui_id"], $_SESSION["sld_wms_id"]);
- $t = array('s', 's', 'i');
- $res = db_prep_query($sql,$v,$t);
- }
- }
- }
-
-
-
-
- //MANIPULATE SLD FUNCTIONS - ADD & DELETE
- else if ($_REQUEST["function"] == "addrule")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->addRule();
- }
- }
- else if ($_REQUEST["function"] == "deleterule")
- {
- if ( isset($_REQUEST["id"]) && isset($_REQUEST["number"]) && isset($_SESSION["sld"]) )
- {
- $number = $_REQUEST["number"];
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->deleteRule($number);
- }
- }
- else if ($_REQUEST["function"] == "addsymbolizer")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"]))&&(isset($_REQUEST["symbolizer"])))
- {
- $symbolizer = $_REQUEST["symbolizer"];
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->addSymbolizer($symbolizer);
- }
- }
- else if ($_REQUEST["function"] == "deletesymbolizer")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) && isset($_REQUEST["number"]) )
- {
- $number = $_REQUEST["number"];
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->deleteSymbolizer($number);
- }
- }
- else if ($_REQUEST["function"] == "addcssparameter")
- {
- if (isset($_REQUEST["id"]) && isset($_SESSION["sld"]) && isset($_REQUEST["cssparameter"]))
- {
- $cssparameter = $_REQUEST["cssparameter"];
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->addCssParameter($cssparameter);
- }
- }
- else if ($_REQUEST["function"] == "deletecssparameter")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) && isset($_REQUEST["number"]) )
- {
- $number = $_REQUEST["number"];
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->deleteCssParameter($number);
- }
- }
-
- else if ($_REQUEST["function"] == "addlegendgraphic")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->legendgraphic = new LegendGraphic();
- }
- }
- else if ($_REQUEST["function"] == "deletelegendgraphic")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->legendgraphic = "";
- }
- }
-
- else if ($_REQUEST["function"] == "addcolormapentry")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->addColorMapEntry();
- }
- }
- else if ($_REQUEST["function"] == "deletecolormapentry")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) && isset($_REQUEST["number"]) )
- {
- $number = $_REQUEST["number"];
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->deleteColorMapEntry($number);
- }
- }
-
- else if ($_REQUEST["function"] == "addexternalgraphicormark")
- {
- if ((isset($_REQUEST["id"])) && (isset($_SESSION["sld"])) && isset($_REQUEST["externalgraphicormark"]))
- {
- $externalgraphicormark = $_REQUEST["externalgraphicormark"];
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->addExternalGraphicOrMark($externalgraphicormark);
- }
- }
- else if ($_REQUEST["function"] == "deleteexternalgraphicormark")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) && isset($_REQUEST["number"]) )
- {
- $number = $_REQUEST["number"];
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->deleteExternalGraphicOrMark($number);
- }
- }
-
- else if ($_REQUEST["function"] == "addgraphic")
- {
- if ((isset($_REQUEST["id"])) && (isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->graphic = new Graphic();
- }
- }
- else if ($_REQUEST["function"] == "deletegraphic")
- {
- if ((isset($_REQUEST["id"])) && (isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->graphic = "";
- }
- }
-
- else if ($_REQUEST["function"] == "addcolormap")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->colormap = new ColorMap();
- }
- }
- else if ($_REQUEST["function"] == "deletecolormap")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->colormap = "";
- }
- }
-
- else if ($_REQUEST["function"] == "addfont")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->font = new Font();
- }
- }
- else if ($_REQUEST["function"] == "deletefont")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->font = "";
- }
- }
-
- else if ($_REQUEST["function"] == "addlabelplacement")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->labelplacement = new LabelPlacement();
- }
- }
- else if ($_REQUEST["function"] == "deletelabelplacement")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->labelplacement = "";
- }
- }
-
- else if ($_REQUEST["function"] == "addhalo")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->halo = new Halo();
- }
- }
- else if ($_REQUEST["function"] == "deletehalo")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->halo = "";
- }
- }
-
- else if ($_REQUEST["function"] == "addfill")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->fill = new Fill();
- }
- }
- else if ($_REQUEST["function"] == "deletefill")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->fill = "";
- }
- }
-
- else if ($_REQUEST["function"] == "addstroke")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->stroke = new Stroke();
- }
- }
- else if ($_REQUEST["function"] == "deletestroke")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->stroke = "";
- }
- }
-
- else if ($_REQUEST["function"] == "addgraphicfill")
- {
- if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->graphicfill = new GraphicFill();
- }
- }
- else if ($_REQUEST["function"] == "deletegraphicfill")
- {
- if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
- {
- $id = $_REQUEST["id"];
- $_SESSION["sld_objects"][$id]->graphicfill = "";
- }
- }
- //TODO:
- //graphicstroke???
-
- else
- {
- echo "function ".$_REQUEST["function"]." is not defined!";
- }
-
-
-
- if ( $_REQUEST["function"] != "getdefaultsld" && $_REQUEST["function"] != "save" && $_REQUEST["function"] != "getusersld")
- {
- //Create the new SLD XML
- saveSld($_SESSION["sld_objects"][0]->generateXml());
- }
- if ( $_REQUEST["function"] != "getusersld" )
- {
- //header("Location: ".$MAPBENDER_URL."/sld/".$SLD_MAIN);
- //is ist faster to leave away the http?
- //redirect to a local file or to a http ressource?
- header("Location: ".$SLD_MAIN);
- }
-}
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/sld_function_handler.php (from rev 2404, branches/2.5/http/sld/sld_function_handler.php)
===================================================================
--- trunk/mapbender/http/sld/sld_function_handler.php (rev 0)
+++ trunk/mapbender/http/sld/sld_function_handler.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,452 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * This file realizes the function handling for the sld editor.
+ * Requests from the sld_edit_form are forwarded to this page.
+ * After processing the requested function this file forwards to the
+ * sld_main.php.
+ * Only if the request is to get the sld it will not forward to sld_main.php -
+ * in this case this file will return the requested sld-document instead.
+ *
+ * @package sld_function_handler
+ * @author Markus Krzyzanowski
+ */
+
+include_once(dirname(__FILE__)."/sld_config.php");
+include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+
+/**
+ * This function saves the data into the database
+ * @param string $data the content of the sld-document to be stored inside the database
+ */
+function saveSld($data)
+{
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db($DB,$con);
+ $sql = "UPDATE sld_user_layer SET sld_xml=$1 WHERE fkey_gui_id=$2 AND fkey_layer_id=$3 AND fkey_mb_user_id=$4";
+ $v = array($data, $_SESSION["sld_gui_id"], $_SESSION["sld_layer_id"], $_SESSION["mb_user_id"]);
+ $t = array('s', 's', 'i', 'i');
+ $res = db_prep_query($sql,$v,$t);
+}
+
+
+if (isset($_REQUEST["function"]))
+{
+ //MAIN FUNCTIONS:
+ if ($_REQUEST["function"] == "getdefaultsld")
+ {
+ $file = $mapfileUrl."VERSION=1.1.1&REQUEST=GetStyles&LAYERS=".urlencode($layer_name);
+ $data = readSld($file);
+ $data = char_encode($data);
+ saveSld($data);
+ }
+ else if ($_REQUEST["function"] == "save")
+ {
+ $styledlayerdescriptor = new StyledLayerDescriptor();
+ $styledlayerdescriptor->generateObjectFromPost();
+ saveSld($styledlayerdescriptor->generateXml());
+ }
+ /* the function "getusersld" is called by the mapserver to get the user's sld
+ else if ($_REQUEST["function"] == "getusersld")
+ {
+ if ( isset($_REQUEST["sld_layer_id"]) && isset($_REQUEST["sld_gui_id"]) && isset($_REQUEST["user_id"]) )
+ { //Used for the preview
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db($DB,$con);
+ $sql = "SELECT * FROM sld_user_layer WHERE fkey_gui_id=$1 AND fkey_layer_id=$2 AND fkey_mb_user_id=$3";
+ $v = array($_REQUEST["sld_gui_id"], $_REQUEST["sld_layer_id"], $_REQUEST["user_id"]);
+ $t = array('s', 'i', 'i');
+ $res = db_prep_query($sql,$v,$t);
+ if ( db_fetch_row($res, 0) )
+ {
+ //forcesld is used for the preview image to force the sld
+ if ( db_result($res, 0, "use_sld") == "1" || $_REQUEST["forcesld"] == "1" )
+ {
+ echo db_result($res, 0, "sld_xml");
+ }
+ }
+ } //Used for mapbender integration - old deprecated
+ else if ( isset($_REQUEST["layer_names"]) && isset($_REQUEST["user_id"]) )
+ {
+ $layer_names = split(",", urldecode($_REQUEST["layer_names"]));
+
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db($DB,$con);
+
+ #$sld_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<StyledLayerDescriptor version=\"1.0.0\">\n";
+ $sld_xml = "<StyledLayerDescriptor version=\"1.0.0\" xmlns=\"http://www.opengis.net/sld\" xmlns:ogc=\"http://www.opengis.net/ogc\">\n";
+
+ foreach ($layer_names as $layer_name)
+ {
+ $sql = "SELECT * FROM layer WHERE layer_name=$1";
+ $v = array($layer_name);
+ $t = array('s');
+ $res = db_prep_query($sql,$v,$t);
+
+ $layer_id = "";
+ if ( db_fetch_row($res, 0) )
+ {
+ $layer_id = db_result($res, 0, "fkey_layer_id");
+ $sql = "SELECT * FROM sld_user_layer WHERE fkey_layer_id=$1 AND fkey_mb_user_id=$2";
+ $v = array($layer_id, $_REQUEST["user_id"]);
+ $t = array('i', 'i');
+ $res = db_prep_query($sql,$v,$t);
+ if ( db_fetch_row($res, 0) )
+ {
+ if ( db_result($res, 0, "use_sld") == "1" )
+ {
+ $data = db_result($res, 0, "sld_xml");
+ $styledlayerdescriptor = parseSld($data);
+ $sld_xml .= $styledlayerdescriptor->layers[0]->generateXml(" ");
+ }
+ }
+ }
+ }
+ $sld_xml .= "</StyledLayerDescriptor>";
+ echo $sld_xml;
+ } //Used for mapbender integration
+ else if ( isset($_REQUEST["sld_wms_id"]) && isset($_REQUEST["sld_gui_id"]) )
+ {
+
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db($DB,$con);
+ $sql = "SELECT fkey_layer_id FROM gui_layer WHERE fkey_gui_id=$1 AND gui_layer_wms_id=$2";
+ $v = array($_REQUEST["sld_gui_id"], $_REQUEST["sld_wms_id"]);
+ $t = array('s', 'i');
+ $res = db_prep_query($sql,$v,$t);
+
+ $sld_xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
+ $sld_xml .= "<StyledLayerDescriptor version=\"1.0.0\" xmlns=\"http://www.opengis.net/sld\" xmlns:ogc=\"http://www.opengis.net/ogc\">\n";
+
+ while ($row = db_fetch_row($res))
+ {
+ $layer_id = $row[0];
+ $sql = "SELECT * FROM sld_user_layer WHERE fkey_layer_id=$1 AND fkey_gui_id=$2";
+ $v = array($layer_id, $_REQUEST["sld_gui_id"]);
+ $t = array('i', 's');
+ $res2 = db_prep_query($sql,$v,$t);
+ if ( db_fetch_row($res2, 0) )
+ {
+ if ( db_result($res2, 0, "use_sld") == "1" )
+ {
+ $data = db_result($res2, 0, "sld_xml");
+ $styledlayerdescriptor = parseSld($data);
+ $sld_xml .= $styledlayerdescriptor->layers[0]->generateXml(" ");
+ }
+ }
+ }
+ $sld_xml .= "</StyledLayerDescriptor>";
+ echo $sld_xml;
+ }
+ } */
+ // sets whether the user wishes to use a sld for this layer
+ else if ($_REQUEST["function"] == "usesld")
+ {
+ if ( isset($_REQUEST["use_sld"]) )
+ {
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db($DB,$con);
+ $sql = "UPDATE sld_user_layer SET use_sld=$1 WHERE fkey_gui_id=$2 AND fkey_layer_id=$3 AND fkey_mb_user_id=$4";
+ $v = array($_REQUEST["use_sld"], $_SESSION["sld_gui_id"], $_SESSION["sld_layer_id"], $_SESSION["mb_user_id"]);
+ $t = array('i', 's', 'i', 'i');
+ $res = db_prep_query($sql,$v,$t);
+
+ # update gui_wms_sldurl
+ if ($_REQUEST["use_sld"]=="1") {
+ $sld_url = $_REQUEST["mb_sld_url"];
+ $sql = "UPDATE gui_wms SET gui_wms_sldurl=$1 WHERE fkey_gui_id=$2 AND fkey_wms_id=$3";
+ $v = array($sld_url, $_SESSION["sld_gui_id"], $_SESSION["sld_wms_id"]);
+ $t = array('s', 's', 'i');
+ $res = db_prep_query($sql,$v,$t);
+ }
+ }
+ }
+
+
+
+
+ //MANIPULATE SLD FUNCTIONS - ADD & DELETE
+ else if ($_REQUEST["function"] == "addrule")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->addRule();
+ }
+ }
+ else if ($_REQUEST["function"] == "deleterule")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_REQUEST["number"]) && isset($_SESSION["sld"]) )
+ {
+ $number = $_REQUEST["number"];
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->deleteRule($number);
+ }
+ }
+ else if ($_REQUEST["function"] == "addsymbolizer")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"]))&&(isset($_REQUEST["symbolizer"])))
+ {
+ $symbolizer = $_REQUEST["symbolizer"];
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->addSymbolizer($symbolizer);
+ }
+ }
+ else if ($_REQUEST["function"] == "deletesymbolizer")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) && isset($_REQUEST["number"]) )
+ {
+ $number = $_REQUEST["number"];
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->deleteSymbolizer($number);
+ }
+ }
+ else if ($_REQUEST["function"] == "addcssparameter")
+ {
+ if (isset($_REQUEST["id"]) && isset($_SESSION["sld"]) && isset($_REQUEST["cssparameter"]))
+ {
+ $cssparameter = $_REQUEST["cssparameter"];
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->addCssParameter($cssparameter);
+ }
+ }
+ else if ($_REQUEST["function"] == "deletecssparameter")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) && isset($_REQUEST["number"]) )
+ {
+ $number = $_REQUEST["number"];
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->deleteCssParameter($number);
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addlegendgraphic")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->legendgraphic = new LegendGraphic();
+ }
+ }
+ else if ($_REQUEST["function"] == "deletelegendgraphic")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->legendgraphic = "";
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addcolormapentry")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->addColorMapEntry();
+ }
+ }
+ else if ($_REQUEST["function"] == "deletecolormapentry")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) && isset($_REQUEST["number"]) )
+ {
+ $number = $_REQUEST["number"];
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->deleteColorMapEntry($number);
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addexternalgraphicormark")
+ {
+ if ((isset($_REQUEST["id"])) && (isset($_SESSION["sld"])) && isset($_REQUEST["externalgraphicormark"]))
+ {
+ $externalgraphicormark = $_REQUEST["externalgraphicormark"];
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->addExternalGraphicOrMark($externalgraphicormark);
+ }
+ }
+ else if ($_REQUEST["function"] == "deleteexternalgraphicormark")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) && isset($_REQUEST["number"]) )
+ {
+ $number = $_REQUEST["number"];
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->deleteExternalGraphicOrMark($number);
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addgraphic")
+ {
+ if ((isset($_REQUEST["id"])) && (isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->graphic = new Graphic();
+ }
+ }
+ else if ($_REQUEST["function"] == "deletegraphic")
+ {
+ if ((isset($_REQUEST["id"])) && (isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->graphic = "";
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addcolormap")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->colormap = new ColorMap();
+ }
+ }
+ else if ($_REQUEST["function"] == "deletecolormap")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->colormap = "";
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addfont")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->font = new Font();
+ }
+ }
+ else if ($_REQUEST["function"] == "deletefont")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->font = "";
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addlabelplacement")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->labelplacement = new LabelPlacement();
+ }
+ }
+ else if ($_REQUEST["function"] == "deletelabelplacement")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->labelplacement = "";
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addhalo")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->halo = new Halo();
+ }
+ }
+ else if ($_REQUEST["function"] == "deletehalo")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->halo = "";
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addfill")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->fill = new Fill();
+ }
+ }
+ else if ($_REQUEST["function"] == "deletefill")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->fill = "";
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addstroke")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->stroke = new Stroke();
+ }
+ }
+ else if ($_REQUEST["function"] == "deletestroke")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->stroke = "";
+ }
+ }
+
+ else if ($_REQUEST["function"] == "addgraphicfill")
+ {
+ if ((isset($_REQUEST["id"]))&&(isset($_SESSION["sld"])))
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->graphicfill = new GraphicFill();
+ }
+ }
+ else if ($_REQUEST["function"] == "deletegraphicfill")
+ {
+ if ( isset($_REQUEST["id"]) && isset($_SESSION["sld"]) )
+ {
+ $id = $_REQUEST["id"];
+ $_SESSION["sld_objects"][$id]->graphicfill = "";
+ }
+ }
+ //TODO:
+ //graphicstroke???
+
+ else
+ {
+ echo "function ".$_REQUEST["function"]." is not defined!";
+ }
+
+
+
+ if ( $_REQUEST["function"] != "getdefaultsld" && $_REQUEST["function"] != "save" && $_REQUEST["function"] != "getusersld")
+ {
+ //Create the new SLD XML
+ saveSld($_SESSION["sld_objects"][0]->generateXml());
+ }
+ if ( $_REQUEST["function"] != "getusersld" )
+ {
+ //header("Location: ".$MAPBENDER_URL."/sld/".$SLD_MAIN);
+ //is ist faster to leave away the http?
+ //redirect to a local file or to a http ressource?
+ header("Location: ".$SLD_MAIN);
+ }
+}
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/sld_main.php
===================================================================
--- branches/2.5/http/sld/sld_main.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/sld_main.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,298 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * This is the main page of the sld-editor.
- * It displays the preview images and creates the sld_edit_form
- * used for editing the sld.
- *
- * @package sld_main
- * @author Markus Krzyzanowski
- */
-
-require_once(dirname(__FILE__)."/sld_config.php");
-require_once(dirname(__FILE__)."/../classes/class_wfs_conf.php");
-$classWfsConf = new wfs_conf();
-
-//read custom sld for this user&wms&layer&gui from the db instead using sld.xml
-
-$con = db_connect($DBSERVER,$OWNER,$PW);
-db_select_db($DB,$con);
-
-//Read the layer_id from the DB
-$dbutils = new DbUtils();
-$layer_id = $dbutils->getLayerIdFromLayerName($_SESSION["sld_wms_id"], $_SESSION["sld_layer_name"]);
-if ( $layer_id )
-{
- $_SESSION["sld_layer_id"] = $layer_id;
-}
-
-//Read the mb_user_id from the Session
-$mb_user_id = $_SESSION["mb_user_id"];
-
-
-//if layer is not found in DB
-if (!$layer_id)
-{
- echo "layer existiert nicht in Datenbank";
- exit();
-}
-else
-{
- //Try to read sld from the DB
- $sql = "SELECT * FROM sld_user_layer WHERE fkey_gui_id = $1 AND fkey_layer_id = $2 AND fkey_mb_user_id = $3";
- $v = array($_SESSION["sld_gui_id"], $layer_id, $mb_user_id);
- $t = array('s', 'i', 'i');
- $res = db_prep_query($sql,$v,$t);
- if (!$res || db_numrows($res)== 0)
- {
- //No user specific sld found in DB -> get it from the mapserver
- $file = $mapfileUrl."SERVICE=WMS&VERSION=1.1.1&REQUEST=GetStyles&LAYERS=".urlencode($layer_name);
- $data = readSld($file);
- $data = char_encode($data);
- //write the sld to the DB
- $sql = "INSERT INTO sld_user_layer(fkey_mb_user_id, fkey_layer_id, sld_xml, use_sld, fkey_gui_id) VALUES ($1, $2, $3, 0, $4);";
- $v = array($mb_user_id, $layer_id, $data, $_SESSION["sld_gui_id"]);
- $t = array('i', 'i', 's', 's');
- $res = @db_prep_query($sql,$v,$t);
- //Use the new sld
- }
- else
- {
- $data = db_result($res, 0, "sld_xml");
- $use_sld = db_result($res, 0, "use_sld");
- }
-}
-
-//$file = "sld.xml";
-//$data = readSld($file);
-
-$styledlayerdescriptor = parseSld($data);
-$_SESSION["sld"] = $data;
-
-/* Check for a related WFS featuretype */
-$wfs_conf_id = $dbutils->getLayerWfsConfId($_SESSION["sld_gui_id"], $layer_id);
-if ( $wfs_conf_id ) {
- $featuretype_id = $dbutils->getWfsConfFeatureTypeId($wfs_conf_id);
- $classWfsConf->getelements($featuretype_id);
- $wfs_element = $classWfsConf->elements;
- $fts = $styledlayerdescriptor->layers[0]->styles[0]->featuretypestyles[0];
- $fts->setElementArray("element_id",$wfs_element->element_id);
- $fts->setElementArray("element_name",$wfs_element->element_name);
-} else {
- $wfs_element = false;
-}
-
-/* create getMap-Url for preview with/without sld */
-$previewMapUrl = $dbutils->getPreviewMapUrl($_SESSION["sld_gui_id"], $layer_id, $_SESSION["sld_wms_id"]);
-
-echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
-echo "<html>\n";
-echo "<head>\n";
-echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n";
-echo "<meta HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n";
-echo "<META HTTP-EQUIV=\"PRAGMA\" CONTENT=\"NO-CACHE\">\n";
-echo "<title>Mapbender - SLD Editor</title>\n";
-echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/sldEditor.css\">\n";
-echo "</head>\n";
-echo "<body leftmargin=\"10\" topmargin=\"0\">\n";
-
-## - Fensteranfang
-echo "<table width=\"800px\" border='0' cellspacing='0'>\n";
-## - 1.Zeile
-echo " <tr>\n";
-echo " <td class='text2 bg2' colspan='2'>\n";
-echo " Vorschau mit SLD:\n";
-echo " </td>\n";
-echo " <td>\n";
-echo " \n";
-echo " </td>\n";
-echo " <td class='text2 bg2' colspan='2'>\n";
-echo " Original ohne SLD:\n";
-echo " </td>\n";
-echo " </tr>\n";
-
-## - Build URL to SLD
-$sld_url = "";
-$mb_sld_url = "";
-//$sld_url = "http://".$_SERVER["HTTP_HOST"]."/mapbender/sld/sld_function_handler.php?function=getusersld&layer_id=".$layer_id."&user_id=".$mb_user_id."&forcesld=1";
-$sld_url = $MAPBENDER_URL."/sld_function_getusersld.php?function=getusersld&sld_gui_id=".$_SESSION["sld_gui_id"]."&sld_layer_id=".$layer_id."&user_id=".$mb_user_id."&forcesld=1";
-$mb_sld_url = $MAPBENDER_URL."/sld_function_getusersld.php?function=getusersld&sld_gui_id=".$_SESSION["sld_gui_id"]."&sld_wms_id=".$_SESSION["sld_wms_id"]."&user_id=".$mb_user_id;
-echo "<!-- $sld_url -->";
-echo "<!-- $previewMapUrl -->";
-## - 2.Zeile
-/*
-echo " <tr align='right'>\n";
-echo " <td class='line_left2 text4'>\n";
-echo " Karte";
-echo " </td>\n";
-echo " <td class='line_right2'>\n";
-echo " <img src='./img/map_magnify.png' border='0' alt='Originalgröße im neuen Fenster anzeigen' onClick=\"window.open('map.php','','fullsreen=yes,resizable=no,scrollbars=yes');\">\n";
-echo " </td>\n";
-echo " <td>\n";
-echo " \n";
-echo " </td>\n";
-echo " <td class='line_left2 text4'>\n";
-echo " Karte";
-echo " </td>\n";
-echo " <td class='line_right2'>\n";
-echo " <img src='./img/map_magnify.png' border='0' alt='Originalgröße im neuen Fenster anzeigen' onClick=\"window.open('map_original.php','','fullsreen=yes,resizable=no,scrollbars=yes');\">\n";
-echo " </td>\n";
-echo " </tr>\n";
-*/
-
-## - 3.Zeile
-echo " <tr align='center'>\n";
-echo " <td class='line_left2 line_right2' colspan='2'>\n";
-
-## - Map with SLD
-//Added rand(...) to force a reload of the image because the url should be different
-echo " <img src=\"".$previewMapUrl."&WIDTH=320&HEIGHT=240&sld=".urlencode($sld_url)."&".rand(0,10000)."\" border=\"0\" width=\"320\" height=\"240\">";
-echo " </td>\n";
-
-echo " <td>\n";
-echo " \n";
-echo " </td>\n";
-
-echo " <td class='line_left2 line_right2' colspan='2'>\n";
-
-## - Map without SLD
-echo " <img src=\"".$previewMapUrl."&WIDTH=320&HEIGHT=240\" border=\"0\" width=\"320\" height=\"240\">";
-echo " </td>\n";
-
-#4.Zeile
-echo " <tr>\n";
-echo " <td class='line_left2 line_right2 text4' colspan='2'>\n";
-echo " Legende\n";
-echo " </td>\n";
-echo " <td>\n";
-echo " \n";
-echo " </td>\n";
-echo " <td class='line_left2 line_right2 text4' colspan='2'>\n";
-echo " Legende\n";
-echo " </td>\n";
-echo " </tr>\n";
-
-#5.Zeile
-echo " <tr>\n";
-echo " <td class='line_left2 line_down2 line_right2' colspan='2'>\n";
-echo " \n";
-## - Legend with SLD
-echo " <img src=\"".$mapfileUrl."VERSION=1.1.0&REQUEST=GetLegendGraphic&SERVICE=WMS&LAYER=".urlencode($layer_name)."&FORMAT=image/png&sld=".urlencode($sld_url)."&".rand(0,10000)."\">\n";
-echo " </td>\n";
-echo " \n";
-echo " <td>\n";
-echo " \n";
-echo " </td>\n";
-echo " <td class='line_left2 line_down2 line_right2' colspan='2'>\n";
-echo " \n";
-## - Legend without SLD
-echo " <img src=\"".$mapfileUrl."VERSION=1.1.0&REQUEST=GetLegendGraphic&SERVICE=WMS&LAYER=".urlencode($layer_name)."&FORMAT=image/png\">";
-echo " </td>\n";
-echo " </tr>\n";
-echo "</table>\n";
-
-echo "<br>\n";
-
-echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
-echo " <tr valign=\"top\">\n";
-echo " <td>\n";
-
-echo " <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
-echo " <tr align=\"center\">\n";
-echo " <td class=\"bg2 text3\">MENU</td>\n";
-echo " </tr>\n";
-echo " <tr>\n";
-echo " <td class=\"line_left2 line_down2 line_right2 text4 bg_menu\">\n";
-
-//echo " <form name=\"use_sld\" action=\"http://".$_SERVER["HTTP_HOST"]."/mapbender/sld/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
-echo " <form name=\"use_sld\" action=\"".$MAPBENDER_URL."/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
-echo " <input type=\"hidden\" name=\"function\" value=\"usesld\">\n";
-echo " <input type=\"hidden\" name=\"sld_url\" value=\"".$sld_url."\">\n";
-echo " <input type=\"hidden\" name=\"mb_sld_url\" value=\"".$mb_sld_url."\">\n";
-echo " Ansicht in Mapbender <br>\n";
-
-echo " <input type=\"radio\" name=\"use_sld\" value=\"0\"";
-if ($use_sld == 0) echo " checked";
-echo " onClick=\"submit()\">\n";
-echo " Original ohne SLD <br>";
-
-echo " <input type=\"radio\" name=\"use_sld\" value=\"1\"";
-if ($use_sld == 1) echo " checked";
-echo " onClick=\"submit()\">\n";
-echo " mit SLD <br>";
-echo " </form>\n";
-echo " </td>\n";
-echo " </tr>\n";
-echo " <tr align=\"left\">\n";
-echo " <td class=\"line_left2 line_down2 line_right2 text1 bg_menu\" style=\"padding:3px;\">\n";
-
-//echo " <form id=\"sld_editor_form\" action=\"http://".$_SERVER["HTTP_HOST"]."/mapbender/sld/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
-echo " <form id=\"sld_editor_form\" action=\"".$MAPBENDER_URL."/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
-
-echo " <a href='".$SLD_FUNCTION_HANDLER."&function=getdefaultsld' onclick='if(!confirm(\"Aktuelle SLD-Definition ersetzen?\")) return false;'>\n";
-echo " <img src='./img/script.png' border='0' alt='Standard SLD aus WMS auslesen'>\n";
-echo " </a> Standard öffnen<br /><br />\n";
-
-echo " <input type='image' src='./img/script_save.png' border='0' alt='Änderungen an die Map senden'>\n";
-echo " SLD speichern<br>\n";
-echo " <input type='hidden' name='function' value='save'>\n";
-echo " <br /><a href=\"".$sld_url."\" target=_new>";
-echo " <img src='./img/script_code_red.png' border='0' alt='SLD anzeigen'>\n";
-echo " </a>";
-echo " SLD anzeigen";
-
-echo " </td>\n";
-echo " </tr>\n";
-echo " </table>\n";
-
-echo " </td>\n";
-echo " <td>\n";
-echo " ";
-echo " </td>\n";
-echo " <td>\n";
-
-## - Fenster Eigenschaft
-echo " <table border='0' cellspacing='0' cellpadding='0'>\n";
-echo " <tr align='center'>\n";
-echo " <td class='bg2 text3'>SLD Eigenschaften</td>\n";
-echo " </tr>\n";
-echo " <tr>\n";
-echo " <td class='line_left2 line_down2 line_right2'>\n";
-
-echo $styledlayerdescriptor->generateHtmlForm(""," ");
-
-echo " </td>\n";
-echo " </tr>\n";
-echo " </table>\n";
-echo " </form>\n";
-
-echo " </td>\n";
-echo " </tr>\n";
-echo "</table>\n";
-echo "<!-- ";
-print_r ($wfs_element);
-print_r ($_SESSION["sld_objects"][3]);
-echo "-->";
-echo "</body>\n";
-echo "</html>\n";
-##Debug
-//echo "------------------------------------------------------------------\n";
-//echo $styledlayerdescriptor->generateXml();
-?>
\ No newline at end of file
Copied: trunk/mapbender/http/sld/sld_main.php (from rev 2404, branches/2.5/http/sld/sld_main.php)
===================================================================
--- trunk/mapbender/http/sld/sld_main.php (rev 0)
+++ trunk/mapbender/http/sld/sld_main.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,298 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * This is the main page of the sld-editor.
+ * It displays the preview images and creates the sld_edit_form
+ * used for editing the sld.
+ *
+ * @package sld_main
+ * @author Markus Krzyzanowski
+ */
+
+require_once(dirname(__FILE__)."/sld_config.php");
+require_once(dirname(__FILE__)."/../classes/class_wfs_conf.php");
+$classWfsConf = new wfs_conf();
+
+//read custom sld for this user&wms&layer&gui from the db instead using sld.xml
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db($DB,$con);
+
+//Read the layer_id from the DB
+$dbutils = new DbUtils();
+$layer_id = $dbutils->getLayerIdFromLayerName($_SESSION["sld_wms_id"], $_SESSION["sld_layer_name"]);
+if ( $layer_id )
+{
+ $_SESSION["sld_layer_id"] = $layer_id;
+}
+
+//Read the mb_user_id from the Session
+$mb_user_id = $_SESSION["mb_user_id"];
+
+
+//if layer is not found in DB
+if (!$layer_id)
+{
+ echo "layer existiert nicht in Datenbank";
+ exit();
+}
+else
+{
+ //Try to read sld from the DB
+ $sql = "SELECT * FROM sld_user_layer WHERE fkey_gui_id = $1 AND fkey_layer_id = $2 AND fkey_mb_user_id = $3";
+ $v = array($_SESSION["sld_gui_id"], $layer_id, $mb_user_id);
+ $t = array('s', 'i', 'i');
+ $res = db_prep_query($sql,$v,$t);
+ if (!$res || db_numrows($res)== 0)
+ {
+ //No user specific sld found in DB -> get it from the mapserver
+ $file = $mapfileUrl."SERVICE=WMS&VERSION=1.1.1&REQUEST=GetStyles&LAYERS=".urlencode($layer_name);
+ $data = readSld($file);
+ $data = char_encode($data);
+ //write the sld to the DB
+ $sql = "INSERT INTO sld_user_layer(fkey_mb_user_id, fkey_layer_id, sld_xml, use_sld, fkey_gui_id) VALUES ($1, $2, $3, 0, $4);";
+ $v = array($mb_user_id, $layer_id, $data, $_SESSION["sld_gui_id"]);
+ $t = array('i', 'i', 's', 's');
+ $res = @db_prep_query($sql,$v,$t);
+ //Use the new sld
+ }
+ else
+ {
+ $data = db_result($res, 0, "sld_xml");
+ $use_sld = db_result($res, 0, "use_sld");
+ }
+}
+
+//$file = "sld.xml";
+//$data = readSld($file);
+
+$styledlayerdescriptor = parseSld($data);
+$_SESSION["sld"] = $data;
+
+/* Check for a related WFS featuretype */
+$wfs_conf_id = $dbutils->getLayerWfsConfId($_SESSION["sld_gui_id"], $layer_id);
+if ( $wfs_conf_id ) {
+ $featuretype_id = $dbutils->getWfsConfFeatureTypeId($wfs_conf_id);
+ $classWfsConf->getelements($featuretype_id);
+ $wfs_element = $classWfsConf->elements;
+ $fts = $styledlayerdescriptor->layers[0]->styles[0]->featuretypestyles[0];
+ $fts->setElementArray("element_id",$wfs_element->element_id);
+ $fts->setElementArray("element_name",$wfs_element->element_name);
+} else {
+ $wfs_element = false;
+}
+
+/* create getMap-Url for preview with/without sld */
+$previewMapUrl = $dbutils->getPreviewMapUrl($_SESSION["sld_gui_id"], $layer_id, $_SESSION["sld_wms_id"]);
+
+echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
+echo "<html>\n";
+echo "<head>\n";
+echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n";
+echo "<meta HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n";
+echo "<META HTTP-EQUIV=\"PRAGMA\" CONTENT=\"NO-CACHE\">\n";
+echo "<title>Mapbender - SLD Editor</title>\n";
+echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/sldEditor.css\">\n";
+echo "</head>\n";
+echo "<body leftmargin=\"10\" topmargin=\"0\">\n";
+
+## - Fensteranfang
+echo "<table width=\"800px\" border='0' cellspacing='0'>\n";
+## - 1.Zeile
+echo " <tr>\n";
+echo " <td class='text2 bg2' colspan='2'>\n";
+echo " Vorschau mit SLD:\n";
+echo " </td>\n";
+echo " <td>\n";
+echo " \n";
+echo " </td>\n";
+echo " <td class='text2 bg2' colspan='2'>\n";
+echo " Original ohne SLD:\n";
+echo " </td>\n";
+echo " </tr>\n";
+
+## - Build URL to SLD
+$sld_url = "";
+$mb_sld_url = "";
+//$sld_url = "http://".$_SERVER["HTTP_HOST"]."/mapbender/sld/sld_function_handler.php?function=getusersld&layer_id=".$layer_id."&user_id=".$mb_user_id."&forcesld=1";
+$sld_url = $MAPBENDER_URL."/sld_function_getusersld.php?function=getusersld&sld_gui_id=".$_SESSION["sld_gui_id"]."&sld_layer_id=".$layer_id."&user_id=".$mb_user_id."&forcesld=1";
+$mb_sld_url = $MAPBENDER_URL."/sld_function_getusersld.php?function=getusersld&sld_gui_id=".$_SESSION["sld_gui_id"]."&sld_wms_id=".$_SESSION["sld_wms_id"]."&user_id=".$mb_user_id;
+echo "<!-- $sld_url -->";
+echo "<!-- $previewMapUrl -->";
+## - 2.Zeile
+/*
+echo " <tr align='right'>\n";
+echo " <td class='line_left2 text4'>\n";
+echo " Karte";
+echo " </td>\n";
+echo " <td class='line_right2'>\n";
+echo " <img src='./img/map_magnify.png' border='0' alt='Originalgröße im neuen Fenster anzeigen' onClick=\"window.open('map.php','','fullsreen=yes,resizable=no,scrollbars=yes');\">\n";
+echo " </td>\n";
+echo " <td>\n";
+echo " \n";
+echo " </td>\n";
+echo " <td class='line_left2 text4'>\n";
+echo " Karte";
+echo " </td>\n";
+echo " <td class='line_right2'>\n";
+echo " <img src='./img/map_magnify.png' border='0' alt='Originalgröße im neuen Fenster anzeigen' onClick=\"window.open('map_original.php','','fullsreen=yes,resizable=no,scrollbars=yes');\">\n";
+echo " </td>\n";
+echo " </tr>\n";
+*/
+
+## - 3.Zeile
+echo " <tr align='center'>\n";
+echo " <td class='line_left2 line_right2' colspan='2'>\n";
+
+## - Map with SLD
+//Added rand(...) to force a reload of the image because the url should be different
+echo " <img src=\"".$previewMapUrl."&WIDTH=320&HEIGHT=240&sld=".urlencode($sld_url)."&".rand(0,10000)."\" border=\"0\" width=\"320\" height=\"240\">";
+echo " </td>\n";
+
+echo " <td>\n";
+echo " \n";
+echo " </td>\n";
+
+echo " <td class='line_left2 line_right2' colspan='2'>\n";
+
+## - Map without SLD
+echo " <img src=\"".$previewMapUrl."&WIDTH=320&HEIGHT=240\" border=\"0\" width=\"320\" height=\"240\">";
+echo " </td>\n";
+
+#4.Zeile
+echo " <tr>\n";
+echo " <td class='line_left2 line_right2 text4' colspan='2'>\n";
+echo " Legende\n";
+echo " </td>\n";
+echo " <td>\n";
+echo " \n";
+echo " </td>\n";
+echo " <td class='line_left2 line_right2 text4' colspan='2'>\n";
+echo " Legende\n";
+echo " </td>\n";
+echo " </tr>\n";
+
+#5.Zeile
+echo " <tr>\n";
+echo " <td class='line_left2 line_down2 line_right2' colspan='2'>\n";
+echo " \n";
+## - Legend with SLD
+echo " <img src=\"".$mapfileUrl."VERSION=1.1.0&REQUEST=GetLegendGraphic&SERVICE=WMS&LAYER=".urlencode($layer_name)."&FORMAT=image/png&sld=".urlencode($sld_url)."&".rand(0,10000)."\">\n";
+echo " </td>\n";
+echo " \n";
+echo " <td>\n";
+echo " \n";
+echo " </td>\n";
+echo " <td class='line_left2 line_down2 line_right2' colspan='2'>\n";
+echo " \n";
+## - Legend without SLD
+echo " <img src=\"".$mapfileUrl."VERSION=1.1.0&REQUEST=GetLegendGraphic&SERVICE=WMS&LAYER=".urlencode($layer_name)."&FORMAT=image/png\">";
+echo " </td>\n";
+echo " </tr>\n";
+echo "</table>\n";
+
+echo "<br>\n";
+
+echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
+echo " <tr valign=\"top\">\n";
+echo " <td>\n";
+
+echo " <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
+echo " <tr align=\"center\">\n";
+echo " <td class=\"bg2 text3\">MENU</td>\n";
+echo " </tr>\n";
+echo " <tr>\n";
+echo " <td class=\"line_left2 line_down2 line_right2 text4 bg_menu\">\n";
+
+//echo " <form name=\"use_sld\" action=\"http://".$_SERVER["HTTP_HOST"]."/mapbender/sld/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
+echo " <form name=\"use_sld\" action=\"".$MAPBENDER_URL."/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
+echo " <input type=\"hidden\" name=\"function\" value=\"usesld\">\n";
+echo " <input type=\"hidden\" name=\"sld_url\" value=\"".$sld_url."\">\n";
+echo " <input type=\"hidden\" name=\"mb_sld_url\" value=\"".$mb_sld_url."\">\n";
+echo " Ansicht in Mapbender <br>\n";
+
+echo " <input type=\"radio\" name=\"use_sld\" value=\"0\"";
+if ($use_sld == 0) echo " checked";
+echo " onClick=\"submit()\">\n";
+echo " Original ohne SLD <br>";
+
+echo " <input type=\"radio\" name=\"use_sld\" value=\"1\"";
+if ($use_sld == 1) echo " checked";
+echo " onClick=\"submit()\">\n";
+echo " mit SLD <br>";
+echo " </form>\n";
+echo " </td>\n";
+echo " </tr>\n";
+echo " <tr align=\"left\">\n";
+echo " <td class=\"line_left2 line_down2 line_right2 text1 bg_menu\" style=\"padding:3px;\">\n";
+
+//echo " <form id=\"sld_editor_form\" action=\"http://".$_SERVER["HTTP_HOST"]."/mapbender/sld/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
+echo " <form id=\"sld_editor_form\" action=\"".$MAPBENDER_URL."/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
+
+echo " <a href='".$SLD_FUNCTION_HANDLER."&function=getdefaultsld' onclick='if(!confirm(\"Aktuelle SLD-Definition ersetzen?\")) return false;'>\n";
+echo " <img src='./img/script.png' border='0' alt='Standard SLD aus WMS auslesen'>\n";
+echo " </a> Standard öffnen<br /><br />\n";
+
+echo " <input type='image' src='./img/script_save.png' border='0' alt='Änderungen an die Map senden'>\n";
+echo " SLD speichern<br>\n";
+echo " <input type='hidden' name='function' value='save'>\n";
+echo " <br /><a href=\"".$sld_url."\" target=_new>";
+echo " <img src='./img/script_code_red.png' border='0' alt='SLD anzeigen'>\n";
+echo " </a>";
+echo " SLD anzeigen";
+
+echo " </td>\n";
+echo " </tr>\n";
+echo " </table>\n";
+
+echo " </td>\n";
+echo " <td>\n";
+echo " ";
+echo " </td>\n";
+echo " <td>\n";
+
+## - Fenster Eigenschaft
+echo " <table border='0' cellspacing='0' cellpadding='0'>\n";
+echo " <tr align='center'>\n";
+echo " <td class='bg2 text3'>SLD Eigenschaften</td>\n";
+echo " </tr>\n";
+echo " <tr>\n";
+echo " <td class='line_left2 line_down2 line_right2'>\n";
+
+echo $styledlayerdescriptor->generateHtmlForm(""," ");
+
+echo " </td>\n";
+echo " </tr>\n";
+echo " </table>\n";
+echo " </form>\n";
+
+echo " </td>\n";
+echo " </tr>\n";
+echo "</table>\n";
+echo "<!-- ";
+print_r ($wfs_element);
+print_r ($_SESSION["sld_objects"][3]);
+echo "-->";
+echo "</body>\n";
+echo "</html>\n";
+##Debug
+//echo "------------------------------------------------------------------\n";
+//echo $styledlayerdescriptor->generateXml();
+?>
\ No newline at end of file
Deleted: trunk/mapbender/http/sld/sld_parse.php
===================================================================
--- branches/2.5/http/sld/sld_parse.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/sld_parse.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,906 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD/sld_config.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Parses the sld-documents and creates the object structure.
- * This file does the parsing of the sld-data.
- * For all sld-elements that cannot be converted to a trivial datatype
- * a corresponding object is created.
- *
- * Creates the sld_objects and the sld_parent $_SESSION variables.
- * sld_objects is an array that contains the objects.
- * sld_parent is an array that contains the index of the object's parent object in sld_objects.
- * These variables are used to easily access the objects.
- *
- * @see sld_classes.php contains the class definitions
- * @package sld_parse
- * @author Markus Krzyzanowski
- */
-
-//require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-
-/**
- * Creates a empty SLD object up to the rule object
- *
- * @return StyledLayerDescriptor
- */
-function createEmptySLD() {
- $styledlayerdescriptor = new StyledLayerDescriptor();
- $layer = new NamedLayer();
- $style = new UserStyle();
- $fts = new FeatureTypeStyle();
- $rule = new Rule();
-
- $fts->rules[] = $rule;
- $style->featuretypestyles[] = $fts;
- $layer->styles[] = $style;
- $layer->name = $_SESSION["sld_layer_name"];
- $styledlayerdescriptor->layers[] = $layer;
- $styledlayerdescriptor->version = "1.0.0";
- $styledlayerdescriptor->id = 0;
- $styledlayerdescriptor->parent = false;
-
- return $styledlayerdescriptor;
-}
-
-/**
- * Opens the file at the specified URL and returns the content.
- *
- * @param string $file URL of the file
- * @return string content of the file
- */
-function readSld($file)
-{
- if (!($fp = fopen($file, "rb")))
- {
- die("could not open XML input - ".$file);
- }
-
- $data = "";
-
- while(!feof($fp))
- {
- $data .= fread($fp, 1024);
-
- }
- return $data;
-}
-
-/**
- * Parses the data and creates the object structure.
- *
- * @param string $data data to be parsed
- * @return StyledLayerDesciptor root object of the sld-document
- */
-function parseSld($data)
-{
- $xml_parser = xml_parser_create();
- xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0);
- xml_parse_into_struct($xml_parser, $data, $vals, $index);
- xml_parser_free($xml_parser);
-
- $styledlayerdescriptor;
- $parent = array();
- $objects = array();
- $parentactual = 0;
-
- for ($i=0; $i<count($vals); $i++)
- {
- $element = $vals[$i];
- $tag = $element["tag"];
- $tagname=strtoupper($tag);
- switch($tagname)
- {
- // uh, the server responded with an error, should be break or start with an empty sld?
- case "SERVICEEXCEPTIONREPORT":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = false;
- $parentactual = 0;
- /*
- $styledlayerdescriptor = new StyledLayerDescriptor();
- $styledlayerdescriptor->version = "1.0.0";
- //Experimental:
- */
- $styledlayerdescriptor = createEmptySLD();
- $styledlayerdescriptor->id = 0;
- $styledlayerdescriptor->parent = false;
- //END Experimental
- $objects[] = &$styledlayerdescriptor;
- if ($element["type"] == "complete")
- {
- $parentactual = false;
- }
- $_SESSION["sld_objects"] = $objects;
- $_SESSION["sld_parent"] = $parent;
- return $styledlayerdescriptor;
- }
- case "STYLEDLAYERDESCRIPTOR":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = false;
- $parentactual = 0;
- $styledlayerdescriptor = new StyledLayerDescriptor();
- $styledlayerdescriptor->version = $element["attributes"]["version"];
- //Experimental:
- $styledlayerdescriptor->id = 0;
- $styledlayerdescriptor->parent = false;
- //END Experimental
- $objects[] = &$styledlayerdescriptor;
- if ($element["type"] == "complete")
- {
- $parentactual = false;
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "NAMEDLAYER":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new NamedLayer();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->layers[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "NAME":
- if ($element["type"] == "complete")
- {
- //TODO - workaround suchen...!!!
- //echo "-------------\n";
- //echo $element["value"]."\n";
- //$element["value"] = str_replace("<","<",$element["value"]);
- //$element["value"] = str_replace(">",">",$element["value"]);
- $objects[$parentactual]->name = $element["value"];
- }
- break;
- case "TITLE":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->title = $element["value"];
- }break;
- case "ABSTRACT":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->abstract = $element["value"];
- }
- break;
- case "MINSCALEDENOMINATOR":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->minscaledenominator = $element["value"];
- }
- break;
- case "MAXSCALEDENOMINATOR":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->maxscaledenominator = $element["value"];
- }
- break;
- case "USERSTYLE":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new UserStyle();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->styles[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "FEATURETYPESTYLE":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new FeatureTypeStyle();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->featuretypestyles[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "RULE":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new Rule();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->rules[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "LINESYMBOLIZER":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new LineSymbolizer();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->symbolizers[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "POLYGONSYMBOLIZER":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new PolygonSymbolizer();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->symbolizers[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "POINTSYMBOLIZER":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new PointSymbolizer();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->symbolizers[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "TEXTSYMBOLIZER":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new TextSymbolizer();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->symbolizers[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "RASTERSYMBOLIZER":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new RasterSymbolizer();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->symbolizers[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "LEGENDGRAPHIC":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new LegendGraphic();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->legendgraphic = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- //Commented out - Filters will be created through the creation of xml in the default case
- // case "ELSEFILTER":
- // if ($element["type"] == "complete")
- // {
- // $objects[$parentactual]->filter = new ElseFilter();
- // }
- // break;
- // case "OGC:FILTER": //TODO
- // if ($element["type"] == "complete")
- // {
- // //Create a new ElseFilter and write it to the parent object
- // $objects[$parentactual]->filter = new ElseFilter();
- // }
- // break;
- case "GRAPHIC":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new Graphic();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
-
- $objects[$parentactual]->graphic = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "EXTERNALGRAPHIC":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new ExternalGraphic();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->externalgraphicsormarks[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "ONLINERESOURCE":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->onlineresource = $element["attributes"]["xlink:href"];
- }
- break;
- case "FORMAT":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->format = $element["value"];
- }
- break;
- case "STROKE":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new Stroke();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->stroke = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "CSSPARAMETER":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->cssparameters[] = new CssParameter();
- //Experimental:
- $objects[$parentactual]->cssparameters[count($objects[$parentactual]->cssparameters)-1]->id = count($parent)-1;
- $objects[$parentactual]->cssparameters[count($objects[$parentactual]->cssparameters)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->cssparameters[count($objects[$parentactual]->cssparameters)-1]->name = $element["attributes"]["name"];
- $objects[$parentactual]->cssparameters[count($objects[$parentactual]->cssparameters)-1]->value = $element["value"];
- }
- break;
- case "GRAPHICFILL":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new GraphicFill();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
-
-
- //print_r($objects[count($parent)-1]);
-
- $objects[$parentactual]->graphicfill = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "GRAPHICSTROKE":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new GraphicStroke();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->graphicstroke = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "FILL":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new Fill();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->fill = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "MARK":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new Mark();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->externalgraphicsormarks[] = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "WELLKNOWNNAME":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->wellknownname = $element["value"];
- }
- break;
- case "FONT":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new Font();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->font = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "LABELPLACEMENT":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new LabelPlacement();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->labelplacement = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "POINTPLACEMENT":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new PointPlacement();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->placement = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "ANCHORPOINT":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new AnchorPoint();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->anchorpoint = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "DISPLACEMENT":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new Displacement();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->displacement = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "HALO":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new Halo();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->halo = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "COLORMAP":
- if ($element["type"] == "open" || $element["type"] == "complete")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new ColorMap();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->colormap = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- if ($element["type"] == "complete")
- {
- $parentactual = $parent[$parentactual];
- }
- }
- else if($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "COLORMAPENTRY":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->colormapentries[] = new ColorMapEntry();
- //Experimental:
- $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->id = count($parent)-1;
- $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->color = $element["attributes"]["color"];
- $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->opacity = $element["attributes"]["opacity"];
- $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->quantity = $element["attributes"]["quantity"];
- $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->label = $element["attributes"]["label"];
- }
- break;
- case "LABEL":
- if ($element["type"] == "complete")
- {
- //Kl�ren, ob Label nur so vorkommen kann - TODO
- //$objects[$parentactual]->label = $element["value"];
-
- //use the new ParameterValue class to store the mixed content value
- //simple case no extra markup ...
- //the label is instanciated by TextSymbolizer
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new ParameterValue();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- $objects[count($parent)-1]->value = $element["value"];
- //END Experimental
- $objects[$parentactual]->label = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- $parentactual = $parent[$parentactual];
- }
- elseif ($element["type"] == "open")
- {
- $parent[] = $parentactual;
- $objects[count($parent)-1] = new ParameterValue();
- //Experimental:
- $objects[count($parent)-1]->id = count($parent)-1;
- $objects[count($parent)-1]->parent = $parentactual;
- //END Experimental
- $objects[$parentactual]->label = &$objects[count($parent)-1];
- $parentactual = count($parent)-1;
- }
- elseif ($element["type"] == "close")
- {
- $parentactual = $parent[$parentactual];
- }
- break;
- case "RADIUS":
- if ($element["type"] == "complete")
- {
- //Kl�ren, ob Radius nur so vorkommen kann - TODO
- $objects[$parentactual]->radius = $element["value"];
- }
- break;
- case "OPACITY":
- if ($element["type"] == "complete")
- {
- //Kl�ren, ob Opacity nur so vorkommen kann - TODO
- $objects[$parentactual]->opacity = $element["value"];
- }
- break;
- case "SIZE":
- if ($element["type"] == "complete")
- {
- //Kl�ren, ob Size nur so vorkommen kann - TODO
- $objects[$parentactual]->size = $element["value"];
- }
- break;
- case "ROTATION":
- if ($element["type"] == "complete")
- {
- //Kl�ren, ob Rotation nur so vorkommen kann - TODO
- $objects[$parentactual]->rotation = $element["value"];
- }
- break;
- case "ANCHORPOINTX":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->anchorpointx = $element["value"];
- }
- break;
- case "ANCHORPOINTY":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->anchorpointy = $element["value"];
- }
- break;
- case "DISPLACEMENTX":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->displacementx = $element["value"];
- }
- break;
- case "DISPLACEMENTY":
- if ($element["type"] == "complete")
- {
- $objects[$parentactual]->displacementy = $element["value"];
- }
- break;
- //TODO: Kl�ren mit sld:parameterValueType
- //bei den folgenden XML Elementen
- case "PROPERTYNAME":
- if ($element["type"] == "complete")
- {
- if ($temp == "") {
- $objects[$parentactual]->value = $element["value"];
- $parentactual = count($parent)-1;
- }
- else {
- die($temp);
- }
- }
- break;
- //END TODO
- //von den vorhergegangenen XML Elementen
-
-
- default:
- $temp = "";
- if ($element["type"] == "open")
- {
- $temp .= "<".$tag;
- if ($element["attributes"] != "")
- {
- $keys = array_keys($element["attributes"]);
- foreach ($keys as $key)
- {
- $temp .= " ".$key."=\"".$element["attributes"][$key]."\"";
- }
- }
- $temp .= ">";
- }
- if ($element["type"] == "close")
- {
- $temp .= "</".$tag.">";
- }
- if ($element["type"] == "complete")
- {
- $temp .= "<".$tag.">";
- $temp .= $element["value"];
- $temp .= "</".$tag.">";
- }
- //Wenn Parent vom Typ Rule, dann muss es ein Filter sein, also hinzuf�gen
- if (strtoupper(get_class($objects[$parentactual])) == "RULE")
- {
- $objects[$parentactual]->filter .= $temp;
- $temp = "";
- }
- }
- }
-
-
- //print_r($objects);
-
-
- $_SESSION["sld_objects"] = $objects;
- $_SESSION["sld_parent"] = $parent;
-
- return $styledlayerdescriptor;
-}
-?>
Copied: trunk/mapbender/http/sld/sld_parse.php (from rev 2404, branches/2.5/http/sld/sld_parse.php)
===================================================================
--- trunk/mapbender/http/sld/sld_parse.php (rev 0)
+++ trunk/mapbender/http/sld/sld_parse.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,906 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD/sld_config.php
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Parses the sld-documents and creates the object structure.
+ * This file does the parsing of the sld-data.
+ * For all sld-elements that cannot be converted to a trivial datatype
+ * a corresponding object is created.
+ *
+ * Creates the sld_objects and the sld_parent $_SESSION variables.
+ * sld_objects is an array that contains the objects.
+ * sld_parent is an array that contains the index of the object's parent object in sld_objects.
+ * These variables are used to easily access the objects.
+ *
+ * @see sld_classes.php contains the class definitions
+ * @package sld_parse
+ * @author Markus Krzyzanowski
+ */
+
+//require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+
+/**
+ * Creates a empty SLD object up to the rule object
+ *
+ * @return StyledLayerDescriptor
+ */
+function createEmptySLD() {
+ $styledlayerdescriptor = new StyledLayerDescriptor();
+ $layer = new NamedLayer();
+ $style = new UserStyle();
+ $fts = new FeatureTypeStyle();
+ $rule = new Rule();
+
+ $fts->rules[] = $rule;
+ $style->featuretypestyles[] = $fts;
+ $layer->styles[] = $style;
+ $layer->name = $_SESSION["sld_layer_name"];
+ $styledlayerdescriptor->layers[] = $layer;
+ $styledlayerdescriptor->version = "1.0.0";
+ $styledlayerdescriptor->id = 0;
+ $styledlayerdescriptor->parent = false;
+
+ return $styledlayerdescriptor;
+}
+
+/**
+ * Opens the file at the specified URL and returns the content.
+ *
+ * @param string $file URL of the file
+ * @return string content of the file
+ */
+function readSld($file)
+{
+ if (!($fp = fopen($file, "rb")))
+ {
+ die("could not open XML input - ".$file);
+ }
+
+ $data = "";
+
+ while(!feof($fp))
+ {
+ $data .= fread($fp, 1024);
+
+ }
+ return $data;
+}
+
+/**
+ * Parses the data and creates the object structure.
+ *
+ * @param string $data data to be parsed
+ * @return StyledLayerDesciptor root object of the sld-document
+ */
+function parseSld($data)
+{
+ $xml_parser = xml_parser_create();
+ xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0);
+ xml_parse_into_struct($xml_parser, $data, $vals, $index);
+ xml_parser_free($xml_parser);
+
+ $styledlayerdescriptor;
+ $parent = array();
+ $objects = array();
+ $parentactual = 0;
+
+ for ($i=0; $i<count($vals); $i++)
+ {
+ $element = $vals[$i];
+ $tag = $element["tag"];
+ $tagname=strtoupper($tag);
+ switch($tagname)
+ {
+ // uh, the server responded with an error, should be break or start with an empty sld?
+ case "SERVICEEXCEPTIONREPORT":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = false;
+ $parentactual = 0;
+ /*
+ $styledlayerdescriptor = new StyledLayerDescriptor();
+ $styledlayerdescriptor->version = "1.0.0";
+ //Experimental:
+ */
+ $styledlayerdescriptor = createEmptySLD();
+ $styledlayerdescriptor->id = 0;
+ $styledlayerdescriptor->parent = false;
+ //END Experimental
+ $objects[] = &$styledlayerdescriptor;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = false;
+ }
+ $_SESSION["sld_objects"] = $objects;
+ $_SESSION["sld_parent"] = $parent;
+ return $styledlayerdescriptor;
+ }
+ case "STYLEDLAYERDESCRIPTOR":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = false;
+ $parentactual = 0;
+ $styledlayerdescriptor = new StyledLayerDescriptor();
+ $styledlayerdescriptor->version = $element["attributes"]["version"];
+ //Experimental:
+ $styledlayerdescriptor->id = 0;
+ $styledlayerdescriptor->parent = false;
+ //END Experimental
+ $objects[] = &$styledlayerdescriptor;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = false;
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "NAMEDLAYER":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new NamedLayer();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->layers[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "NAME":
+ if ($element["type"] == "complete")
+ {
+ //TODO - workaround suchen...!!!
+ //echo "-------------\n";
+ //echo $element["value"]."\n";
+ //$element["value"] = str_replace("<","<",$element["value"]);
+ //$element["value"] = str_replace(">",">",$element["value"]);
+ $objects[$parentactual]->name = $element["value"];
+ }
+ break;
+ case "TITLE":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->title = $element["value"];
+ }break;
+ case "ABSTRACT":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->abstract = $element["value"];
+ }
+ break;
+ case "MINSCALEDENOMINATOR":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->minscaledenominator = $element["value"];
+ }
+ break;
+ case "MAXSCALEDENOMINATOR":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->maxscaledenominator = $element["value"];
+ }
+ break;
+ case "USERSTYLE":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new UserStyle();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->styles[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "FEATURETYPESTYLE":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new FeatureTypeStyle();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->featuretypestyles[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "RULE":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new Rule();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->rules[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "LINESYMBOLIZER":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new LineSymbolizer();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->symbolizers[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "POLYGONSYMBOLIZER":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new PolygonSymbolizer();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->symbolizers[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "POINTSYMBOLIZER":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new PointSymbolizer();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->symbolizers[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "TEXTSYMBOLIZER":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new TextSymbolizer();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->symbolizers[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "RASTERSYMBOLIZER":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new RasterSymbolizer();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->symbolizers[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "LEGENDGRAPHIC":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new LegendGraphic();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->legendgraphic = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ //Commented out - Filters will be created through the creation of xml in the default case
+ // case "ELSEFILTER":
+ // if ($element["type"] == "complete")
+ // {
+ // $objects[$parentactual]->filter = new ElseFilter();
+ // }
+ // break;
+ // case "OGC:FILTER": //TODO
+ // if ($element["type"] == "complete")
+ // {
+ // //Create a new ElseFilter and write it to the parent object
+ // $objects[$parentactual]->filter = new ElseFilter();
+ // }
+ // break;
+ case "GRAPHIC":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new Graphic();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+
+ $objects[$parentactual]->graphic = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "EXTERNALGRAPHIC":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new ExternalGraphic();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->externalgraphicsormarks[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "ONLINERESOURCE":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->onlineresource = $element["attributes"]["xlink:href"];
+ }
+ break;
+ case "FORMAT":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->format = $element["value"];
+ }
+ break;
+ case "STROKE":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new Stroke();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->stroke = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "CSSPARAMETER":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->cssparameters[] = new CssParameter();
+ //Experimental:
+ $objects[$parentactual]->cssparameters[count($objects[$parentactual]->cssparameters)-1]->id = count($parent)-1;
+ $objects[$parentactual]->cssparameters[count($objects[$parentactual]->cssparameters)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->cssparameters[count($objects[$parentactual]->cssparameters)-1]->name = $element["attributes"]["name"];
+ $objects[$parentactual]->cssparameters[count($objects[$parentactual]->cssparameters)-1]->value = $element["value"];
+ }
+ break;
+ case "GRAPHICFILL":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new GraphicFill();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+
+
+ //print_r($objects[count($parent)-1]);
+
+ $objects[$parentactual]->graphicfill = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "GRAPHICSTROKE":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new GraphicStroke();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->graphicstroke = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "FILL":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new Fill();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->fill = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "MARK":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new Mark();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->externalgraphicsormarks[] = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "WELLKNOWNNAME":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->wellknownname = $element["value"];
+ }
+ break;
+ case "FONT":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new Font();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->font = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "LABELPLACEMENT":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new LabelPlacement();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->labelplacement = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "POINTPLACEMENT":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new PointPlacement();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->placement = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "ANCHORPOINT":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new AnchorPoint();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->anchorpoint = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "DISPLACEMENT":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new Displacement();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->displacement = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "HALO":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new Halo();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->halo = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "COLORMAP":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new ColorMap();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->colormap = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ if ($element["type"] == "complete")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ }
+ else if($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "COLORMAPENTRY":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->colormapentries[] = new ColorMapEntry();
+ //Experimental:
+ $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->id = count($parent)-1;
+ $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->color = $element["attributes"]["color"];
+ $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->opacity = $element["attributes"]["opacity"];
+ $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->quantity = $element["attributes"]["quantity"];
+ $objects[$parentactual]->colormapentries[count($objects[$parentactual]->colormapentries)-1]->label = $element["attributes"]["label"];
+ }
+ break;
+ case "LABEL":
+ if ($element["type"] == "complete")
+ {
+ //Kl�ren, ob Label nur so vorkommen kann - TODO
+ //$objects[$parentactual]->label = $element["value"];
+
+ //use the new ParameterValue class to store the mixed content value
+ //simple case no extra markup ...
+ //the label is instanciated by TextSymbolizer
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new ParameterValue();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ $objects[count($parent)-1]->value = $element["value"];
+ //END Experimental
+ $objects[$parentactual]->label = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ $parentactual = $parent[$parentactual];
+ }
+ elseif ($element["type"] == "open")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new ParameterValue();
+ //Experimental:
+ $objects[count($parent)-1]->id = count($parent)-1;
+ $objects[count($parent)-1]->parent = $parentactual;
+ //END Experimental
+ $objects[$parentactual]->label = &$objects[count($parent)-1];
+ $parentactual = count($parent)-1;
+ }
+ elseif ($element["type"] == "close")
+ {
+ $parentactual = $parent[$parentactual];
+ }
+ break;
+ case "RADIUS":
+ if ($element["type"] == "complete")
+ {
+ //Kl�ren, ob Radius nur so vorkommen kann - TODO
+ $objects[$parentactual]->radius = $element["value"];
+ }
+ break;
+ case "OPACITY":
+ if ($element["type"] == "complete")
+ {
+ //Kl�ren, ob Opacity nur so vorkommen kann - TODO
+ $objects[$parentactual]->opacity = $element["value"];
+ }
+ break;
+ case "SIZE":
+ if ($element["type"] == "complete")
+ {
+ //Kl�ren, ob Size nur so vorkommen kann - TODO
+ $objects[$parentactual]->size = $element["value"];
+ }
+ break;
+ case "ROTATION":
+ if ($element["type"] == "complete")
+ {
+ //Kl�ren, ob Rotation nur so vorkommen kann - TODO
+ $objects[$parentactual]->rotation = $element["value"];
+ }
+ break;
+ case "ANCHORPOINTX":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->anchorpointx = $element["value"];
+ }
+ break;
+ case "ANCHORPOINTY":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->anchorpointy = $element["value"];
+ }
+ break;
+ case "DISPLACEMENTX":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->displacementx = $element["value"];
+ }
+ break;
+ case "DISPLACEMENTY":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->displacementy = $element["value"];
+ }
+ break;
+ //TODO: Kl�ren mit sld:parameterValueType
+ //bei den folgenden XML Elementen
+ case "PROPERTYNAME":
+ if ($element["type"] == "complete")
+ {
+ if ($temp == "") {
+ $objects[$parentactual]->value = $element["value"];
+ $parentactual = count($parent)-1;
+ }
+ else {
+ die($temp);
+ }
+ }
+ break;
+ //END TODO
+ //von den vorhergegangenen XML Elementen
+
+
+ default:
+ $temp = "";
+ if ($element["type"] == "open")
+ {
+ $temp .= "<".$tag;
+ if ($element["attributes"] != "")
+ {
+ $keys = array_keys($element["attributes"]);
+ foreach ($keys as $key)
+ {
+ $temp .= " ".$key."=\"".$element["attributes"][$key]."\"";
+ }
+ }
+ $temp .= ">";
+ }
+ if ($element["type"] == "close")
+ {
+ $temp .= "</".$tag.">";
+ }
+ if ($element["type"] == "complete")
+ {
+ $temp .= "<".$tag.">";
+ $temp .= $element["value"];
+ $temp .= "</".$tag.">";
+ }
+ //Wenn Parent vom Typ Rule, dann muss es ein Filter sein, also hinzuf�gen
+ if (strtoupper(get_class($objects[$parentactual])) == "RULE")
+ {
+ $objects[$parentactual]->filter .= $temp;
+ $temp = "";
+ }
+ }
+ }
+
+
+ //print_r($objects);
+
+
+ $_SESSION["sld_objects"] = $objects;
+ $_SESSION["sld_parent"] = $parent;
+
+ return $styledlayerdescriptor;
+}
+?>
Deleted: trunk/mapbender/http/sld/sld_pick_color.php
===================================================================
--- branches/2.5/http/sld/sld_pick_color.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/http/sld/sld_pick_color.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,330 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/SLD/
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/**
- * Color-picker module.
- * This file realizes a color-picker module for the sld-editor so that
- * the users do not have to work with RGB values.
- * A number of colors from a wide spectrum is available with a preview
- * of each color.
- * Choosing a color and submitting the form will also submit the sld_edit_form
- * to directly save the changes to the sld.
- *
- * @package sld_pick_color
- * @author Markus Krzyzanowski, Design by Bao Ngan
- */
-
-
-session_start();
-$id = $_REQUEST["id"];
-$color= $_REQUEST["color"];
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="../css/sldEditor.css">
-<script Language="JavaScript">
-function returnToMain()
-{
- window.opener.document.getElementById("<?php echo $id; ?>").value = document.getElementById('color').value;
- var preview = window.opener.document.getElementById('<?php echo $id; ?>_preview');
- preview.style.background = document.getElementById('color').value;
- window.opener.document.getElementById("sld_editor_form").submit();
- window.close();
-}
-function showColor(color)
-{
- document.getElementById('color').value = color;
- document.getElementById('preview').style.background = color;
-}
-function showColor_over(color)
-{
- document.getElementById('preview_over').style.background = color;
-}
-</script>
-</head>
-<body leftmargin="2" topmargin="2">
-<!------ Rahmentabelle ------>
-<table width="294" height="188" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td height="14" colspan="4" align="center" class="text3 bg2">Farbpalette</td>
- </tr>
- <tr>
- <td width="33" height="135" class="line_left2 ">
- <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid black; background-color: #FFFFFF">
- <tr>
- <td height="132" id="preview_over" width="100%"> </td>
- </tr>
- </table>
- </td>
- <td width="4"> </td>
- <td colspan="2" class="line_right2 ">
- <table style="border:1px solid black;" cellspacing="1" cellpadding="1" width="87%">
- <tr>
- <td width="10" style="width: 10px; background-color: #00FF00;" onClick="showColor('#00FF00');" onMouseOver="showColor_over('#00FF00');"> </td>
- <td width="10" style="width: 10px; background-color: #00FF33;" onClick="showColor('#00FF33');" onMouseOver="showColor_over('#00FF33');"> </td>
- <td width="10" style="width: 10px; background-color: #00FF66;" onClick="showColor('#00FF66');" onMouseOver="showColor_over('#00FF66');"> </td>
- <td width="10" style="width: 10px; background-color: #00FF99;" onClick="showColor('#00FF99');" onMouseOver="showColor_over('#00FF99');"> </td>
- <td width="10" style="width: 10px; background-color: #00FFCC;" onClick="showColor('#00FFCC');" onMouseOver="showColor_over('#00FFCC');"> </td>
- <td width="10" style="width: 10px; background-color: #00FFFF;" onClick="showColor('#00FFFF');" onMouseOver="showColor_over('#00FFFF');"> </td>
- <td width="10" style="width: 10px; background-color: #33FF00;" onClick="showColor('#33FF00');" onMouseOver="showColor_over('#33FF00');"> </td>
- <td width="10" style="width: 10px; background-color: #33FF33;" onClick="showColor('#33FF33');" onMouseOver="showColor_over('#33FF33');"> </td>
- <td width="10" style="width: 10px; background-color: #33FF66;" onClick="showColor('#33FF66');" onMouseOver="showColor_over('#33FF66');"> </td>
- <td width="10" style="width: 10px; background-color: #33FF99;" onClick="showColor('#33FF99');" onMouseOver="showColor_over('#33FF99');"> </td>
- <td width="10" style="width: 10px; background-color: #33FFCC;" onClick="showColor('#33FFCC');" onMouseOver="showColor_over('#33FFCC');"> </td>
- <td width="10" style="width: 10px; background-color: #33FFFF;" onClick="showColor('#33FFFF');" onMouseOver="showColor_over('#33FFFF');"> </td>
- <td width="10" style="width: 10px; background-color: #66FF00;" onClick="showColor('#66FF00');" onMouseOver="showColor_over('#66FF00');"> </td>
- <td width="10" style="width: 10px; background-color: #66FF33;" onClick="showColor('#66FF33');" onMouseOver="showColor_over('#66FF33');"> </td>
- <td width="10" style="width: 10px; background-color: #66FF66;" onClick="showColor('#66FF66');" onMouseOver="showColor_over('#66FF66');"> </td>
- <td width="10" style="width: 10px; background-color: #66FF99;" onClick="showColor('#66FF99');" onMouseOver="showColor_over('#66FF99');"> </td>
- <td width="10" style="width: 10px; background-color: #66FFCC;" onClick="showColor('#66FFCC');" onMouseOver="showColor_over('#66FFCC');"> </td>
- <td width="10" style="width: 10px; background-color: #66FFFF;" onClick="showColor('#66FFFF');" onMouseOver="showColor_over('#66FFFF');"> </td>
- <td width="10" style="width: 10px; background-color: #99FF00;" onClick="showColor('#99FF00');" onMouseOver="showColor_over('#99FF00');"> </td>
- <td width="10" style="width: 10px; background-color: #99FF33;" onClick="showColor('#99FF33');" onMouseOver="showColor_over('#99FF33');"> </td>
- <td width="10" style="width: 10px; background-color: #99FF66;" onClick="showColor('#99FF66');" onMouseOver="showColor_over('#99FF66');"> </td>
- <td width="10" style="width: 10px; background-color: #99FF99;" onClick="showColor('#99FF99');" onMouseOver="showColor_over('#99FF99');"> </td>
- <td width="10" style="width: 10px; background-color: #99FFCC;" onClick="showColor('#99FFCC');" onMouseOver="showColor_over('#99FFCC');"> </td>
- <td width="10" style="width: 10px; background-color: #99FFFF;" onClick="showColor('#99FFFF');" onMouseOver="showColor_over('#99FFFF');"> </td>
- <td width="10" style="width: 10px; background-color: #CCFF00;" onClick="showColor('#CCFF00');" onMouseOver="showColor_over('#CCFF00');"> </td>
- <td width="10" style="width: 10px; background-color: #CCFF33;" onClick="showColor('#CCFF33');" onMouseOver="showColor_over('#CCFF33');"> </td>
- <td width="10" style="width: 10px; background-color: #CCFF66;" onClick="showColor('#CCFF66');" onMouseOver="showColor_over('#CCFF66');"> </td>
- <td width="10" style="width: 10px; background-color: #CCFF99;" onClick="showColor('#CCFF99');" onMouseOver="showColor_over('#CCFF99');"> </td>
- <td width="10" style="width: 10px; background-color: #CCFFCC;" onClick="showColor('#CCFFCC');" onMouseOver="showColor_over('#CCFFCC');"> </td>
- <td width="10" style="width: 10px; background-color: #CCFFFF;" onClick="showColor('#CCFFFF');" onMouseOver="showColor_over('#CCFFFF');"> </td>
- <td width="10" style="width: 10px; background-color: #FFFF00;" onClick="showColor('#FFFF00');" onMouseOver="showColor_over('#FFFF00');"> </td>
- <td width="10" style="width: 10px; background-color: #FFFF33;" onClick="showColor('#FFFF33');" onMouseOver="showColor_over('#FFFF33');"> </td>
- <td width="10" style="width: 10px; background-color: #FFFF66;" onClick="showColor('#FFFF66');" onMouseOver="showColor_over('#FFFF66');"> </td>
- <td width="10" style="width: 10px; background-color: #FFFF99;" onClick="showColor('#FFFF99');" onMouseOver="showColor_over('#FFFF99');"> </td>
- <td width="10" style="width: 10px; background-color: #FFFFCC;" onClick="showColor('#FFFFCC');" onMouseOver="showColor_over('#FFFFCC');"> </td>
- <td width="10" style="width: 10px; background-color: #FFFFFF;" onClick="showColor('#FFFFFF');" onMouseOver="showColor_over('#FFFFFF');"> </td>
- </tr>
- <tr>
- <td style="width: 10px; background-color: #00CC00;" onClick="showColor('#00CC00');" onMouseOver="showColor_over('#00CC00');"> </td>
- <td style="width: 10px; background-color: #00CC33;" onClick="showColor('#00CC33');" onMouseOver="showColor_over('#00CC33');"> </td>
- <td style="width: 10px; background-color: #00CC66;" onClick="showColor('#00CC66');" onMouseOver="showColor_over('#00CC66');"> </td>
- <td style="width: 10px; background-color: #00CC99;" onClick="showColor('#00CC99');" onMouseOver="showColor_over('#00CC99');"> </td>
- <td style="width: 10px; background-color: #00CCCC;" onClick="showColor('#00CCCC');" onMouseOver="showColor_over('#00CCCC');"> </td>
- <td style="width: 10px; background-color: #00CCFF;" onClick="showColor('#00CCFF');" onMouseOver="showColor_over('#00CCFF');"> </td>
- <td style="width: 10px; background-color: #33CC00;" onClick="showColor('#33CC00');" onMouseOver="showColor_over('#33CC00');"> </td>
- <td style="width: 10px; background-color: #33CC33;" onClick="showColor('#33CC33');" onMouseOver="showColor_over('#33CC33');"> </td>
- <td style="width: 10px; background-color: #33CC66;" onClick="showColor('#33CC66');" onMouseOver="showColor_over('#33CC66');"> </td>
- <td style="width: 10px; background-color: #33CC99;" onClick="showColor('#33CC99');" onMouseOver="showColor_over('#33CC99');"> </td>
- <td style="width: 10px; background-color: #33CCCC;" onClick="showColor('#33CCCC');" onMouseOver="showColor_over('#33CCCC');"> </td>
- <td style="width: 10px; background-color: #33CCFF;" onClick="showColor('#33CCFF');" onMouseOver="showColor_over('#33CCFF');"> </td>
- <td style="width: 10px; background-color: #66CC00;" onClick="showColor('#66CC00');" onMouseOver="showColor_over('#66CC00');"> </td>
- <td style="width: 10px; background-color: #66CC33;" onClick="showColor('#66CC33');" onMouseOver="showColor_over('#66CC33');"> </td>
- <td style="width: 10px; background-color: #66CC66;" onClick="showColor('#66CC66');" onMouseOver="showColor_over('#66CC66');"> </td>
- <td style="width: 10px; background-color: #66CC99;" onClick="showColor('#66CC99');" onMouseOver="showColor_over('#66CC99');"> </td>
- <td style="width: 10px; background-color: #66CCCC;" onClick="showColor('#66CCCC');" onMouseOver="showColor_over('#66CCCC');"> </td>
- <td style="width: 10px; background-color: #66CCFF;" onClick="showColor('#66CCFF');" onMouseOver="showColor_over('#66CCFF');"> </td>
- <td style="width: 10px; background-color: #99CC00;" onClick="showColor('#99CC00');" onMouseOver="showColor_over('#99CC00');"> </td>
- <td style="width: 10px; background-color: #99CC33;" onClick="showColor('#99CC33');" onMouseOver="showColor_over('#99CC33');"> </td>
- <td style="width: 10px; background-color: #99CC66;" onClick="showColor('#99CC66');" onMouseOver="showColor_over('#99CC66');"> </td>
- <td style="width: 10px; background-color: #99CC99;" onClick="showColor('#99CC99');" onMouseOver="showColor_over('#99CC99');"> </td>
- <td style="width: 10px; background-color: #99CCCC;" onClick="showColor('#99CCCC');" onMouseOver="showColor_over('#99CCCC');"> </td>
- <td style="width: 10px; background-color: #99CCFF;" onClick="showColor('#99CCFF');" onMouseOver="showColor_over('#99CCFF');"> </td>
- <td style="width: 10px; background-color: #CCCC00;" onClick="showColor('#CCCC00');" onMouseOver="showColor_over('#CCCC00');"> </td>
- <td style="width: 10px; background-color: #CCCC33;" onClick="showColor('#CCCC33');" onMouseOver="showColor_over('#CCCC33');"> </td>
- <td style="width: 10px; background-color: #CCCC66;" onClick="showColor('#CCCC66');" onMouseOver="showColor_over('#CCCC66');"> </td>
- <td style="width: 10px; background-color: #CCCC99;" onClick="showColor('#CCCC99');" onMouseOver="showColor_over('#CCCC99');"> </td>
- <td style="width: 10px; background-color: #CCCCCC;" onClick="showColor('#CCCCCC');" onMouseOver="showColor_over('#CCCCCC');"> </td>
- <td style="width: 10px; background-color: #CCCCFF;" onClick="showColor('#CCCCFF');" onMouseOver="showColor_over('#CCCCFF');"> </td>
- <td style="width: 10px; background-color: #FFCC00;" onClick="showColor('#FFCC00');" onMouseOver="showColor_over('#FFCC00');"> </td>
- <td style="width: 10px; background-color: #FFCC33;" onClick="showColor('#FFCC33');" onMouseOver="showColor_over('#FFCC33');"> </td>
- <td style="width: 10px; background-color: #FFCC66;" onClick="showColor('#FFCC66');" onMouseOver="showColor_over('#FFCC66');"> </td>
- <td style="width: 10px; background-color: #FFCC99;" onClick="showColor('#FFCC99');" onMouseOver="showColor_over('#FFCC99');"> </td>
- <td style="width: 10px; background-color: #FFCCCC;" onClick="showColor('#FFCCCC');" onMouseOver="showColor_over('#FFCCCC');"> </td>
- <td style="width: 10px; background-color: #FFCCFF;" onClick="showColor('#FFCCFF');" onMouseOver="showColor_over('#FFCCFF');"> </td>
- </tr>
- <tr>
- <td style="width: 10px; background-color: #009900;" onClick="showColor('#009900');" onMouseOver="showColor_over('#009900');"> </td>
- <td style="width: 10px; background-color: #009933;" onClick="showColor('#009933');" onMouseOver="showColor_over('#009933');"> </td>
- <td style="width: 10px; background-color: #009966;" onClick="showColor('#009966');" onMouseOver="showColor_over('#009966');"> </td>
- <td style="width: 10px; background-color: #009999;" onClick="showColor('#009999');" onMouseOver="showColor_over('#009999');"> </td>
- <td style="width: 10px; background-color: #0099CC;" onClick="showColor('#0099CC');" onMouseOver="showColor_over('#0099CC');"> </td>
- <td style="width: 10px; background-color: #0099FF;" onClick="showColor('#0099FF');" onMouseOver="showColor_over('#0099FF');"> </td>
- <td style="width: 10px; background-color: #339900;" onClick="showColor('#339900');" onMouseOver="showColor_over('#339900');"> </td>
- <td style="width: 10px; background-color: #339933;" onClick="showColor('#339933');" onMouseOver="showColor_over('#339933');"> </td>
- <td style="width: 10px; background-color: #339966;" onClick="showColor('#339966');" onMouseOver="showColor_over('#339966');"> </td>
- <td style="width: 10px; background-color: #339999;" onClick="showColor('#339999');" onMouseOver="showColor_over('#339999');"> </td>
- <td style="width: 10px; background-color: #3399CC;" onClick="showColor('#3399CC');" onMouseOver="showColor_over('#3399CC');"> </td>
- <td style="width: 10px; background-color: #3399FF;" onClick="showColor('#3399FF');" onMouseOver="showColor_over('#3399FF');"> </td>
- <td style="width: 10px; background-color: #669900;" onClick="showColor('#669900');" onMouseOver="showColor_over('#669900');"> </td>
- <td style="width: 10px; background-color: #669933;" onClick="showColor('#669933');" onMouseOver="showColor_over('#669933');"> </td>
- <td style="width: 10px; background-color: #669966;" onClick="showColor('#669966');" onMouseOver="showColor_over('#669966');"> </td>
- <td style="width: 10px; background-color: #669999;" onClick="showColor('#669999');" onMouseOver="showColor_over('#669999');"> </td>
- <td style="width: 10px; background-color: #6699CC;" onClick="showColor('#6699CC');" onMouseOver="showColor_over('#6699CC');"> </td>
- <td style="width: 10px; background-color: #6699FF;" onClick="showColor('#6699FF');" onMouseOver="showColor_over('#6699FF');"> </td>
- <td style="width: 10px; background-color: #999900;" onClick="showColor('#999900');" onMouseOver="showColor_over('#999900');"> </td>
- <td style="width: 10px; background-color: #999933;" onClick="showColor('#999933');" onMouseOver="showColor_over('#999933');"> </td>
- <td style="width: 10px; background-color: #999966;" onClick="showColor('#999966');" onMouseOver="showColor_over('#999966');"> </td>
- <td style="width: 10px; background-color: #999999;" onClick="showColor('#999999');" onMouseOver="showColor_over('#999999');"> </td>
- <td style="width: 10px; background-color: #9999CC;" onClick="showColor('#9999CC');" onMouseOver="showColor_over('#9999CC');"> </td>
- <td style="width: 10px; background-color: #9999FF;" onClick="showColor('#9999FF');" onMouseOver="showColor_over('#9999FF');"> </td>
- <td style="width: 10px; background-color: #CC9900;" onClick="showColor('#CC9900');" onMouseOver="showColor_over('#CC9900');"> </td>
- <td style="width: 10px; background-color: #CC9933;" onClick="showColor('#CC9933');" onMouseOver="showColor_over('#CC9933');"> </td>
- <td style="width: 10px; background-color: #CC9966;" onClick="showColor('#CC9966');" onMouseOver="showColor_over('#CC9966');"> </td>
- <td style="width: 10px; background-color: #CC9999;" onClick="showColor('#CC9999');" onMouseOver="showColor_over('#CC9999');"> </td>
- <td style="width: 10px; background-color: #CC99CC;" onClick="showColor('#CC99CC');" onMouseOver="showColor_over('#CC99CC');"> </td>
- <td style="width: 10px; background-color: #CC99FF;" onClick="showColor('#CC99FF');" onMouseOver="showColor_over('#CC99FF');"> </td>
- <td style="width: 10px; background-color: #FF9900;" onClick="showColor('#FF9900');" onMouseOver="showColor_over('#FF9900');"> </td>
- <td style="width: 10px; background-color: #FF9933;" onClick="showColor('#FF9933');" onMouseOver="showColor_over('#FF9933');"> </td>
- <td style="width: 10px; background-color: #FF9966;" onClick="showColor('#FF9966');" onMouseOver="showColor_over('#FF9966');"> </td>
- <td style="width: 10px; background-color: #FF9999;" onClick="showColor('#FF9999');" onMouseOver="showColor_over('#FF9999');"> </td>
- <td style="width: 10px; background-color: #FF99CC;" onClick="showColor('#FF99CC');" onMouseOver="showColor_over('#FF99CC');"> </td>
- <td style="width: 10px; background-color: #FF99FF;" onClick="showColor('#FF99FF');" onMouseOver="showColor_over('#FF99FF');"> </td>
- </tr>
- <tr>
- <td style="width: 10px; background-color: #006600;" onClick="showColor('#006600');" onMouseOver="showColor_over('#006600');"> </td>
- <td style="width: 10px; background-color: #006633;" onClick="showColor('#006633');" onMouseOver="showColor_over('#006633');"> </td>
- <td style="width: 10px; background-color: #006666;" onClick="showColor('#006666');" onMouseOver="showColor_over('#006666');"> </td>
- <td style="width: 10px; background-color: #006699;" onClick="showColor('#006699');" onMouseOver="showColor_over('#006699');"> </td>
- <td style="width: 10px; background-color: #0066CC;" onClick="showColor('#0066CC');" onMouseOver="showColor_over('#0066CC');"> </td>
- <td style="width: 10px; background-color: #0066FF;" onClick="showColor('#0066FF');" onMouseOver="showColor_over('#0066FF');"> </td>
- <td style="width: 10px; background-color: #336600;" onClick="showColor('#336600');" onMouseOver="showColor_over('#336600');"> </td>
- <td style="width: 10px; background-color: #336633;" onClick="showColor('#336633');" onMouseOver="showColor_over('#336633');"> </td>
- <td style="width: 10px; background-color: #336666;" onClick="showColor('#336666');" onMouseOver="showColor_over('#336666');"> </td>
- <td style="width: 10px; background-color: #336699;" onClick="showColor('#336699');" onMouseOver="showColor_over('#336699');"> </td>
- <td style="width: 10px; background-color: #3366CC;" onClick="showColor('#3366CC');" onMouseOver="showColor_over('#3366CC');"> </td>
- <td style="width: 10px; background-color: #3366FF;" onClick="showColor('#3366FF');" onMouseOver="showColor_over('#3366FF');"> </td>
- <td style="width: 10px; background-color: #666600;" onClick="showColor('#666600');" onMouseOver="showColor_over('#666600');"> </td>
- <td style="width: 10px; background-color: #666633;" onClick="showColor('#666633');" onMouseOver="showColor_over('#666633');"> </td>
- <td style="width: 10px; background-color: #666666;" onClick="showColor('#666666');" onMouseOver="showColor_over('#666666');"> </td>
- <td style="width: 10px; background-color: #666699;" onClick="showColor('#666699');" onMouseOver="showColor_over('#666699');"> </td>
- <td style="width: 10px; background-color: #6666CC;" onClick="showColor('#6666CC');" onMouseOver="showColor_over('#6666CC');"> </td>
- <td style="width: 10px; background-color: #6666FF;" onClick="showColor('#6666FF');" onMouseOver="showColor_over('#6666FF');"> </td>
- <td style="width: 10px; background-color: #996600;" onClick="showColor('#996600');" onMouseOver="showColor_over('#996600');"> </td>
- <td style="width: 10px; background-color: #996633;" onClick="showColor('#996633');" onMouseOver="showColor_over('#996633');"> </td>
- <td style="width: 10px; background-color: #996666;" onClick="showColor('#996666');" onMouseOver="showColor_over('#996666');"> </td>
- <td style="width: 10px; background-color: #996699;" onClick="showColor('#996699');" onMouseOver="showColor_over('#996699');"> </td>
- <td style="width: 10px; background-color: #9966CC;" onClick="showColor('#9966CC');" onMouseOver="showColor_over('#9966CC');"> </td>
- <td style="width: 10px; background-color: #9966FF;" onClick="showColor('#9966FF');" onMouseOver="showColor_over('#9966FF');"> </td>
- <td style="width: 10px; background-color: #CC6600;" onClick="showColor('#CC6600');" onMouseOver="showColor_over('#CC6600');"> </td>
- <td style="width: 10px; background-color: #CC6633;" onClick="showColor('#CC6633');" onMouseOver="showColor_over('#CC6633');"> </td>
- <td style="width: 10px; background-color: #CC6666;" onClick="showColor('#CC6666');" onMouseOver="showColor_over('#CC6666');"> </td>
- <td style="width: 10px; background-color: #CC6699;" onClick="showColor('#CC6699');" onMouseOver="showColor_over('#CC6699');"> </td>
- <td style="width: 10px; background-color: #CC66CC;" onClick="showColor('#CC66CC');" onMouseOver="showColor_over('#CC66CC');"> </td>
- <td style="width: 10px; background-color: #CC66FF;" onClick="showColor('#CC66FF');" onMouseOver="showColor_over('#CC66FF');"> </td>
- <td style="width: 10px; background-color: #FF6600;" onClick="showColor('#FF6600');" onMouseOver="showColor_over('#FF6600');"> </td>
- <td style="width: 10px; background-color: #FF6633;" onClick="showColor('#FF6633');" onMouseOver="showColor_over('#FF6633');"> </td>
- <td style="width: 10px; background-color: #FF6666;" onClick="showColor('#FF6666');" onMouseOver="showColor_over('#FF6666');"> </td>
- <td style="width: 10px; background-color: #FF6699;" onClick="showColor('#FF6699');" onMouseOver="showColor_over('#FF6699');"> </td>
- <td style="width: 10px; background-color: #FF66CC;" onClick="showColor('#FF66CC');" onMouseOver="showColor_over('#FF66CC');"> </td>
- <td style="width: 10px; background-color: #FF66FF;" onClick="showColor('#FF66FF');" onMouseOver="showColor_over('#FF66FF');"> </td>
- </tr>
- <tr>
- <td style="width: 10px; background-color: #003300;" onClick="showColor('#003300');" onMouseOver="showColor_over('#003300');"> </td>
- <td style="width: 10px; background-color: #003333;" onClick="showColor('#003333');" onMouseOver="showColor_over('#003333');"> </td>
- <td style="width: 10px; background-color: #003366;" onClick="showColor('#003366');" onMouseOver="showColor_over('#003366');"> </td>
- <td style="width: 10px; background-color: #003399;" onClick="showColor('#003399');" onMouseOver="showColor_over('#003399');"> </td>
- <td style="width: 10px; background-color: #0033CC;" onClick="showColor('#0033CC');" onMouseOver="showColor_over('#0033CC');"> </td>
- <td style="width: 10px; background-color: #0033FF;" onClick="showColor('#0033FF');" onMouseOver="showColor_over('#0033FF');"> </td>
- <td style="width: 10px; background-color: #333300;" onClick="showColor('#333300');" onMouseOver="showColor_over('#333300');"> </td>
- <td style="width: 10px; background-color: #333333;" onClick="showColor('#333333');" onMouseOver="showColor_over('#333333');"> </td>
- <td style="width: 10px; background-color: #333366;" onClick="showColor('#333366');" onMouseOver="showColor_over('#333366');"> </td>
- <td style="width: 10px; background-color: #333399;" onClick="showColor('#333399');" onMouseOver="showColor_over('#333399');"> </td>
- <td style="width: 10px; background-color: #3333CC;" onClick="showColor('#3333CC');" onMouseOver="showColor_over('#3333CC');"> </td>
- <td style="width: 10px; background-color: #3333FF;" onClick="showColor('#3333FF');" onMouseOver="showColor_over('#3333FF');"> </td>
- <td style="width: 10px; background-color: #663300;" onClick="showColor('#663300');" onMouseOver="showColor_over('#663300');"> </td>
- <td style="width: 10px; background-color: #663333;" onClick="showColor('#663333');" onMouseOver="showColor_over('#663333');"> </td>
- <td style="width: 10px; background-color: #663366;" onClick="showColor('#663366');" onMouseOver="showColor_over('#663366');"> </td>
- <td style="width: 10px; background-color: #663399;" onClick="showColor('#663399');" onMouseOver="showColor_over('#663399');"> </td>
- <td style="width: 10px; background-color: #6633CC;" onClick="showColor('#6633CC');" onMouseOver="showColor_over('#6633CC');"> </td>
- <td style="width: 10px; background-color: #6633FF;" onClick="showColor('#6633FF');" onMouseOver="showColor_over('#6633FF');"> </td>
- <td style="width: 10px; background-color: #993300;" onClick="showColor('#993300');" onMouseOver="showColor_over('#993300');"> </td>
- <td style="width: 10px; background-color: #993333;" onClick="showColor('#993333');" onMouseOver="showColor_over('#993333');"> </td>
- <td style="width: 10px; background-color: #993366;" onClick="showColor('#993366');" onMouseOver="showColor_over('#993366');"> </td>
- <td style="width: 10px; background-color: #993399;" onClick="showColor('#993399');" onMouseOver="showColor_over('#993399');"> </td>
- <td style="width: 10px; background-color: #9933CC;" onClick="showColor('#9933CC');" onMouseOver="showColor_over('#9933CC');"> </td>
- <td style="width: 10px; background-color: #9933FF;" onClick="showColor('#9933FF');" onMouseOver="showColor_over('#9933FF');"> </td>
- <td style="width: 10px; background-color: #CC3300;" onClick="showColor('#CC3300');" onMouseOver="showColor_over('#CC3300');"> </td>
- <td style="width: 10px; background-color: #CC3333;" onClick="showColor('#CC3333');" onMouseOver="showColor_over('#CC3333');"> </td>
- <td style="width: 10px; background-color: #CC3366;" onClick="showColor('#CC3366');" onMouseOver="showColor_over('#CC3366');"> </td>
- <td style="width: 10px; background-color: #CC3399;" onClick="showColor('#CC3399');" onMouseOver="showColor_over('#CC3399');"> </td>
- <td style="width: 10px; background-color: #CC33CC;" onClick="showColor('#CC33CC');" onMouseOver="showColor_over('#CC33CC');"> </td>
- <td style="width: 10px; background-color: #CC33FF;" onClick="showColor('#CC33FF');" onMouseOver="showColor_over('#CC33FF');"> </td>
- <td style="width: 10px; background-color: #FF3300;" onClick="showColor('#FF3300');" onMouseOver="showColor_over('#FF3300');"> </td>
- <td style="width: 10px; background-color: #FF3333;" onClick="showColor('#FF3333');" onMouseOver="showColor_over('#FF3333');"> </td>
- <td style="width: 10px; background-color: #FF3366;" onClick="showColor('#FF3366');" onMouseOver="showColor_over('#FF3366');"> </td>
- <td style="width: 10px; background-color: #FF3399;" onClick="showColor('#FF3399');" onMouseOver="showColor_over('#FF3399');"> </td>
- <td style="width: 10px; background-color: #FF33CC;" onClick="showColor('#FF33CC');" onMouseOver="showColor_over('#FF33CC');"> </td>
- <td style="width: 10px; background-color: #FF33FF;" onClick="showColor('#FF33FF');" onMouseOver="showColor_over('#FF33FF');"> </td>
- </tr>
- <tr>
- <td height="21" style="width: 10px; background-color: #000000;" onClick="showColor('#000000');" onMouseOver="showColor_over('#000000');"> </td>
- <td style="width: 10px; background-color: #000033;" onClick="showColor('#000033');" onMouseOver="showColor_over('#000033');"> </td>
- <td style="width: 10px; background-color: #000066;" onClick="showColor('#000066');" onMouseOver="showColor_over('#000066');"> </td>
- <td style="width: 10px; background-color: #000099;" onClick="showColor('#000099');" onMouseOver="showColor_over('#000099');"> </td>
- <td style="width: 10px; background-color: #0000CC;" onClick="showColor('#0000CC');" onMouseOver="showColor_over('#0000CC');"> </td>
- <td style="width: 10px; background-color: #0000FF;" onClick="showColor('#0000FF');" onMouseOver="showColor_over('#0000FF');"> </td>
- <td style="width: 10px; background-color: #330000;" onClick="showColor('#330000');" onMouseOver="showColor_over('#330000');"> </td>
- <td style="width: 10px; background-color: #330033;" onClick="showColor('#330033');" onMouseOver="showColor_over('#330033');"> </td>
- <td style="width: 10px; background-color: #330066;" onClick="showColor('#330066');" onMouseOver="showColor_over('#330066');"> </td>
- <td style="width: 10px; background-color: #330099;" onClick="showColor('#330099');" onMouseOver="showColor_over('#330099');"> </td>
- <td style="width: 10px; background-color: #3300CC;" onClick="showColor('#3300CC');" onMouseOver="showColor_over('#3300CC');"> </td>
- <td style="width: 10px; background-color: #3300FF;" onClick="showColor('#3300FF');" onMouseOver="showColor_over('#3300FF');"> </td>
- <td style="width: 10px; background-color: #660000;" onClick="showColor('#660000');" onMouseOver="showColor_over('#660000');"> </td>
- <td style="width: 10px; background-color: #660033;" onClick="showColor('#660033');" onMouseOver="showColor_over('#660033');"> </td>
- <td style="width: 10px; background-color: #660066;" onClick="showColor('#660066');" onMouseOver="showColor_over('#660066');"> </td>
- <td style="width: 10px; background-color: #660099;" onClick="showColor('#660099');" onMouseOver="showColor_over('#660099');"> </td>
- <td style="width: 10px; background-color: #6600CC;" onClick="showColor('#6600CC');" onMouseOver="showColor_over('#6600CC');"> </td>
- <td style="width: 10px; background-color: #6600FF;" onClick="showColor('#6600FF');" onMouseOver="showColor_over('#6600FF');"> </td>
- <td style="width: 10px; background-color: #990000;" onClick="showColor('#990000');" onMouseOver="showColor_over('#990000');"> </td>
- <td style="width: 10px; background-color: #990033;" onClick="showColor('#990033');" onMouseOver="showColor_over('#990033');"> </td>
- <td style="width: 10px; background-color: #990066;" onClick="showColor('#990066');" onMouseOver="showColor_over('#990066');"> </td>
- <td style="width: 10px; background-color: #990099;" onClick="showColor('#990099');" onMouseOver="showColor_over('#990099');"> </td>
- <td style="width: 10px; background-color: #9900CC;" onClick="showColor('#9900CC');" onMouseOver="showColor_over('#9900CC');"> </td>
- <td style="width: 10px; background-color: #9900FF;" onClick="showColor('#9900FF');" onMouseOver="showColor_over('#9900FF');"> </td>
- <td style="width: 10px; background-color: #CC0000;" onClick="showColor('#CC0000');" onMouseOver="showColor_over('#CC0000');"> </td>
- <td style="width: 10px; background-color: #CC0033;" onClick="showColor('#CC0033');" onMouseOver="showColor_over('#CC0033');"> </td>
- <td style="width: 10px; background-color: #CC0066;" onClick="showColor('#CC0066');" onMouseOver="showColor_over('#CC0066');"> </td>
- <td style="width: 10px; background-color: #CC0099;" onClick="showColor('#CC0099');" onMouseOver="showColor_over('#CC0099');"> </td>
- <td style="width: 10px; background-color: #CC00CC;" onClick="showColor('#CC00CC');" onMouseOver="showColor_over('#CC00CC');"> </td>
- <td style="width: 10px; background-color: #CC00FF;" onClick="showColor('#CC00FF');" onMouseOver="showColor_over('#CC00FF');"> </td>
- <td style="width: 10px; background-color: #FF0000;" onClick="showColor('#FF0000');" onMouseOver="showColor_over('#FF0000');"> </td>
- <td style="width: 10px; background-color: #FF0033;" onClick="showColor('#FF0033');" onMouseOver="showColor_over('#FF0033');"> </td>
- <td style="width: 10px; background-color: #FF0066;" onClick="showColor('#FF0066');" onMouseOver="showColor_over('#FF0066');"> </td>
- <td style="width: 10px; background-color: #FF0099;" onClick="showColor('#FF0099');" onMouseOver="showColor_over('#FF0099');"> </td>
- <td style="width: 10px; background-color: #FF00CC;" onClick="showColor('#FF00CC');" onMouseOver="showColor_over('#FF00CC');"> </td>
- <td style="width: 10px; background-color: #FF00FF;" onClick="showColor('#FF00FF');" onMouseOver="showColor_over('#FF00FF');"> </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr align="center">
- <td height="14" colspan="4" class="line_left2 line_right2 text3 bg2"> Ausgew�hlte Farbe:</td>
- </tr>
- <tr>
- <td height="25" class="line_left2 line_down2 text1">
- <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid black; background-color: #FFFFFF">
- <tr>
- <td id="preview" width="100%"> </td>
- </tr>
- </table>
- </td>
- <td class="line_down2"> </td>
- <td width="38" class="text1 line_down2"><input id="color" value="#000000" size="6" readonly class="inputfield"></td>
- <td width="364" class="line_down2 line_right2" align="right">
- <input type="button" value="Speichern" onClick="returnToMain();" class="button">
- <input type="button" value="Abbruch" onClick="window.close();" class="button">
- </td>
- </tr>
-</table>
-</body>
-</html>
Copied: trunk/mapbender/http/sld/sld_pick_color.php (from rev 2404, branches/2.5/http/sld/sld_pick_color.php)
===================================================================
--- trunk/mapbender/http/sld/sld_pick_color.php (rev 0)
+++ trunk/mapbender/http/sld/sld_pick_color.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,330 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/SLD/
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/**
+ * Color-picker module.
+ * This file realizes a color-picker module for the sld-editor so that
+ * the users do not have to work with RGB values.
+ * A number of colors from a wide spectrum is available with a preview
+ * of each color.
+ * Choosing a color and submitting the form will also submit the sld_edit_form
+ * to directly save the changes to the sld.
+ *
+ * @package sld_pick_color
+ * @author Markus Krzyzanowski, Design by Bao Ngan
+ */
+
+
+session_start();
+$id = $_REQUEST["id"];
+$color= $_REQUEST["color"];
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+?>
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="../css/sldEditor.css">
+<script Language="JavaScript">
+function returnToMain()
+{
+ window.opener.document.getElementById("<?php echo $id; ?>").value = document.getElementById('color').value;
+ var preview = window.opener.document.getElementById('<?php echo $id; ?>_preview');
+ preview.style.background = document.getElementById('color').value;
+ window.opener.document.getElementById("sld_editor_form").submit();
+ window.close();
+}
+function showColor(color)
+{
+ document.getElementById('color').value = color;
+ document.getElementById('preview').style.background = color;
+}
+function showColor_over(color)
+{
+ document.getElementById('preview_over').style.background = color;
+}
+</script>
+</head>
+<body leftmargin="2" topmargin="2">
+<!------ Rahmentabelle ------>
+<table width="294" height="188" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td height="14" colspan="4" align="center" class="text3 bg2">Farbpalette</td>
+ </tr>
+ <tr>
+ <td width="33" height="135" class="line_left2 ">
+ <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid black; background-color: #FFFFFF">
+ <tr>
+ <td height="132" id="preview_over" width="100%"> </td>
+ </tr>
+ </table>
+ </td>
+ <td width="4"> </td>
+ <td colspan="2" class="line_right2 ">
+ <table style="border:1px solid black;" cellspacing="1" cellpadding="1" width="87%">
+ <tr>
+ <td width="10" style="width: 10px; background-color: #00FF00;" onClick="showColor('#00FF00');" onMouseOver="showColor_over('#00FF00');"> </td>
+ <td width="10" style="width: 10px; background-color: #00FF33;" onClick="showColor('#00FF33');" onMouseOver="showColor_over('#00FF33');"> </td>
+ <td width="10" style="width: 10px; background-color: #00FF66;" onClick="showColor('#00FF66');" onMouseOver="showColor_over('#00FF66');"> </td>
+ <td width="10" style="width: 10px; background-color: #00FF99;" onClick="showColor('#00FF99');" onMouseOver="showColor_over('#00FF99');"> </td>
+ <td width="10" style="width: 10px; background-color: #00FFCC;" onClick="showColor('#00FFCC');" onMouseOver="showColor_over('#00FFCC');"> </td>
+ <td width="10" style="width: 10px; background-color: #00FFFF;" onClick="showColor('#00FFFF');" onMouseOver="showColor_over('#00FFFF');"> </td>
+ <td width="10" style="width: 10px; background-color: #33FF00;" onClick="showColor('#33FF00');" onMouseOver="showColor_over('#33FF00');"> </td>
+ <td width="10" style="width: 10px; background-color: #33FF33;" onClick="showColor('#33FF33');" onMouseOver="showColor_over('#33FF33');"> </td>
+ <td width="10" style="width: 10px; background-color: #33FF66;" onClick="showColor('#33FF66');" onMouseOver="showColor_over('#33FF66');"> </td>
+ <td width="10" style="width: 10px; background-color: #33FF99;" onClick="showColor('#33FF99');" onMouseOver="showColor_over('#33FF99');"> </td>
+ <td width="10" style="width: 10px; background-color: #33FFCC;" onClick="showColor('#33FFCC');" onMouseOver="showColor_over('#33FFCC');"> </td>
+ <td width="10" style="width: 10px; background-color: #33FFFF;" onClick="showColor('#33FFFF');" onMouseOver="showColor_over('#33FFFF');"> </td>
+ <td width="10" style="width: 10px; background-color: #66FF00;" onClick="showColor('#66FF00');" onMouseOver="showColor_over('#66FF00');"> </td>
+ <td width="10" style="width: 10px; background-color: #66FF33;" onClick="showColor('#66FF33');" onMouseOver="showColor_over('#66FF33');"> </td>
+ <td width="10" style="width: 10px; background-color: #66FF66;" onClick="showColor('#66FF66');" onMouseOver="showColor_over('#66FF66');"> </td>
+ <td width="10" style="width: 10px; background-color: #66FF99;" onClick="showColor('#66FF99');" onMouseOver="showColor_over('#66FF99');"> </td>
+ <td width="10" style="width: 10px; background-color: #66FFCC;" onClick="showColor('#66FFCC');" onMouseOver="showColor_over('#66FFCC');"> </td>
+ <td width="10" style="width: 10px; background-color: #66FFFF;" onClick="showColor('#66FFFF');" onMouseOver="showColor_over('#66FFFF');"> </td>
+ <td width="10" style="width: 10px; background-color: #99FF00;" onClick="showColor('#99FF00');" onMouseOver="showColor_over('#99FF00');"> </td>
+ <td width="10" style="width: 10px; background-color: #99FF33;" onClick="showColor('#99FF33');" onMouseOver="showColor_over('#99FF33');"> </td>
+ <td width="10" style="width: 10px; background-color: #99FF66;" onClick="showColor('#99FF66');" onMouseOver="showColor_over('#99FF66');"> </td>
+ <td width="10" style="width: 10px; background-color: #99FF99;" onClick="showColor('#99FF99');" onMouseOver="showColor_over('#99FF99');"> </td>
+ <td width="10" style="width: 10px; background-color: #99FFCC;" onClick="showColor('#99FFCC');" onMouseOver="showColor_over('#99FFCC');"> </td>
+ <td width="10" style="width: 10px; background-color: #99FFFF;" onClick="showColor('#99FFFF');" onMouseOver="showColor_over('#99FFFF');"> </td>
+ <td width="10" style="width: 10px; background-color: #CCFF00;" onClick="showColor('#CCFF00');" onMouseOver="showColor_over('#CCFF00');"> </td>
+ <td width="10" style="width: 10px; background-color: #CCFF33;" onClick="showColor('#CCFF33');" onMouseOver="showColor_over('#CCFF33');"> </td>
+ <td width="10" style="width: 10px; background-color: #CCFF66;" onClick="showColor('#CCFF66');" onMouseOver="showColor_over('#CCFF66');"> </td>
+ <td width="10" style="width: 10px; background-color: #CCFF99;" onClick="showColor('#CCFF99');" onMouseOver="showColor_over('#CCFF99');"> </td>
+ <td width="10" style="width: 10px; background-color: #CCFFCC;" onClick="showColor('#CCFFCC');" onMouseOver="showColor_over('#CCFFCC');"> </td>
+ <td width="10" style="width: 10px; background-color: #CCFFFF;" onClick="showColor('#CCFFFF');" onMouseOver="showColor_over('#CCFFFF');"> </td>
+ <td width="10" style="width: 10px; background-color: #FFFF00;" onClick="showColor('#FFFF00');" onMouseOver="showColor_over('#FFFF00');"> </td>
+ <td width="10" style="width: 10px; background-color: #FFFF33;" onClick="showColor('#FFFF33');" onMouseOver="showColor_over('#FFFF33');"> </td>
+ <td width="10" style="width: 10px; background-color: #FFFF66;" onClick="showColor('#FFFF66');" onMouseOver="showColor_over('#FFFF66');"> </td>
+ <td width="10" style="width: 10px; background-color: #FFFF99;" onClick="showColor('#FFFF99');" onMouseOver="showColor_over('#FFFF99');"> </td>
+ <td width="10" style="width: 10px; background-color: #FFFFCC;" onClick="showColor('#FFFFCC');" onMouseOver="showColor_over('#FFFFCC');"> </td>
+ <td width="10" style="width: 10px; background-color: #FFFFFF;" onClick="showColor('#FFFFFF');" onMouseOver="showColor_over('#FFFFFF');"> </td>
+ </tr>
+ <tr>
+ <td style="width: 10px; background-color: #00CC00;" onClick="showColor('#00CC00');" onMouseOver="showColor_over('#00CC00');"> </td>
+ <td style="width: 10px; background-color: #00CC33;" onClick="showColor('#00CC33');" onMouseOver="showColor_over('#00CC33');"> </td>
+ <td style="width: 10px; background-color: #00CC66;" onClick="showColor('#00CC66');" onMouseOver="showColor_over('#00CC66');"> </td>
+ <td style="width: 10px; background-color: #00CC99;" onClick="showColor('#00CC99');" onMouseOver="showColor_over('#00CC99');"> </td>
+ <td style="width: 10px; background-color: #00CCCC;" onClick="showColor('#00CCCC');" onMouseOver="showColor_over('#00CCCC');"> </td>
+ <td style="width: 10px; background-color: #00CCFF;" onClick="showColor('#00CCFF');" onMouseOver="showColor_over('#00CCFF');"> </td>
+ <td style="width: 10px; background-color: #33CC00;" onClick="showColor('#33CC00');" onMouseOver="showColor_over('#33CC00');"> </td>
+ <td style="width: 10px; background-color: #33CC33;" onClick="showColor('#33CC33');" onMouseOver="showColor_over('#33CC33');"> </td>
+ <td style="width: 10px; background-color: #33CC66;" onClick="showColor('#33CC66');" onMouseOver="showColor_over('#33CC66');"> </td>
+ <td style="width: 10px; background-color: #33CC99;" onClick="showColor('#33CC99');" onMouseOver="showColor_over('#33CC99');"> </td>
+ <td style="width: 10px; background-color: #33CCCC;" onClick="showColor('#33CCCC');" onMouseOver="showColor_over('#33CCCC');"> </td>
+ <td style="width: 10px; background-color: #33CCFF;" onClick="showColor('#33CCFF');" onMouseOver="showColor_over('#33CCFF');"> </td>
+ <td style="width: 10px; background-color: #66CC00;" onClick="showColor('#66CC00');" onMouseOver="showColor_over('#66CC00');"> </td>
+ <td style="width: 10px; background-color: #66CC33;" onClick="showColor('#66CC33');" onMouseOver="showColor_over('#66CC33');"> </td>
+ <td style="width: 10px; background-color: #66CC66;" onClick="showColor('#66CC66');" onMouseOver="showColor_over('#66CC66');"> </td>
+ <td style="width: 10px; background-color: #66CC99;" onClick="showColor('#66CC99');" onMouseOver="showColor_over('#66CC99');"> </td>
+ <td style="width: 10px; background-color: #66CCCC;" onClick="showColor('#66CCCC');" onMouseOver="showColor_over('#66CCCC');"> </td>
+ <td style="width: 10px; background-color: #66CCFF;" onClick="showColor('#66CCFF');" onMouseOver="showColor_over('#66CCFF');"> </td>
+ <td style="width: 10px; background-color: #99CC00;" onClick="showColor('#99CC00');" onMouseOver="showColor_over('#99CC00');"> </td>
+ <td style="width: 10px; background-color: #99CC33;" onClick="showColor('#99CC33');" onMouseOver="showColor_over('#99CC33');"> </td>
+ <td style="width: 10px; background-color: #99CC66;" onClick="showColor('#99CC66');" onMouseOver="showColor_over('#99CC66');"> </td>
+ <td style="width: 10px; background-color: #99CC99;" onClick="showColor('#99CC99');" onMouseOver="showColor_over('#99CC99');"> </td>
+ <td style="width: 10px; background-color: #99CCCC;" onClick="showColor('#99CCCC');" onMouseOver="showColor_over('#99CCCC');"> </td>
+ <td style="width: 10px; background-color: #99CCFF;" onClick="showColor('#99CCFF');" onMouseOver="showColor_over('#99CCFF');"> </td>
+ <td style="width: 10px; background-color: #CCCC00;" onClick="showColor('#CCCC00');" onMouseOver="showColor_over('#CCCC00');"> </td>
+ <td style="width: 10px; background-color: #CCCC33;" onClick="showColor('#CCCC33');" onMouseOver="showColor_over('#CCCC33');"> </td>
+ <td style="width: 10px; background-color: #CCCC66;" onClick="showColor('#CCCC66');" onMouseOver="showColor_over('#CCCC66');"> </td>
+ <td style="width: 10px; background-color: #CCCC99;" onClick="showColor('#CCCC99');" onMouseOver="showColor_over('#CCCC99');"> </td>
+ <td style="width: 10px; background-color: #CCCCCC;" onClick="showColor('#CCCCCC');" onMouseOver="showColor_over('#CCCCCC');"> </td>
+ <td style="width: 10px; background-color: #CCCCFF;" onClick="showColor('#CCCCFF');" onMouseOver="showColor_over('#CCCCFF');"> </td>
+ <td style="width: 10px; background-color: #FFCC00;" onClick="showColor('#FFCC00');" onMouseOver="showColor_over('#FFCC00');"> </td>
+ <td style="width: 10px; background-color: #FFCC33;" onClick="showColor('#FFCC33');" onMouseOver="showColor_over('#FFCC33');"> </td>
+ <td style="width: 10px; background-color: #FFCC66;" onClick="showColor('#FFCC66');" onMouseOver="showColor_over('#FFCC66');"> </td>
+ <td style="width: 10px; background-color: #FFCC99;" onClick="showColor('#FFCC99');" onMouseOver="showColor_over('#FFCC99');"> </td>
+ <td style="width: 10px; background-color: #FFCCCC;" onClick="showColor('#FFCCCC');" onMouseOver="showColor_over('#FFCCCC');"> </td>
+ <td style="width: 10px; background-color: #FFCCFF;" onClick="showColor('#FFCCFF');" onMouseOver="showColor_over('#FFCCFF');"> </td>
+ </tr>
+ <tr>
+ <td style="width: 10px; background-color: #009900;" onClick="showColor('#009900');" onMouseOver="showColor_over('#009900');"> </td>
+ <td style="width: 10px; background-color: #009933;" onClick="showColor('#009933');" onMouseOver="showColor_over('#009933');"> </td>
+ <td style="width: 10px; background-color: #009966;" onClick="showColor('#009966');" onMouseOver="showColor_over('#009966');"> </td>
+ <td style="width: 10px; background-color: #009999;" onClick="showColor('#009999');" onMouseOver="showColor_over('#009999');"> </td>
+ <td style="width: 10px; background-color: #0099CC;" onClick="showColor('#0099CC');" onMouseOver="showColor_over('#0099CC');"> </td>
+ <td style="width: 10px; background-color: #0099FF;" onClick="showColor('#0099FF');" onMouseOver="showColor_over('#0099FF');"> </td>
+ <td style="width: 10px; background-color: #339900;" onClick="showColor('#339900');" onMouseOver="showColor_over('#339900');"> </td>
+ <td style="width: 10px; background-color: #339933;" onClick="showColor('#339933');" onMouseOver="showColor_over('#339933');"> </td>
+ <td style="width: 10px; background-color: #339966;" onClick="showColor('#339966');" onMouseOver="showColor_over('#339966');"> </td>
+ <td style="width: 10px; background-color: #339999;" onClick="showColor('#339999');" onMouseOver="showColor_over('#339999');"> </td>
+ <td style="width: 10px; background-color: #3399CC;" onClick="showColor('#3399CC');" onMouseOver="showColor_over('#3399CC');"> </td>
+ <td style="width: 10px; background-color: #3399FF;" onClick="showColor('#3399FF');" onMouseOver="showColor_over('#3399FF');"> </td>
+ <td style="width: 10px; background-color: #669900;" onClick="showColor('#669900');" onMouseOver="showColor_over('#669900');"> </td>
+ <td style="width: 10px; background-color: #669933;" onClick="showColor('#669933');" onMouseOver="showColor_over('#669933');"> </td>
+ <td style="width: 10px; background-color: #669966;" onClick="showColor('#669966');" onMouseOver="showColor_over('#669966');"> </td>
+ <td style="width: 10px; background-color: #669999;" onClick="showColor('#669999');" onMouseOver="showColor_over('#669999');"> </td>
+ <td style="width: 10px; background-color: #6699CC;" onClick="showColor('#6699CC');" onMouseOver="showColor_over('#6699CC');"> </td>
+ <td style="width: 10px; background-color: #6699FF;" onClick="showColor('#6699FF');" onMouseOver="showColor_over('#6699FF');"> </td>
+ <td style="width: 10px; background-color: #999900;" onClick="showColor('#999900');" onMouseOver="showColor_over('#999900');"> </td>
+ <td style="width: 10px; background-color: #999933;" onClick="showColor('#999933');" onMouseOver="showColor_over('#999933');"> </td>
+ <td style="width: 10px; background-color: #999966;" onClick="showColor('#999966');" onMouseOver="showColor_over('#999966');"> </td>
+ <td style="width: 10px; background-color: #999999;" onClick="showColor('#999999');" onMouseOver="showColor_over('#999999');"> </td>
+ <td style="width: 10px; background-color: #9999CC;" onClick="showColor('#9999CC');" onMouseOver="showColor_over('#9999CC');"> </td>
+ <td style="width: 10px; background-color: #9999FF;" onClick="showColor('#9999FF');" onMouseOver="showColor_over('#9999FF');"> </td>
+ <td style="width: 10px; background-color: #CC9900;" onClick="showColor('#CC9900');" onMouseOver="showColor_over('#CC9900');"> </td>
+ <td style="width: 10px; background-color: #CC9933;" onClick="showColor('#CC9933');" onMouseOver="showColor_over('#CC9933');"> </td>
+ <td style="width: 10px; background-color: #CC9966;" onClick="showColor('#CC9966');" onMouseOver="showColor_over('#CC9966');"> </td>
+ <td style="width: 10px; background-color: #CC9999;" onClick="showColor('#CC9999');" onMouseOver="showColor_over('#CC9999');"> </td>
+ <td style="width: 10px; background-color: #CC99CC;" onClick="showColor('#CC99CC');" onMouseOver="showColor_over('#CC99CC');"> </td>
+ <td style="width: 10px; background-color: #CC99FF;" onClick="showColor('#CC99FF');" onMouseOver="showColor_over('#CC99FF');"> </td>
+ <td style="width: 10px; background-color: #FF9900;" onClick="showColor('#FF9900');" onMouseOver="showColor_over('#FF9900');"> </td>
+ <td style="width: 10px; background-color: #FF9933;" onClick="showColor('#FF9933');" onMouseOver="showColor_over('#FF9933');"> </td>
+ <td style="width: 10px; background-color: #FF9966;" onClick="showColor('#FF9966');" onMouseOver="showColor_over('#FF9966');"> </td>
+ <td style="width: 10px; background-color: #FF9999;" onClick="showColor('#FF9999');" onMouseOver="showColor_over('#FF9999');"> </td>
+ <td style="width: 10px; background-color: #FF99CC;" onClick="showColor('#FF99CC');" onMouseOver="showColor_over('#FF99CC');"> </td>
+ <td style="width: 10px; background-color: #FF99FF;" onClick="showColor('#FF99FF');" onMouseOver="showColor_over('#FF99FF');"> </td>
+ </tr>
+ <tr>
+ <td style="width: 10px; background-color: #006600;" onClick="showColor('#006600');" onMouseOver="showColor_over('#006600');"> </td>
+ <td style="width: 10px; background-color: #006633;" onClick="showColor('#006633');" onMouseOver="showColor_over('#006633');"> </td>
+ <td style="width: 10px; background-color: #006666;" onClick="showColor('#006666');" onMouseOver="showColor_over('#006666');"> </td>
+ <td style="width: 10px; background-color: #006699;" onClick="showColor('#006699');" onMouseOver="showColor_over('#006699');"> </td>
+ <td style="width: 10px; background-color: #0066CC;" onClick="showColor('#0066CC');" onMouseOver="showColor_over('#0066CC');"> </td>
+ <td style="width: 10px; background-color: #0066FF;" onClick="showColor('#0066FF');" onMouseOver="showColor_over('#0066FF');"> </td>
+ <td style="width: 10px; background-color: #336600;" onClick="showColor('#336600');" onMouseOver="showColor_over('#336600');"> </td>
+ <td style="width: 10px; background-color: #336633;" onClick="showColor('#336633');" onMouseOver="showColor_over('#336633');"> </td>
+ <td style="width: 10px; background-color: #336666;" onClick="showColor('#336666');" onMouseOver="showColor_over('#336666');"> </td>
+ <td style="width: 10px; background-color: #336699;" onClick="showColor('#336699');" onMouseOver="showColor_over('#336699');"> </td>
+ <td style="width: 10px; background-color: #3366CC;" onClick="showColor('#3366CC');" onMouseOver="showColor_over('#3366CC');"> </td>
+ <td style="width: 10px; background-color: #3366FF;" onClick="showColor('#3366FF');" onMouseOver="showColor_over('#3366FF');"> </td>
+ <td style="width: 10px; background-color: #666600;" onClick="showColor('#666600');" onMouseOver="showColor_over('#666600');"> </td>
+ <td style="width: 10px; background-color: #666633;" onClick="showColor('#666633');" onMouseOver="showColor_over('#666633');"> </td>
+ <td style="width: 10px; background-color: #666666;" onClick="showColor('#666666');" onMouseOver="showColor_over('#666666');"> </td>
+ <td style="width: 10px; background-color: #666699;" onClick="showColor('#666699');" onMouseOver="showColor_over('#666699');"> </td>
+ <td style="width: 10px; background-color: #6666CC;" onClick="showColor('#6666CC');" onMouseOver="showColor_over('#6666CC');"> </td>
+ <td style="width: 10px; background-color: #6666FF;" onClick="showColor('#6666FF');" onMouseOver="showColor_over('#6666FF');"> </td>
+ <td style="width: 10px; background-color: #996600;" onClick="showColor('#996600');" onMouseOver="showColor_over('#996600');"> </td>
+ <td style="width: 10px; background-color: #996633;" onClick="showColor('#996633');" onMouseOver="showColor_over('#996633');"> </td>
+ <td style="width: 10px; background-color: #996666;" onClick="showColor('#996666');" onMouseOver="showColor_over('#996666');"> </td>
+ <td style="width: 10px; background-color: #996699;" onClick="showColor('#996699');" onMouseOver="showColor_over('#996699');"> </td>
+ <td style="width: 10px; background-color: #9966CC;" onClick="showColor('#9966CC');" onMouseOver="showColor_over('#9966CC');"> </td>
+ <td style="width: 10px; background-color: #9966FF;" onClick="showColor('#9966FF');" onMouseOver="showColor_over('#9966FF');"> </td>
+ <td style="width: 10px; background-color: #CC6600;" onClick="showColor('#CC6600');" onMouseOver="showColor_over('#CC6600');"> </td>
+ <td style="width: 10px; background-color: #CC6633;" onClick="showColor('#CC6633');" onMouseOver="showColor_over('#CC6633');"> </td>
+ <td style="width: 10px; background-color: #CC6666;" onClick="showColor('#CC6666');" onMouseOver="showColor_over('#CC6666');"> </td>
+ <td style="width: 10px; background-color: #CC6699;" onClick="showColor('#CC6699');" onMouseOver="showColor_over('#CC6699');"> </td>
+ <td style="width: 10px; background-color: #CC66CC;" onClick="showColor('#CC66CC');" onMouseOver="showColor_over('#CC66CC');"> </td>
+ <td style="width: 10px; background-color: #CC66FF;" onClick="showColor('#CC66FF');" onMouseOver="showColor_over('#CC66FF');"> </td>
+ <td style="width: 10px; background-color: #FF6600;" onClick="showColor('#FF6600');" onMouseOver="showColor_over('#FF6600');"> </td>
+ <td style="width: 10px; background-color: #FF6633;" onClick="showColor('#FF6633');" onMouseOver="showColor_over('#FF6633');"> </td>
+ <td style="width: 10px; background-color: #FF6666;" onClick="showColor('#FF6666');" onMouseOver="showColor_over('#FF6666');"> </td>
+ <td style="width: 10px; background-color: #FF6699;" onClick="showColor('#FF6699');" onMouseOver="showColor_over('#FF6699');"> </td>
+ <td style="width: 10px; background-color: #FF66CC;" onClick="showColor('#FF66CC');" onMouseOver="showColor_over('#FF66CC');"> </td>
+ <td style="width: 10px; background-color: #FF66FF;" onClick="showColor('#FF66FF');" onMouseOver="showColor_over('#FF66FF');"> </td>
+ </tr>
+ <tr>
+ <td style="width: 10px; background-color: #003300;" onClick="showColor('#003300');" onMouseOver="showColor_over('#003300');"> </td>
+ <td style="width: 10px; background-color: #003333;" onClick="showColor('#003333');" onMouseOver="showColor_over('#003333');"> </td>
+ <td style="width: 10px; background-color: #003366;" onClick="showColor('#003366');" onMouseOver="showColor_over('#003366');"> </td>
+ <td style="width: 10px; background-color: #003399;" onClick="showColor('#003399');" onMouseOver="showColor_over('#003399');"> </td>
+ <td style="width: 10px; background-color: #0033CC;" onClick="showColor('#0033CC');" onMouseOver="showColor_over('#0033CC');"> </td>
+ <td style="width: 10px; background-color: #0033FF;" onClick="showColor('#0033FF');" onMouseOver="showColor_over('#0033FF');"> </td>
+ <td style="width: 10px; background-color: #333300;" onClick="showColor('#333300');" onMouseOver="showColor_over('#333300');"> </td>
+ <td style="width: 10px; background-color: #333333;" onClick="showColor('#333333');" onMouseOver="showColor_over('#333333');"> </td>
+ <td style="width: 10px; background-color: #333366;" onClick="showColor('#333366');" onMouseOver="showColor_over('#333366');"> </td>
+ <td style="width: 10px; background-color: #333399;" onClick="showColor('#333399');" onMouseOver="showColor_over('#333399');"> </td>
+ <td style="width: 10px; background-color: #3333CC;" onClick="showColor('#3333CC');" onMouseOver="showColor_over('#3333CC');"> </td>
+ <td style="width: 10px; background-color: #3333FF;" onClick="showColor('#3333FF');" onMouseOver="showColor_over('#3333FF');"> </td>
+ <td style="width: 10px; background-color: #663300;" onClick="showColor('#663300');" onMouseOver="showColor_over('#663300');"> </td>
+ <td style="width: 10px; background-color: #663333;" onClick="showColor('#663333');" onMouseOver="showColor_over('#663333');"> </td>
+ <td style="width: 10px; background-color: #663366;" onClick="showColor('#663366');" onMouseOver="showColor_over('#663366');"> </td>
+ <td style="width: 10px; background-color: #663399;" onClick="showColor('#663399');" onMouseOver="showColor_over('#663399');"> </td>
+ <td style="width: 10px; background-color: #6633CC;" onClick="showColor('#6633CC');" onMouseOver="showColor_over('#6633CC');"> </td>
+ <td style="width: 10px; background-color: #6633FF;" onClick="showColor('#6633FF');" onMouseOver="showColor_over('#6633FF');"> </td>
+ <td style="width: 10px; background-color: #993300;" onClick="showColor('#993300');" onMouseOver="showColor_over('#993300');"> </td>
+ <td style="width: 10px; background-color: #993333;" onClick="showColor('#993333');" onMouseOver="showColor_over('#993333');"> </td>
+ <td style="width: 10px; background-color: #993366;" onClick="showColor('#993366');" onMouseOver="showColor_over('#993366');"> </td>
+ <td style="width: 10px; background-color: #993399;" onClick="showColor('#993399');" onMouseOver="showColor_over('#993399');"> </td>
+ <td style="width: 10px; background-color: #9933CC;" onClick="showColor('#9933CC');" onMouseOver="showColor_over('#9933CC');"> </td>
+ <td style="width: 10px; background-color: #9933FF;" onClick="showColor('#9933FF');" onMouseOver="showColor_over('#9933FF');"> </td>
+ <td style="width: 10px; background-color: #CC3300;" onClick="showColor('#CC3300');" onMouseOver="showColor_over('#CC3300');"> </td>
+ <td style="width: 10px; background-color: #CC3333;" onClick="showColor('#CC3333');" onMouseOver="showColor_over('#CC3333');"> </td>
+ <td style="width: 10px; background-color: #CC3366;" onClick="showColor('#CC3366');" onMouseOver="showColor_over('#CC3366');"> </td>
+ <td style="width: 10px; background-color: #CC3399;" onClick="showColor('#CC3399');" onMouseOver="showColor_over('#CC3399');"> </td>
+ <td style="width: 10px; background-color: #CC33CC;" onClick="showColor('#CC33CC');" onMouseOver="showColor_over('#CC33CC');"> </td>
+ <td style="width: 10px; background-color: #CC33FF;" onClick="showColor('#CC33FF');" onMouseOver="showColor_over('#CC33FF');"> </td>
+ <td style="width: 10px; background-color: #FF3300;" onClick="showColor('#FF3300');" onMouseOver="showColor_over('#FF3300');"> </td>
+ <td style="width: 10px; background-color: #FF3333;" onClick="showColor('#FF3333');" onMouseOver="showColor_over('#FF3333');"> </td>
+ <td style="width: 10px; background-color: #FF3366;" onClick="showColor('#FF3366');" onMouseOver="showColor_over('#FF3366');"> </td>
+ <td style="width: 10px; background-color: #FF3399;" onClick="showColor('#FF3399');" onMouseOver="showColor_over('#FF3399');"> </td>
+ <td style="width: 10px; background-color: #FF33CC;" onClick="showColor('#FF33CC');" onMouseOver="showColor_over('#FF33CC');"> </td>
+ <td style="width: 10px; background-color: #FF33FF;" onClick="showColor('#FF33FF');" onMouseOver="showColor_over('#FF33FF');"> </td>
+ </tr>
+ <tr>
+ <td height="21" style="width: 10px; background-color: #000000;" onClick="showColor('#000000');" onMouseOver="showColor_over('#000000');"> </td>
+ <td style="width: 10px; background-color: #000033;" onClick="showColor('#000033');" onMouseOver="showColor_over('#000033');"> </td>
+ <td style="width: 10px; background-color: #000066;" onClick="showColor('#000066');" onMouseOver="showColor_over('#000066');"> </td>
+ <td style="width: 10px; background-color: #000099;" onClick="showColor('#000099');" onMouseOver="showColor_over('#000099');"> </td>
+ <td style="width: 10px; background-color: #0000CC;" onClick="showColor('#0000CC');" onMouseOver="showColor_over('#0000CC');"> </td>
+ <td style="width: 10px; background-color: #0000FF;" onClick="showColor('#0000FF');" onMouseOver="showColor_over('#0000FF');"> </td>
+ <td style="width: 10px; background-color: #330000;" onClick="showColor('#330000');" onMouseOver="showColor_over('#330000');"> </td>
+ <td style="width: 10px; background-color: #330033;" onClick="showColor('#330033');" onMouseOver="showColor_over('#330033');"> </td>
+ <td style="width: 10px; background-color: #330066;" onClick="showColor('#330066');" onMouseOver="showColor_over('#330066');"> </td>
+ <td style="width: 10px; background-color: #330099;" onClick="showColor('#330099');" onMouseOver="showColor_over('#330099');"> </td>
+ <td style="width: 10px; background-color: #3300CC;" onClick="showColor('#3300CC');" onMouseOver="showColor_over('#3300CC');"> </td>
+ <td style="width: 10px; background-color: #3300FF;" onClick="showColor('#3300FF');" onMouseOver="showColor_over('#3300FF');"> </td>
+ <td style="width: 10px; background-color: #660000;" onClick="showColor('#660000');" onMouseOver="showColor_over('#660000');"> </td>
+ <td style="width: 10px; background-color: #660033;" onClick="showColor('#660033');" onMouseOver="showColor_over('#660033');"> </td>
+ <td style="width: 10px; background-color: #660066;" onClick="showColor('#660066');" onMouseOver="showColor_over('#660066');"> </td>
+ <td style="width: 10px; background-color: #660099;" onClick="showColor('#660099');" onMouseOver="showColor_over('#660099');"> </td>
+ <td style="width: 10px; background-color: #6600CC;" onClick="showColor('#6600CC');" onMouseOver="showColor_over('#6600CC');"> </td>
+ <td style="width: 10px; background-color: #6600FF;" onClick="showColor('#6600FF');" onMouseOver="showColor_over('#6600FF');"> </td>
+ <td style="width: 10px; background-color: #990000;" onClick="showColor('#990000');" onMouseOver="showColor_over('#990000');"> </td>
+ <td style="width: 10px; background-color: #990033;" onClick="showColor('#990033');" onMouseOver="showColor_over('#990033');"> </td>
+ <td style="width: 10px; background-color: #990066;" onClick="showColor('#990066');" onMouseOver="showColor_over('#990066');"> </td>
+ <td style="width: 10px; background-color: #990099;" onClick="showColor('#990099');" onMouseOver="showColor_over('#990099');"> </td>
+ <td style="width: 10px; background-color: #9900CC;" onClick="showColor('#9900CC');" onMouseOver="showColor_over('#9900CC');"> </td>
+ <td style="width: 10px; background-color: #9900FF;" onClick="showColor('#9900FF');" onMouseOver="showColor_over('#9900FF');"> </td>
+ <td style="width: 10px; background-color: #CC0000;" onClick="showColor('#CC0000');" onMouseOver="showColor_over('#CC0000');"> </td>
+ <td style="width: 10px; background-color: #CC0033;" onClick="showColor('#CC0033');" onMouseOver="showColor_over('#CC0033');"> </td>
+ <td style="width: 10px; background-color: #CC0066;" onClick="showColor('#CC0066');" onMouseOver="showColor_over('#CC0066');"> </td>
+ <td style="width: 10px; background-color: #CC0099;" onClick="showColor('#CC0099');" onMouseOver="showColor_over('#CC0099');"> </td>
+ <td style="width: 10px; background-color: #CC00CC;" onClick="showColor('#CC00CC');" onMouseOver="showColor_over('#CC00CC');"> </td>
+ <td style="width: 10px; background-color: #CC00FF;" onClick="showColor('#CC00FF');" onMouseOver="showColor_over('#CC00FF');"> </td>
+ <td style="width: 10px; background-color: #FF0000;" onClick="showColor('#FF0000');" onMouseOver="showColor_over('#FF0000');"> </td>
+ <td style="width: 10px; background-color: #FF0033;" onClick="showColor('#FF0033');" onMouseOver="showColor_over('#FF0033');"> </td>
+ <td style="width: 10px; background-color: #FF0066;" onClick="showColor('#FF0066');" onMouseOver="showColor_over('#FF0066');"> </td>
+ <td style="width: 10px; background-color: #FF0099;" onClick="showColor('#FF0099');" onMouseOver="showColor_over('#FF0099');"> </td>
+ <td style="width: 10px; background-color: #FF00CC;" onClick="showColor('#FF00CC');" onMouseOver="showColor_over('#FF00CC');"> </td>
+ <td style="width: 10px; background-color: #FF00FF;" onClick="showColor('#FF00FF');" onMouseOver="showColor_over('#FF00FF');"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr align="center">
+ <td height="14" colspan="4" class="line_left2 line_right2 text3 bg2"> Ausgew�hlte Farbe:</td>
+ </tr>
+ <tr>
+ <td height="25" class="line_left2 line_down2 text1">
+ <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid black; background-color: #FFFFFF">
+ <tr>
+ <td id="preview" width="100%"> </td>
+ </tr>
+ </table>
+ </td>
+ <td class="line_down2"> </td>
+ <td width="38" class="text1 line_down2"><input id="color" value="#000000" size="6" readonly class="inputfield"></td>
+ <td width="364" class="line_down2 line_right2" align="right">
+ <input type="button" value="Speichern" onClick="returnToMain();" class="button">
+ <input type="button" value="Abbruch" onClick="window.close();" class="button">
+ </td>
+ </tr>
+</table>
+</body>
+</html>
Deleted: trunk/mapbender/http/tools/mapFiler.php
===================================================================
--- trunk/mapbender/http/tools/mapFiler.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/tools/mapFiler.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,126 +0,0 @@
-<html>
- <head>
- <title>MapFile</title>
- <style></style>
- <script type='text/javascript' >
- function validate(){
- /*eventuell den Inhalt (Pfad) noch aufbereiten?
- * Slash und Backslash -> win, linux usw.
- */
- document.form1.location.type = 'text';
- document.form1.myLocation.value = document.form1.location.value;
- document.form1.submit();
- }
- </script>
- </head>
- <body>
- <form name='form1' action='<?php $PHP_SELF ?>' method='POST'>
- <table>
- <tr>
- <td>Location:</td>
- <td>
- <input type='file' name='location' >
- <input type='hidden' name='myLocation'>
- </td>
- </tr>
- <tr>
- <td>all files with the same extension:</td>
- <td>
- <input type='checkbox' name='dir'>
- </td>
- </tr>
- <tr>
- <td>Factor:</td>
- <td><input type='text' name='factor' value='4'></td>
- </tr>
- <tr>
- <td><input type='button' value="let's go" onclick='validate()'></td>
- <td></td>
- </tr>
- </table>
- <?php
-
-import_request_variables('PG');
-
-/*********PARAMS***************/
-$countSymbolsFiles = 0;
-$arraySymbolsFiles;
-/********************************/
-function modify($myDir, $myFile){
- global $factor;
- $myContent = fopen($myDir."/".$myFile, "r") or die("Datei " . $myDir . " / ". $myFile ." konnte nicht zum Lesen geöffnet werden!");
- $myNewContent = fopen($myDir."/".str_replace(".","_".$factor.".",$myFile), "w") or die("Datei " . $myDir . " / ". str_replace(".","_".$factor.".",$myFile) ." konnte nicht zum Schreiben geöffnet werden!");
- fputs($myNewContent, "#Modified by MapbenderTools" . "\n");
- fputs($myNewContent, "#Date: ". date("d.m.Y") . "\n");
- fputs($myNewContent, "#Factor: ". $factor . "\n\n");
-
- while(!feof($myContent)){
- $myLine = fgets($myContent, 1024);
- if(preg_match("/\bSIZE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
- if(count($matches) <= 2){
- fputs($myNewContent, str_replace($matches[1], multiplicate($matches[1]), $myLine));
- }
- }
- else if(preg_match("/(.*OFFSET)\s*(\d+.?\d*)(\s*)(\d+.?\d*)(\s*)/i",$myLine,$matches)){
- $myNewOFFSET=$matches[1] . " " .multiplicate($matches[2]) . " " . multiplicate($matches[4]).$matches[5];
- fputs($myNewContent,$myNewOFFSET);
- }
- else if(preg_match("/\bMAXSIZE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
- if(count($matches) <= 2){
- fputs($myNewContent, str_replace($matches[1], multiplicate($matches[1]), $myLine));
- }
- }
- else if(preg_match("/\bMINSIZE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
- if(count($matches) <= 2){
- fputs($myNewContent, str_replace($matches[1], multiplicate($matches[1]), $myLine));
- }
- }
- else if(preg_match("/\bSYMBOLSCALE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
- fputs($myNewContent, "# ". $myLine);
- }
- else if(preg_match("/\bSYMBOLSET\s*(.*)/i",$myLine,$matches)){ //noch nicht fertig
- $arraySymbolFiles[$countSymbolsFiles] = str_replace("\"","",$matches[1]);
- $countSymbolsFiles++;
- fputs($myNewContent, $myLine);
- }
- #catch all
- else{
- fputs($myNewContent, $myLine);
- }
- }
- fclose($myContent);
- fclose($myNewContent);
-}
-function multiplicate($x){
- global $factor;
- $x = floatval($x) * $factor;
- return $x;
-}
-
- if(isset($myLocation) && $myLocation != ""){
- # what is to do...
- $myFile = basename($myLocation);
- $myDir = dirname($myLocation);
- $suffix = strstr($myFile, ".");
-
-
- if(!isset($dir)){
- modify($myDir, $myFile);
- echo "modified: " . $myDir . "/" . $myFile. "<br />";
- }
- else{
- if($verz = opendir($myDir)){
- while ($myFile = readdir ($verz)) {
- if($myFile != ".." && $myFile != "." && is_file($myDir."/".$myFile) && strstr($myFile, $suffix)){
- modify($myDir, $myFile);
- echo "modified: " . $myDir . "/" . $myFile. "<br />";
- }
- }
- closedir($verz);
- }
- }
-}
- ?>
- </form>
- </body>
-</html>
\ No newline at end of file
Modified: trunk/mapbender/http/tools/mapbender_setup.php
===================================================================
--- trunk/mapbender/http/tools/mapbender_setup.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/http/tools/mapbender_setup.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -21,6 +21,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+include_once(dirname(__FILE__)."/../php/system.php");
include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
include_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
@@ -265,9 +266,10 @@
if (LOG_LEVEL =='off') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td>switched off: <font color=#FF0000>-no Mapbender-errors logging</font><td></tr>";
elseif (LOG_LEVEL =='error') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td><font color=#00D000>set to 'error': </font><font color=#0000FF>-Mapbender-errors will be logged</font><td></tr>";
elseif (LOG_LEVEL =='warning') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td><font color=#00D000>set to 'warning: </font><font color=#0000FF>- Mapbender-errors and -warnings will be logged</font><td></tr>";
+ elseif (LOG_LEVEL =='notice') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td><font color=#00D000>set to 'notice': </font><font color=#0000FF>-really every little notice will be logged!!</font><td></tr>";
elseif (LOG_LEVEL =='all') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td><font color=#00D000>set to 'all': </font><font color=#0000FF>-really every little notice will be logged!!</font><td></tr>";
else $check .="<tr><td>LOG_LEVEL</td><td></td><td><font color=#FF0000>set to " . LOG_LEVEL . ": this configuration value is not supported (as yet!)</font></td></tr>";
- }
+ }
# PORTAL
if (defined('PORTAL')){
if (PORTAL == true) $check .="<tr><td width=\"25%\">PORTAL</td><td width=\"10\">X</td><td><font color=#00D000>true</font><font color='#0000FF'> (Users can create theirs own accounts)</font></td></tr>";
Copied: trunk/mapbender/http/tools/mod_monitorCapabilities_main.php (from rev 2404, branches/2.5/http/tools/mod_monitorCapabilities_main.php)
===================================================================
--- trunk/mapbender/http/tools/mod_monitorCapabilities_main.php (rev 0)
+++ trunk/mapbender/http/tools/mod_monitorCapabilities_main.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,213 @@
+<?php
+# $Id: mod_monitorCapabilities_main.php 1240 2007-10-24 09:27:00Z baudson $
+# http://www.mapbender.org/index.php/Monitor_Capabilities
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//require_once(dirname(__FILE__) . "/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+//session_start();
+//import_request_variables("PG");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$admin = new administration();
+
+//$user = "root";
+$user = "";
+$gui = "";
+$cl = 0;
+
+
+function getConjunctionCharacter($onlineresource){
+ if(strstr($onlineresource, "?")) {
+ $lastChar = substr($onlineresource,strlen($onlineresource)-1, 1);
+ if ($lastChar == "?" || $lastChar == "&") {return "";}
+ else{return "&";}
+ }
+ else {return "?";}
+}
+
+// retrieve username and gui_id
+if ($_REQUEST['user']) {
+ $cl = 0;
+ //browser
+ echo "browser";
+ $user = $_REQUEST['user'];
+ $gui = $_REQUEST['gui'];
+}
+elseif ($_SERVER["argv"][1]) {
+ $cl = 1;
+ //command line
+ $p1 = $_SERVER["argv"][1];
+ $p2 = $_SERVER["argv"][2];
+ if (substr($p1, 0,5) == "user:") {
+ $user = substr($p1, 5);
+ if (substr($p2, 0,4) == "gui:") {
+ $gui = substr($p2, 4);
+ }
+ }
+}
+else {
+ echo "Please specify a username!\n";die();
+}
+
+$userid = $admin->getUserIdByUserName($user);
+
+/*
+ * if the current user is a valid user...
+ */
+if ($userid) {
+ $ownguis = $admin->getGuisByOwner($userid,true);
+ /*
+ * if monitoring is restricted to a single GUI...
+ */
+ if ($gui) {
+ // ... abort if the GUI doesn't exist
+ if (!$admin->guiExists($gui)) {
+ echo "GUI " . $gui . " doesn't exist.\n"; die();
+ }
+ // ... add the GUI to the array of GUIs that will be monitored
+ elseif (in_array($gui, $ownguis)) {
+ $ownguis = array($gui);
+ }
+ // ... abort if the GUI is not owned by the current user
+ else {
+ echo "User " . $user . " is not owner of GUI " . $gui . ".\n"; die();
+ }
+ }
+}
+/*
+ * if current user is not a valid user, abort
+ */
+else {
+ echo $user . " is not a valid username.\n"; die();
+}
+
+/**
+ * Array of WMS IDs. These are the WMS that the user owns.
+ */
+$wms_id_own = $admin->getWmsByOwnGuis($ownguis);
+
+// initialise monitoring processes
+echo "Starting monitoring cycle...\n\n";
+if ($cl == 0) echo "<br/><br/>";
+echo "WMS services are requested for availability.\n";
+if ($cl == 0) echo "<br/>";
+echo "Capabilities documents are requested and all changes synchronized with the database cache.\n\n";
+if ($cl == 0) echo "<br/><br/>";
+
+$time = strval(time()-2);
+
+for ($k=0; $k<count($wms_id_own); $k++) {
+ $sql = "SELECT wms_upload_url FROM wms WHERE wms_id = $1";
+ $v = array($wms_id_own[$k]);
+ $t = array('i');
+ $res = db_prep_query($sql,$v,$t);
+ $someArray = db_fetch_row($res);
+ $url = $someArray[0];
+
+ if (!$upload_url || $upload_url == "") {
+ $sql = "SELECT wms_version, wms_getcapabilities FROM wms WHERE wms_id = $1";
+ $v = array($wms_id_own[$k]);
+ $t = array('i');
+ $res = db_prep_query($sql,$v,$t);
+ $someArray = db_fetch_row($res);
+
+ $version = $someArray[0];
+ $capabilities = $someArray[1];
+ if ($version == "1.0.0" ) {
+ $url = $capabilities . getConjunctionCharacter($capabilities) . "REQUEST=capabilities&WMTVER=1.0.0";
+ }
+ else {
+ $url = $capabilities . getConjunctionCharacter($capabilities) . "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=" . $version;
+ }
+ }
+
+ $sql = "INSERT INTO mb_monitor (upload_id, fkey_wms_id, status, status_comment, timestamp_begin, timestamp_end, upload_url, updated) ";
+ $sql .= "VALUES ($1, $2, $3, $4, $5, $6, $7, $8)";
+ $v = array($time,$wms_id_own[$k],"-2","Monitoring is still in progress...", time(),time(),$url,"0");
+ $t = array('s', 'i', 's', 's', 's', 's', 's', 's');
+ $res = db_prep_query($sql,$v,$t);
+}
+
+for ($k=0; $k<count($wms_id_own); $k++) {
+
+ if (intval(AUTO_UPDATE)) {
+ $exec = PHP_PATH . "php5 mod_monitorCapabilities_write.php ".$wms_id_own[$k]." ".$time." 1 > ../tmp/output_".$time."_".$wms_id_own[$k].".txt &";
+ }
+ else {
+ $exec = PHP_PATH . "php5 mod_monitorCapabilities_write.php ".$wms_id_own[$k]." ".$time." 0 > ../tmp/output_".$time."_".$wms_id_own[$k].".txt &";
+ }
+ exec($exec);
+}
+echo "Monitoring Cycle completed (total: " . count($wms_id_own) . " wms).\n\n";
+if ($cl == 0) echo "<br/><br/>";
+set_time_limit(2*TIME_LIMIT);
+
+// wait until all monitoring processes are finished
+echo "please wait " . TIME_LIMIT . " seconds for the monitoring to finish...\n\n";
+if ($cl == 0) echo "<br/><br/>";
+sleep(TIME_LIMIT);
+
+$sql = "SELECT fkey_wms_id, status, status_comment, timestamp_begin, timestamp_end, upload_url FROM mb_monitor WHERE upload_id = $1";
+$v = array($time);
+$t = array('i');
+$res = db_prep_query($sql,$v,$t);
+
+$cnt=0;
+while ($row = db_fetch_array($res)) {
+ $status[$cnt] = intval(db_result($res,$cnt,"status"));
+ $wms_id[$cnt] = db_result($res,$cnt,"fkey_wms_id");
+ $comment[$cnt] = db_result($res,$cnt,"status_comment");
+ $upload_url[$cnt] = db_result($res,$cnt,"upload_url");
+ $timestamp_begin[$cnt] = db_result($res,0,"timestamp_begin");
+ $timestamp_end[$cnt] = db_result($res,0,"timestamp_end");
+ $cnt++;
+}
+
+$body = "";
+for ($i=0; $i<$cnt; $i++) {
+ // if monitoring is still in progress and time limit has expired, update database
+ if ($status[$i] == -2 && intval(time())-intval($timestamp_begin[$i]) > intval(TIME_LIMIT)) {
+ $comment[$i] = "Monitoring process timed out.";
+ $status[$i] = -1;
+ $new_sql = "UPDATE mb_monitor SET status = '-1', isImage = '-1', status_comment = 'Monitoring process timed out.', timestamp_end = $1 WHERE fkey_wms_id = $2 AND upload_id = $3";
+ $new_v = array((intval($upload_id[$i])+intval(TIME_LIMIT)), $wms_id[$i], $time);
+ $new_t = array('s', 'i', 's');
+ $new_res = db_prep_query($new_sql,$new_v,$new_t);
+ }
+ // compose mail message
+ echo $wms_id[$i] . ": status " . $status[$i] . "\n";
+ if ($cl == 0) echo "<br/><br/>";
+ if ($status[$i] == -1) {
+ $body .= $admin->getWmsTitleByWmsId($wms_id[$i]) . " (" . $wms_id[$i] . "): " . $comment[$i] . "\n\n";
+ }
+}
+
+// Send an email to the user
+if ($body) {
+ $error_msg = "";
+ if ($admin->getEmailByUserId($userid)) {
+// $admin->sendEmail(MAILADMIN, MAILADMINNAME, $admin->getEmailByUserId($userid), $user, "WMS monitor report " . date("F j, Y, G:i:s", $time), utf8_decode($body), &$error_msg);
+ }
+ else {
+ $error_msg = "Email address of user '" . $admin->getUserNameByUserId($userid) . "' unknown!\n";
+ }
+ if ($error_msg) {
+ echo "\n ERROR: " . $error_msg;
+ }
+}
+?>
Copied: trunk/mapbender/http/tools/mod_monitorCapabilities_read.php (from rev 2404, branches/2.5/http/tools/mod_monitorCapabilities_read.php)
===================================================================
--- trunk/mapbender/http/tools/mod_monitorCapabilities_read.php (rev 0)
+++ trunk/mapbender/http/tools/mod_monitorCapabilities_read.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,247 @@
+
+<?php
+# $Id: mod_monitorCapabilities_read.php 1283 2007-10-25 15:20:25Z baudson $
+# http://www.mapbender.org/index.php/Monitor_Capabilities
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+session_start();
+import_request_variables("PG");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+</head>
+<body>
+<?php
+$admin = new administration();
+
+// update selected wms
+for ($i=0; $i < $_POST['cbs']; $i++) {
+ $upd_wmsid = intval($_POST['cb'.$i]);
+ if ($upd_wmsid) {
+
+ $now = time();
+ $sql = "UPDATE mb_monitor SET status = '-2', status_comment = 'Monitoring is still in progress...', timestamp_begin = $1, timestamp_end = $2 WHERE upload_id = $3 AND fkey_wms_id = $4";
+ $v = array($now, $now, $_POST['upl_id'.$i], $upd_wmsid);
+ $t = array('s', 's', 's', 'i');
+ $res = db_prep_query($sql,$v,$t);
+
+ $exec = PHP_PATH . "php mod_monitorCapabilities_write.php ".$upd_wmsid." ".$_POST['upl_id'.$i]." 1 > output.txt &";
+ exec($exec);
+ }
+}
+
+$sql = "SELECT DISTINCT fkey_wms_id FROM mb_monitor";
+$res = db_prep_query($sql, array(), array());
+$cnt = 0;
+$wms = array();
+while(db_fetch_row($res)){
+ $wms[$cnt] = db_result($res,$cnt,"fkey_wms_id");
+ $cnt++;
+}
+
+$status = array();
+$upload_id = array();
+for ($i=0; $i<count($wms); $i++) {
+ $wms_id[$wms[$i]] = $wms[$i];
+ // get upload id
+ $sql = "SELECT MAX(upload_id) FROM mb_monitor WHERE fkey_wms_id = $1";
+ $v = array($wms[$i]);
+ $t = array('i');
+ $res = db_prep_query($sql,$v,$t);
+ $upload_id[$wms[$i]] = db_result($res,0,0);
+
+ $sql = "SELECT AVG(timestamp_begin), AVG(timestamp_end) FROM mb_monitor WHERE fkey_wms_id = $1 AND NOT status = '-1' AND NOT status = '-2'";
+ $v = array($wms[$i]);
+ $t = array('i');
+ $res = db_prep_query($sql,$v,$t);
+ if (db_result($res,0,1) == 0 && db_result($res,0,0) == 0) {
+ $avg_response_time[$wms[$i]] = NULL;
+ }
+ else {
+ $avg_response_time[$wms[$i]] = round(db_result($res,0,1)-db_result($res,0,0), 1);
+ }
+
+ $sql = "SELECT status, status_comment, timestamp_begin, timestamp_end, upload_url, updated, image, map_url FROM mb_monitor ";
+ $sql .= "WHERE upload_id = $1 AND fkey_wms_id = $2 ORDER BY status, status_comment, timestamp_end, fkey_wms_id";
+ $v = array($upload_id[$wms[$i]], $wms_id[$wms[$i]]);
+ $t = array('s', 'i');
+ $res = db_prep_query($sql,$v,$t);
+
+ $status[$wms[$i]] = intval(db_result($res,0,"status"));
+ $comment[$wms[$i]] = db_result($res,0,"status_comment");
+ $timestamp_begin[$wms[$i]] = db_result($res,0,"timestamp_begin");
+ $timestamp_end[$wms[$i]] = db_result($res,0,"timestamp_end");
+ $upload_url[$wms[$i]] = db_result($res,0,"upload_url");
+ $updated[$wms[$i]] = db_result($res,0,"updated");
+ $mapurl[$wms[$i]] = db_result($res,0,"map_url");
+ $image[$wms[$i]] = db_result($res,0,"image");
+
+ if ($status[$wms[$i]] == -2 && intval(time())-intval($timestamp_begin[$wms[$i]]) > intval(TIME_LIMIT)) {
+ $comment[$wms[$i]] = "Monitoring process timed out.";
+
+ $new_sql = "UPDATE mb_monitor SET status = '-1', status_comment = 'Monitoring process timed out.', timestamp_end = $1 WHERE fkey_wms_id = $2 AND upload_id = $3";
+ $new_v = array((intval($upload_id[$wms[$i]])+intval(TIME_LIMIT)), $wms_id[$wms[$i]], $upload_id[$wms[$i]]);
+ $new_t = array('s', 'i', 's');
+ $new_res = db_prep_query($new_sql,$new_v,$new_t);
+ }
+
+ $sql = "SELECT COUNT(upload_id) FROM mb_monitor WHERE fkey_wms_id = $1 AND NOT status = '-2'";
+ $v = array($wms[$i]);
+ $t = array('i');
+ $res = db_prep_query($sql, $v, $t);
+ $total[$wms[$i]] = db_result($res, 0, 0);
+
+ $sql = "SELECT COUNT(upload_id) FROM mb_monitor WHERE fkey_wms_id = $1 AND status = '-1'";
+ $v = array($wms[$i]);
+ $t = array('i');
+ $res = db_prep_query($sql, $v, $t);
+ $fail = db_result($res, 0, 0);
+
+ $percentage[$wms[$i]] = 100 - round(100*floatval($fail)/floatval($total[$wms[$i]]), 1);
+}
+
+
+$newArray = $status;
+if ($_GET['sortby']) {
+ if ($_GET['sortby'] == "wms") {
+ $newArray = $wms_id;
+ asort($newArray);
+ }
+ elseif ($_GET['sortby'] == "status") {
+ $newArray = $status;
+ asort($newArray);
+ }
+ elseif ($_GET['sortby'] == "avgresp") {
+ $newArray = $avg_response_time;
+ asort($newArray);
+ }
+ elseif ($_GET['sortby'] == "avail") {
+ $newArray = $percentage;
+ arsort($newArray);
+ }
+ elseif ($_GET['sortby'] == "last") {
+ $newArray = $upload_id;
+ arsort($newArray);
+ }
+ elseif ($_GET['image'] == "last") {
+ $newArray = $image;
+ arsort($newArray);
+ }
+}
+
+
+
+$str = "<span style='font-size:30'>monitoring results</span><hr><br>\n";
+$str .= "<form name = 'form1' method='post' action='".$PHP_SELF."?sortby=".$_GET['sortby']."'>\n\t";
+$str .= "\n\t<input type=submit value='update selected WMS'>\n";
+$str .= "\n\t<input type=button onclick=\"self.location.href='".$PHP_SELF."?sortby=".$_GET['sortby']."'\" value='refresh'>\n<br/><br/>\n ";
+$str .= "<table cellpadding=10 cellspacing=0 border=0>";
+$str .= "<tr bgcolor='#dddddd'><th></th><th align='left'><a href='".$PHP_SELF."?sortby=wms'>wms</a></th>";
+$str .= "<th align='left' colspan = 2><a href='".$PHP_SELF."?sortby=status'>current status</a></th>";
+$str .= "<th align='left'><a href='".$PHP_SELF."?sortby=image'>image</a></th>";
+$str .= "<th align='left'><a href='".$PHP_SELF."?sortby=avgresp'>avg. response time</a></th>";
+$str .= "<th align='left'><a href='".$PHP_SELF."?sortby=avail'>overall availability</a></th><th></th></tr>";
+
+$cnt = 0;
+foreach ($newArray as $k => $value) {
+ $img = "stop.bmp";
+ if ($status[$k]==0) $img = "wait.bmp";
+ elseif ($status[$k]==1) $img = "go.bmp";
+
+ if ($updated[$k] == "0" && $status[$k] == 0) $fill = "checked"; else $fill = "disabled";
+
+ if (fmod($cnt, 2) == 1) {
+ $str .= "\n\t\t<tr bgcolor='#e6e6e6'>";
+ }
+ else {
+ $str .= "\n\t\t<tr bgcolor='#f0f0f0'>";
+ }
+ $str .= "\n\t\t\t<td><input name='cb".$cnt."' value='" . $wms_id[$k] . "' type=checkbox ".$fill." /><input type=hidden name='upl_id".$cnt."' value='".$upload_id[$k]."'></td>";
+ $str .= "\n\t\t\t<td valign='top'><b>" . $wms_id[$k] . "</b><br>" . $admin->getWmsTitleByWmsId($wms_id[$k]) . "</td>";
+ $str .= "\n\t\t\t<td valign='top'><a href='".$upload_url[$k]."' target=_blank><img title='Connect to service' border=0 src = '../img/trafficlights/". $img. "'></a></td>";
+ $str .= "\n\t\t\t<td valign='top'>" . $comment[$k] . "<br><div style='font-size:12'>".date("F j, Y, G:i:s", $upload_id[$k])."</div></td>";
+ $str .= "\n\t\t\t<td valign='top'>";
+
+ $str .= "<table bgcolor='black' border=1 cellspacing=1 cellpadding=0><tr><td height=20 width=20 align=center valign=middle bgcolor='";
+
+ if ($image[$k] == -1) {
+ $str .= "red";
+ }
+ elseif ($image[$k] == 0) {
+ $str .= "yellow";
+ }
+ elseif ($image[$k] == 1) {
+ $str .= "green";
+ }
+
+ if ($image[$k] != -1) {
+ $str .= "'><a href='".$mapurl[$k]."'>o</a></td></tr></table></td>";
+ }
+ else {
+ $str .= "'><a href='".$mapurl[$k]."'>x</a></td></tr></table></td>";
+ }
+
+ $str .= "\n\t\t\t<td valign='top' align = 'left'>";
+ if ($avg_response_time[$k] == NULL) {
+ $str .= "n/a";
+ }
+ else {
+ $str .= $avg_response_time[$k] . " s";
+ }
+ $str .= "</td>";
+ $str .= "\n\t\t\t<td valign='top'><b>" . $percentage[$k] . " %</b> <span style='font-size:12'>(" . $total[$k] . " cycles)</span><br>";
+ $str .= "<table bgcolor='black' border=1 cellspacing=1 cellpadding=0><tr>";
+ $val = $percentage[$k];
+ for ($i=0; $i<10; $i++) {
+ if ($val>=10) {
+ $str .= "<td height=10 width='10' bgcolor='red'></td>";
+ $val-=10;
+ }
+ elseif($val>0){
+ $str .= "<td height=10 width='" . round($val) . "' bgcolor='red'></td>";
+ if (round($val) < 10) {
+ $str .= "<td height=10 width='" . (9-round($val)) . "' bgcolor='white'></td>";
+ }
+ $val=-1;
+ }
+ else {
+ $str .= "<td height=10 width='10' bgcolor='white'></td>";
+ }
+ }
+ $str .= "</tr></table></td>";
+
+# $str .= "\n\t\t\t<td><a href='output_".$wms_id[$k]."_".$max.".txt' target=_blank>log</a></td>";
+ $str .= "\n\t\t<td><input type=button value='details' onclick=\"var newWindow = window.open('../php/mod_monitorCapabilities_read_single.php?wmsid=".$wms_id[$k]."','wms','width=500,height=700,scrollbars');newWindow.href.location='test.php'\"></td></tr>";
+ $cnt++;
+}
+$str .= "\n\t</table>\n\t<br/><input type=hidden name=cbs value='".$cnt."'>\n</form>";
+echo $str;
+
+?>
+</body></html>
\ No newline at end of file
Copied: trunk/mapbender/http/tools/mod_monitorCapabilities_read_single.php (from rev 2404, branches/2.5/http/tools/mod_monitorCapabilities_read_single.php)
===================================================================
--- trunk/mapbender/http/tools/mod_monitorCapabilities_read_single.php (rev 0)
+++ trunk/mapbender/http/tools/mod_monitorCapabilities_read_single.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,102 @@
+
+<?php
+# $Id: mod_monitorCapabilities_read_single.php 76 2006-08-15 12:25:34Z heuser $
+# http://www.mapbender.org/index.php/Monitor_Capabilities
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+session_start();
+import_request_variables("PG");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+</head>
+<body>
+<?php
+$admin = new administration();
+
+if ($_GET['wmsid']) {
+ $wms_id = intval($_GET['wmsid']);
+}
+else {
+ echo "Invalid WMS ID.";
+ die;
+}
+
+$sql = "SELECT upload_id, status, status_comment, timestamp_begin, timestamp_end, upload_url, updated FROM mb_monitor ";
+$sql .= "WHERE fkey_wms_id = $1 AND NOT status = '-2' ORDER BY upload_id DESC";
+$v = array($wms_id);
+$t = array('i');
+$res = db_prep_query($sql,$v,$t);
+
+$cnt=0;
+while ($row = db_fetch_array($res)) {
+ $upload_id[$cnt] = db_result($res,$cnt,"upload_id");
+ $status[$cnt] = intval(db_result($res,$cnt,"status"));
+ $comment[$cnt] = db_result($res,$cnt,"status_comment");
+ $timestamp_begin = db_result($res,$cnt,"timestamp_begin");
+ $timestamp_end = db_result($res,$cnt,"timestamp_end");
+ $upload_url[$cnt] = db_result($res,$cnt,"upload_url");
+ if ($status[$cnt] == '0' || $status[$cnt] == '1') {
+ $response_time[$cnt] = strval($timestamp_end-$timestamp_begin) . " s";
+ }
+ else {
+ $response_time[$cnt] = "n/a";
+ }
+ $cnt++;
+}
+
+
+$str = "<span style='font-size:30'>monitoring results</span><hr><br>\n";
+$str .= "<b>" . $wms_id . "</b><br>" . $admin->getWmsTitleByWmsId($wms_id) . "<br><br><br>\n";
+$str .= "<table cellpadding=10 cellspacing=0 border=0>";
+$str .= "<tr bgcolor='#dddddd'><th align='left'>date</th><th align='left' colspan = 2>status</th><th align='center'>response time</th></tr>";
+
+for ($k=0; $k<count($upload_id); $k++) {
+ $img = "stop.bmp";
+ if ($status[$k]==0) $img = "wait.bmp";
+ elseif ($status[$k]==1) $img = "go.bmp";
+
+ if (fmod($k, 2) == 1) {
+ $str .= "\n\t\t<tr bgcolor='#e6e6e6'>";
+ }
+ else {
+ $str .= "\n\t\t<tr bgcolor='#f0f0f0'>";
+ }
+ $str .= "\n\t\t\t<td>".date("F j, Y, G:i:s", $upload_id[$k])."</td>";
+ $str .= "\n\t\t\t<td><a href='".$upload_url[$k]."' target=_blank><img title='Connect to service' border=0 src = '../img/trafficlights/". $img. "'></a></td>";
+ $str .= "\n\t\t\t<td>" . $comment[$k] . "</td>";
+ $str .= "\n\t\t\t<td align='center'>" . $response_time[$k] . "</td>";
+
+# $str .= "\n\t\t\t<td><a href='output_".$wms_id[$k]."_".$max.".txt' target=_blank>log</a></td>";
+}
+$str .= "\n\t</table>\n\t";
+echo $str;
+
+?>
+</body></html>
\ No newline at end of file
Copied: trunk/mapbender/http/tools/mod_monitorCapabilities_write.php (from rev 2404, branches/2.5/http/tools/mod_monitorCapabilities_write.php)
===================================================================
--- trunk/mapbender/http/tools/mod_monitorCapabilities_write.php (rev 0)
+++ trunk/mapbender/http/tools/mod_monitorCapabilities_write.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,41 @@
+<?php
+# $Id: mod_monitorCapabilities_write.php 1235 2007-10-23 15:42:55Z baudson $
+# http://www.mapbender.org/index.php/Monitor_Capabilities
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+
+require_once(dirname(__FILE__)."/../classes/class_monitor.php");
+
+/*
+ * incoming parameters from command line
+ */
+if ($_SERVER["argc"] != 4) {
+ echo "Insufficient arguments! Monitoring aborted.";
+ die();
+}
+
+$wmsId = $_SERVER["argv"][1];
+$uploadId = $_SERVER["argv"][2];
+$autoUpdate = intval($_SERVER["argv"][3]);
+
+$monitor = new Monitor($wmsId, $uploadId, $autoUpdate);
+
+echo $monitor;
+
+$monitor->updateInDB();
+?>
\ No newline at end of file
Copied: trunk/mapbender/lib (from rev 2404, branches/2.5/lib)
Deleted: trunk/mapbender/lib/i18n.php
===================================================================
--- branches/2.5/lib/i18n.php 2008-04-22 08:27:52 UTC (rev 2404)
+++ trunk/mapbender/lib/i18n.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -1,8 +0,0 @@
-<?php
- function _mb ($someString) {
- if (USE_I18N) {
- return _($someString);
- }
- return $someString;
- }
-?>
\ No newline at end of file
Copied: trunk/mapbender/lib/i18n.php (from rev 2404, branches/2.5/lib/i18n.php)
===================================================================
--- trunk/mapbender/lib/i18n.php (rev 0)
+++ trunk/mapbender/lib/i18n.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -0,0 +1,8 @@
+<?php
+ function _mb ($someString) {
+ if (USE_I18N) {
+ return _($someString);
+ }
+ return $someString;
+ }
+?>
\ No newline at end of file
Modified: trunk/mapbender/owsproxy/http/index.php
===================================================================
--- trunk/mapbender/owsproxy/http/index.php 2008-04-23 16:09:45 UTC (rev 2411)
+++ trunk/mapbender/owsproxy/http/index.php 2008-04-23 16:14:30 UTC (rev 2412)
@@ -18,11 +18,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-require("../../conf/mapbender.conf");
-require("../../http/classes/class_administration.php");
-require("../../http/classes/class_connector.php");
-require_once("../../http/classes/class_mb_exception.php");
-require("./classes/class_QueryHandler.php");
+require(dirname(__FILE__) . "/../../conf/mapbender.conf");
+require(dirname(__FILE__) . "/../../http/classes/class_administration.php");
+require(dirname(__FILE__) . "/../../http/classes/class_connector.php");
+require_once(dirname(__FILE__) . "/../../http/classes/class_mb_exception.php");
+require(dirname(__FILE__) . "/./classes/class_QueryHandler.php");
/***** conf *****/
$imageformats = array("image/png","image/gif","image/jpeg", "image/jpg");
@@ -74,6 +74,10 @@
$arrayOnlineresources = checkWmsPermission($owsproxyService);
$query->setOnlineResource($arrayOnlineresources['wms_getmap']);
$layers = checkLayerPermission($arrayOnlineresources['wms_id'],$reqParams['layers']);
+ if($layers===""){
+ throwE("Permission denied");
+ die();
+ }
$query->setParam("layers",$layers);
$request = $query->getRequest();
getImage($request);
More information about the Mapbender_commits
mailing list