[Mapbender-commits] r1487 - in branches/mapbender_sld/http: . sld
sld/img
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jul 12 11:40:33 EDT 2007
Author: mschulz
Date: 2007-07-12 11:40:33 -0400 (Thu, 12 Jul 2007)
New Revision: 1487
Added:
branches/mapbender_sld/http/sld/
branches/mapbender_sld/http/sld/img/
branches/mapbender_sld/http/sld/img/lightning.png
branches/mapbender_sld/http/sld/img/map_magnify.png
branches/mapbender_sld/http/sld/img/minus.gif
branches/mapbender_sld/http/sld/img/plus.gif
branches/mapbender_sld/http/sld/img/script_link.png
branches/mapbender_sld/http/sld/img/script_save.png
branches/mapbender_sld/http/sld/sld_config.php
branches/mapbender_sld/http/sld/sld_edit_filter.php
branches/mapbender_sld/http/sld/sld_filter_parse.php
branches/mapbender_sld/http/sld/sld_function_handler.php
branches/mapbender_sld/http/sld/sld_main.php
branches/mapbender_sld/http/sld/sld_parse.php
branches/mapbender_sld/http/sld/sld_pick_color.php
Log:
SLD classes/editor initial checkin
Added: branches/mapbender_sld/http/sld/img/lightning.png
===================================================================
(Binary files differ)
Property changes on: branches/mapbender_sld/http/sld/img/lightning.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/mapbender_sld/http/sld/img/map_magnify.png
===================================================================
(Binary files differ)
Property changes on: branches/mapbender_sld/http/sld/img/map_magnify.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/mapbender_sld/http/sld/img/minus.gif
===================================================================
(Binary files differ)
Property changes on: branches/mapbender_sld/http/sld/img/minus.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/mapbender_sld/http/sld/img/plus.gif
===================================================================
(Binary files differ)
Property changes on: branches/mapbender_sld/http/sld/img/plus.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/mapbender_sld/http/sld/img/script_link.png
===================================================================
(Binary files differ)
Property changes on: branches/mapbender_sld/http/sld/img/script_link.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/mapbender_sld/http/sld/img/script_save.png
===================================================================
(Binary files differ)
Property changes on: branches/mapbender_sld/http/sld/img/script_save.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/mapbender_sld/http/sld/sld_config.php
===================================================================
--- branches/mapbender_sld/http/sld/sld_config.php (rev 0)
+++ branches/mapbender_sld/http/sld/sld_config.php 2007-07-12 15:40:33 UTC (rev 1487)
@@ -0,0 +1,53 @@
+<?php
+/**
+ * This file contains some global configuration variables for the sld-editor
+ *
+ * @package sld_config
+ * @author Markus Krzyzanowski
+ */
+
+include_once(dirname(__FILE__)."/../classes/sld/StyledLayerDescriptor.php");
+
+session_start();
+
+$SLD_MAIN = "sld_main.php?".SID;
+$SLD_FUNCTION_HANDLER = "sld_function_handler.php";
+include_once(dirname(__FILE__)."/sld_parse.php");
+
+// this should come from mapbender.conf
+$MAPBENDER_URL = "http://".$_SERVER["HTTP_HOST"]."/mapbender_sld/http";
+
+function char_encode($s){
+ if(CHARSET == 'UTF-8'){
+ $s = utf8_encode($s);
+ }
+ return $s;
+}
+
+if (isset($_REQUEST["wms_id"]) && isset($_REQUEST["layer_name"]))
+{
+ $_SESSION["sld_wms_id"] = $_REQUEST["wms_id"];
+ $_SESSION["sld_layer_name"] = $_REQUEST["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 = ".$wms_id.";";
+ $res = db_query($sql);
+ $mapfileUrl = "";
+ if ( db_fetch_row($res, 0) )
+ {
+ $mapfileUrl = db_result($res, 0, "wms_getmap");
+ //echo $mapfileUrl;
+ }
+
+}
+
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/sld/sld_edit_filter.php
===================================================================
--- branches/mapbender_sld/http/sld/sld_edit_filter.php (rev 0)
+++ branches/mapbender_sld/http/sld/sld_edit_filter.php 2007-07-12 15:40:33 UTC (rev 1487)
@@ -0,0 +1,257 @@
+<?php
+/**
+ * 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/sld/StyledLayerDescriptor.php");
+session_start();
+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 "OGC:PROPERTYISEQUALTO":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsEqualTo");
+ break;
+ case "OGC:PROPERTYISNOTEQUALTO":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsNotEqualTo");
+ break;
+ case "OGC:PROPERTYISGREATERTHAN":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsGreaterThan");
+ break;
+ case "OGC:PROPERTYISGREATERTHANOREQUALTO":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsGreaterThanOrEqualTo");
+ break;
+ case "OGC:PROPERTYISLESSTHAN":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsLessThan");
+ break;
+ case "OGC:PROPERTYISLESSTHANOREQUALTO":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsLessThanOrEqualTo");
+ break;
+ case "OGC:PROPERTYISLIKE":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new PropertyIsLike();
+ break;
+ case "OGC:PROPERTYISNULL":
+ $_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new PropertyIsNull();
+ break;
+ case "OGC: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");
+ 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\" 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
Added: branches/mapbender_sld/http/sld/sld_filter_parse.php
===================================================================
--- branches/mapbender_sld/http/sld/sld_filter_parse.php (rev 0)
+++ branches/mapbender_sld/http/sld/sld_filter_parse.php 2007-07-12 15:40:33 UTC (rev 1487)
@@ -0,0 +1,351 @@
+<?php
+/**
+ * This file parses the filter expressions and creates the corresponding objects.
+ *
+ * @package filter_editor
+ * @author Markus Krzyzanowski
+ */
+
+
+
+include_once(dirname(__FILE__)."/../classes/sld/StyledLayerDescriptor.php");
+session_start();
+
+/**
+ * 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();
+ 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 "OGC: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 "OGC:PROPERTYISEQUALTO":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("ogc: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 "OGC:PROPERTYISNOTEQUALTO":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("ogc: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 "OGC:PROPERTYISGREATERTHAN":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("ogc: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 "OGC:PROPERTYISGREATERTHANOREQUALTO":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("ogc: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 "OGC:PROPERTYISLESSTHAN":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("ogc: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 "OGC:PROPERTYISLESSTHANOREQUALTO":
+ if ($element["type"] == "open" || $element["type"] == "complete")
+ {
+ $parent[] = $parentactual;
+ $objects[count($parent)-1] = new BinaryComparisonOp("ogc: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 "OGC: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 "OGC: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 "OGC: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 "OGC: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 "OGC:PROPERTYNAME":
+ if ($element["type"] == "complete")
+ {
+ $objects[$parentactual]->ogcPropertyName = $element["value"];
+ }
+ break;
+ case "OGC:LOWERBOUNDARY":
+ if ($element["type"] == "open")
+ {
+ $boundary = "lower";
+ }
+ else if ($element["type"] == "close")
+ {
+ $boundary = "";
+ }
+ break;
+ case "OGC: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
Added: branches/mapbender_sld/http/sld/sld_function_handler.php
===================================================================
--- branches/mapbender_sld/http/sld/sld_function_handler.php (rev 0)
+++ branches/mapbender_sld/http/sld/sld_function_handler.php 2007-07-12 15:40:33 UTC (rev 1487)
@@ -0,0 +1,373 @@
+<?php
+/**
+ * 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
+ */
+
+
+//session_start();
+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='".$data."' WHERE layer_id=".$_SESSION["sld_layer_id"]." AND mb_user_id=".$_SESSION["mb_user_id"].";";
+ $res = db_query($sql);
+}
+
+
+
+
+
+
+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["layer_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 layer_id=".$_REQUEST["layer_id"]." AND mb_user_id=".$_REQUEST["user_id"].";";
+ $res = db_query($sql);
+ 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
+ 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";
+
+ foreach ($layer_names as $layer_name)
+ {
+ $sql = "SELECT * FROM layer WHERE layer_name='".$layer_name."';";
+ $res = db_query($sql);
+
+ $layer_id = "";
+ if ( db_fetch_row($res, 0) )
+ {
+ $layer_id = db_result($res, 0, "layer_id");
+ $sql = "SELECT * FROM sld_user_layer WHERE layer_id=".$layer_id." AND mb_user_id=".$_REQUEST["user_id"].";";
+ $res = db_query($sql);
+ 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;
+ }
+ }
+ // 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=".$_REQUEST["use_sld"]." WHERE layer_id='".$_SESSION["sld_layer_id"]."' AND mb_user_id='".$_SESSION["mb_user_id"]."';";
+ $res = db_query($sql);
+ }
+ }
+
+
+
+
+ //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"] == "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
Added: branches/mapbender_sld/http/sld/sld_main.php
===================================================================
--- branches/mapbender_sld/http/sld/sld_main.php (rev 0)
+++ branches/mapbender_sld/http/sld/sld_main.php 2007-07-12 15:40:33 UTC (rev 1487)
@@ -0,0 +1,271 @@
+<?php
+/**
+ * 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
+ */
+
+include_once(dirname(__FILE__)."/sld_config.php");
+//session_start();
+include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+
+if (isset($_REQUEST["wms_id"]) && isset($_REQUEST["layer_name"]))
+{
+ $_SESSION["sld_wms_id"] = $_REQUEST["wms_id"];
+ $_SESSION["sld_layer_name"] = $_REQUEST["layer_name"];
+}
+
+
+
+
+//include_once($SLD_CLASSES);
+//include_once($SLD_PARSE);
+
+
+//read custom sld for this user&wms&layer 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
+$sql = "SELECT * FROM layer WHERE layer_name='".$_SESSION["sld_layer_name"]."';";
+$res = db_query($sql);
+
+$layer_id = "";
+if ( db_fetch_row($res, 0) )
+{
+ $layer_id = db_result($res, 0, "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 layer_id='".$layer_id."' AND mb_user_id='".$mb_user_id."';";
+ $res = db_query($sql);
+ if (!$res || db_numrows($res)== 0)
+ {
+ //No user specific sld found in DB -> get it from the mapserver
+ $file = $mapfileUrl."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(mb_user_id, layer_id, sld_xml, use_sld) VALUES('".$mb_user_id."','".$layer_id."','".$data."',0);";
+ $res = db_query($sql);
+ //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;
+
+
+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 = "";
+//$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/sld_function_handler.php?function=getusersld&layer_id=".$layer_id."&user_id=".$mb_user_id."&forcesld=1";
+echo "<!-- $sld_url -->";
+## - 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=\"".$mapfileUrl."VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=".urlencode($layer_name)."&WIDTH=320&HEIGHT=240&FORMAT=image/png&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=\"".$mapfileUrl."VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=".urlencode($layer_name)."&WIDTH=320&HEIGHT=240&FORMAT=image/png\" 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_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/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
+echo " <input type=\"hidden\" name=\"function\" value=\"usesld\">\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=\"center\">\n";
+echo " <td class=\"line_left2 line_right2 line_down2 text1 bg_menu\">\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/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
+
+echo " Standard �ffnen<br>\n";
+echo " <a href='".$SLD_FUNCTION_HANDLER."?function=getdefaultsld'>\n";
+echo " <img src='./img/script_link.png' border='0' alt='Standard SLD aus WMS auslesen'>\n";
+echo " </a><br>\n";
+
+echo " SLD speichern<br>\n";
+echo " <input type='image' src='./img/script_save.png' border='0' alt='�nderungen an die Map senden'>\n";
+echo " <input type='hidden' name='function' value='save'>\n";
+echo " <br /><a href=\"".$sld_url."\" target=_new>";
+echo " SLD anzeigen";
+echo " </a>";
+
+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 ($_SESSION);
+echo "-->";
+echo "</body>\n";
+echo "</html>\n";
+##Debug
+//echo "------------------------------------------------------------------\n";
+//echo $styledlayerdescriptor->generateXml();
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/sld/sld_parse.php
===================================================================
--- branches/mapbender_sld/http/sld/sld_parse.php (rev 0)
+++ branches/mapbender_sld/http/sld/sld_parse.php 2007-07-12 15:40:33 UTC (rev 1487)
@@ -0,0 +1,825 @@
+<?php
+/**
+ * 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
+ */
+
+
+
+
+session_start();
+
+
+
+/**
+ * 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->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;
+ //TODO: Kl�ren mit sld:parameterValueType
+ //bei den folgenden XML Elementen
+ case "LABEL":
+ if ($element["type"] == "complete")
+ {
+ //Kl�ren, ob Label nur so vorkommen kann - TODO
+ $objects[$parentactual]->label = $element["value"];
+ }
+ 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;
+ //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;
+ }
+ }
+ }
+
+
+ //print_r($objects);
+
+
+ $_SESSION["sld_objects"] = $objects;
+ $_SESSION["sld_parent"] = $parent;
+
+ return $styledlayerdescriptor;
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/sld/sld_pick_color.php
===================================================================
--- branches/mapbender_sld/http/sld/sld_pick_color.php (rev 0)
+++ branches/mapbender_sld/http/sld/sld_pick_color.php 2007-07-12 15:40:33 UTC (rev 1487)
@@ -0,0 +1,311 @@
+<?php
+/**
+ * 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"];
+?>
+<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>
More information about the Mapbender_commits
mailing list