[Mapbender-commits] r1485 - in branches/mapbender_sld/http/classes:
. sld
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jul 12 11:35:16 EDT 2007
Author: mschulz
Date: 2007-07-12 11:35:16 -0400 (Thu, 12 Jul 2007)
New Revision: 1485
Added:
branches/mapbender_sld/http/classes/sld/
branches/mapbender_sld/http/classes/sld/AddOperationModule.php
branches/mapbender_sld/http/classes/sld/AnchorPoint.php
branches/mapbender_sld/http/classes/sld/BinaryComparisonOp.php
branches/mapbender_sld/http/classes/sld/BinaryLogicOp.php
branches/mapbender_sld/http/classes/sld/ColorMap.php
branches/mapbender_sld/http/classes/sld/ColorMapEntry.php
branches/mapbender_sld/http/classes/sld/CssParameter.php
branches/mapbender_sld/http/classes/sld/Displacement.php
branches/mapbender_sld/http/classes/sld/DisplayOperationModule.php
branches/mapbender_sld/http/classes/sld/ElseFilter.php
branches/mapbender_sld/http/classes/sld/ExternalGraphic.php
branches/mapbender_sld/http/classes/sld/FeatureTypeStyle.php
branches/mapbender_sld/http/classes/sld/Fill.php
branches/mapbender_sld/http/classes/sld/Filter.php
branches/mapbender_sld/http/classes/sld/Font.php
branches/mapbender_sld/http/classes/sld/Graphic.php
branches/mapbender_sld/http/classes/sld/GraphicFill.php
branches/mapbender_sld/http/classes/sld/GraphicStroke.php
branches/mapbender_sld/http/classes/sld/Halo.php
branches/mapbender_sld/http/classes/sld/LabelPlacement.php
branches/mapbender_sld/http/classes/sld/LegendGraphic.php
branches/mapbender_sld/http/classes/sld/LineSymbolizer.php
branches/mapbender_sld/http/classes/sld/Mark.php
branches/mapbender_sld/http/classes/sld/NamedLayer.php
branches/mapbender_sld/http/classes/sld/PointPlacement.php
branches/mapbender_sld/http/classes/sld/PointSymbolizer.php
branches/mapbender_sld/http/classes/sld/PolygonSymbolizer.php
branches/mapbender_sld/http/classes/sld/PropertyIsBetween.php
branches/mapbender_sld/http/classes/sld/PropertyIsLike.php
branches/mapbender_sld/http/classes/sld/PropertyIsNull.php
branches/mapbender_sld/http/classes/sld/RasterSymbolizer.php
branches/mapbender_sld/http/classes/sld/Rule.php
branches/mapbender_sld/http/classes/sld/Stroke.php
branches/mapbender_sld/http/classes/sld/StyledLayerDescriptor.php
branches/mapbender_sld/http/classes/sld/TextSymbolizer.php
branches/mapbender_sld/http/classes/sld/UnaryLogicOp.php
branches/mapbender_sld/http/classes/sld/UserStyle.php
Log:
SLD classes/editor initial checkin
Added: branches/mapbender_sld/http/classes/sld/AddOperationModule.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/AddOperationModule.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/AddOperationModule.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Template class that only creates the source code for the function of adding an operation
+ * is used whereever an operation can be added. Simpyl change this class and the change
+ * will affect all the appearences of the add operation function.
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class AddOperationModule
+{
+ /**
+ * stores the id of the referring object (the id member field of the object!)
+ */
+ var $objId = "";
+ /**
+ * stores the prefix of the referring object's html-form-fields
+ */
+ var $htmlId = "";
+
+ /**
+ * constructor that sets the necessary values ov the member fields
+ */
+ function AddOperationModule($objId, $htmlId)
+ {
+ $this->objId = $objId;
+ $this->htmlId = $htmlId;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<select name=\"".$this->htmlId."_newoperation\">\n";
+ $temp .= $offset." <option value=\"and\">AND - logisches UND</option>\n";
+ $temp .= $offset." <option value=\"or\">OR - logisches ODER</option>\n";
+ $temp .= $offset." <option value=\"not\">NOT - logisches NICHT</option>\n";
+ $temp .= $offset." <option value=\"ogc:propertyisequalto\">Eigenschaft = x</option>\n";
+ $temp .= $offset." <option value=\"ogc:propertyisnotequalto\">Eigenschaft != x</option>\n";
+ $temp .= $offset." <option value=\"ogc:propertyisgreaterthan\">Eigenschaft > x</option>\n";
+ $temp .= $offset." <option value=\"ogc:propertyisgreaterthanorequalto\">Eigenschaft >= x</option>\n";
+ $temp .= $offset." <option value=\"ogc:propertyislessthan\">Eigenschaft < x</option>\n";
+ $temp .= $offset." <option value=\"ogc:propertyislessthanorequalto\">Eigenschaft <= x</option>\n";
+ $temp .= $offset." <option value=\"ogc:propertyislike\">Eigenschaft �hnlich x</option>\n";
+ $temp .= $offset." <option value=\"ogc:propertyisnull\">Eigenschaft nicht definiert</option>\n";
+ $temp .= $offset." <option value=\"ogc:propertyisbetween\">x <= Eigenschaft <= y</option>\n";
+ $temp .= $offset."</select>\n";
+ $temp .= $offset."<span class=\"edit hand\"";
+ $temp .= " onClick=\"url='?function=addoperation&id=".$this->objId."&operation=';";
+ $temp .= " url += document.editFilter.".$this->htmlId."_newoperation.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">";
+ $temp .= "<img src='./img/plus.gif' border='0'> hinzufügen\n</span>";
+ return $temp;
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/AnchorPoint.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/AnchorPoint.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/AnchorPoint.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,133 @@
+<?php
+/**
+ * Implementation of the AnchorPoint-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class AnchorPoint
+{
+ /**
+ * The anchorpointx attribute from the xml-scheme.
+ * Allowed values are between 0 and 1.
+ * @var float
+ */
+ var $anchorpointx = "";
+
+ /**
+ * The anchorpointy attribute from the xml-scheme.
+ * Allowed values are between 0 and 1.
+ * @var float
+ */
+ var $anchorpointy = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<AnchorPoint>\n";
+ $temp .= $offset." <AnchorPointX>".htmlspecialchars($this->anchorpointx)."</AnchorPointX>\n";
+ $temp .= $offset." <AnchorPointY>".htmlspecialchars($this->anchorpointy)."</AnchorPointY>\n";
+ $temp .= $offset."</AnchorPoint>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"anchorpoint\">\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." AnchorPointX:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ //TODO - check possible values and their meaning
+ $temp .= $offset." <select name=\"".$id."_anchorpointx\">\n";
+ $temp .= $offset." <option value=\"0.0\"";
+ if ( $this->anchorpointx == "0.0") $temp .= " selected";
+ $temp .= ">0.0 - Ankerpunkt rechts</option>\n";
+ $temp .= $offset." <option value=\"0.5\"";
+ if ( $this->anchorpointx == "0.5") $temp .= " selected";
+ $temp .= ">0.5 - Ankerpunkt mitte</option>\n";
+ $temp .= $offset." <option value=\"1.0\"";
+ if ( $this->anchorpointx == "1.0") $temp .= " selected";
+ $temp .= ">1.0 - Ankerpunkt links</option>\n";
+ $temp .= $offset." </select>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." AnchorPointY:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ //TODO - check possible values and their meaning
+ $temp .= $offset." <select name=\"".$id."_anchorpointy\">\n";
+ $temp .= $offset." <option value=\"0.0\"";
+ if ( $this->anchorpointy == "0.0") $temp .= " selected";
+ $temp .= ">0.0 - Ankerpunkt oben</option>\n";
+ $temp .= $offset." <option value=\"0.5\"";
+ if ( $this->anchorpointy == "0.5") $temp .= " selected";
+ $temp .= ">0.5 - Ankerpunkt mitte</option>\n";
+ $temp .= $offset." <option value=\"1.0\"";
+ if ( $this->anchorpointy == "1.0") $temp .= " selected";
+ $temp .= ">1.0 - Ankerpunkt unten</option>\n";
+ $temp .= $offset." </select>\n";
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_anchorpointx"]))
+ {
+ $this->anchorpointx = $_REQUEST[$id."_anchorpointx"];
+ }
+ if (isset($_REQUEST[$id."_anchorpointy"]))
+ {
+ $this->anchorpointy = $_REQUEST[$id."_anchorpointy"];
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/BinaryComparisonOp.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/BinaryComparisonOp.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/BinaryComparisonOp.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,135 @@
+<?php
+/**
+ * Implementation of the BinaryComparisonOp-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class BinaryComparisonOp
+{
+ /**
+ * Defines the type of comparison operation.
+ * @var string
+ */
+ var $name = "";
+
+ /**
+ * Name of the property that is addressed in this comparison.
+ * @var string
+ */
+ var $ogcPropertyName = "";
+
+ /**
+ * String that is compared to the property-value.
+ * Regular Expression?
+ * @var string
+ */
+ var $ogcLiteral = "";
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * constructor that directly fills the $name variable.
+ * @param string $name the type of the comparison operation
+ */
+ function BinaryComparisonOp($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<".$this->name.">\n";
+ $temp .= $offset. " <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
+ $temp .= $offset. " <ogc:Literal>".$this->ogcLiteral."</ogc:Literal>\n";
+ $temp .= $offset."</".$this->name.">\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"binaryComparisonOp\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".$this->name."\">\n";
+
+ $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width:50px; text-align: center; font-size: large; \">";
+
+ switch($this->name)
+ {
+ case "ogc:PropertyIsEqualTo": $temp .= "="; break;
+ case "ogc:PropertyIsNotEqualTo": $temp .= "!="; break;
+ case "ogc:PropertyIsGreaterThan": $temp .= ">"; break;
+ case "ogc:PropertyIsGreaterThanOrEqualTo": $temp .= ">="; break;
+ case "ogc:PropertyIsLessThan": $temp .= "<"; break;
+ case "ogc:PropertyIsLessThanOrEqualTo": $temp .= "<="; break;
+ default: $temp .= $this->name;
+ }
+ $temp .= "\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <input name=\"".$id."_ogcliteral\" value=\"".$this->ogcLiteral."\">\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
+ $this->ogcLiteral = $_REQUEST[$id."_ogcliteral"];
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/BinaryLogicOp.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/BinaryLogicOp.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/BinaryLogicOp.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,189 @@
+<?php
+/**
+ * Implementation of the BinaryLogicOp-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class BinaryLogicOp
+{
+ /**
+ * Defines the type of logical operation.
+ * Possible values: and + or
+ * @var string
+ */
+ var $name = "";
+
+ /**
+ * Array containing the operations of this filter
+ * @see UnaryLogicOp
+ * @see BinaryLogicOp
+ * @see BinaryComparisonOp
+ * @see PropertyIsLike
+ * @see PropertyIsNull
+ * @see PropertyIsBetween
+ * @var array
+ */
+ var $operations = array();
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Constructor that directly fills the $name variable.
+ * @param string $name the type of this logical operation.
+ */
+ function BinaryLogicOp($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<".$this->name.">\n";
+ foreach($this->operations as $operation)
+ {
+ $temp .= $operation->generateXml($offset." ");
+ }
+ $temp .= $offset."</".$this->name.">\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"binaryLogicOp\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".$this->name."\">\n";
+
+ $temp .= $offset." ".$this->name."<br>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td colspan=\"3\">\n";
+
+ $temp .= $offset." <table>\n";
+
+ $displayOperationModule = new DisplayOperationModule();
+ $temp .= $displayOperationModule->generateHtmlForm($offset." ", $this->operations, $id);
+
+ if(count($this->operations) == 1)
+ {
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"4\">\n";
+ $temp .= $offset." <hr style=\"color: black\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+
+
+ //Only 2 Operations
+ if (count($this->operations) < 2)
+ {
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"4\">\n";
+
+ $addOperationModule = new AddOperationModule($this->id, $id);
+ $temp .= $addOperationModule->generateHtmlForm($offset." ");
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+ $temp .= $offset." </table>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ $countOperations = 0;
+ while (isset($_REQUEST[$id."_operation_".$countOperations]))
+ {
+ if ($_REQUEST[$id."_operation_".$countOperations] == "binaryComparisonOp")
+ {
+ $operation = new BinaryComparisonOp();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "binaryLogicOp")
+ {
+ $operation = new BinaryLogicOp();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "unaryLogicOp")
+ {
+ $operation = new UnaryLogicOp();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsLike")
+ {
+ $operation = new PropertyIsLike();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsNull")
+ {
+ $operation = new PropertyIsNull();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsBetween")
+ {
+ $operation = new PropertyIsBetween();
+ }
+
+ $operation->generateObjectFromPost($id."_operation_".$countOperations);
+ $this->operations[] = $operation;
+ $countOperations++;
+ }
+ }
+
+ /**
+ * deletes the rule with the given index from the $operations array
+ * @param int $index index of the operation that has to be deleted
+ */
+ function deleteOperation($index)
+ {
+ array_splice($this->operations, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/ColorMap.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/ColorMap.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/ColorMap.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,117 @@
+<?php
+/**
+ * Implementation of the ColorMap-element
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class ColorMap
+{
+ /**
+ * Array containing the ColorMapEntry objects from the sld.
+ *
+ * @see ColorMapEntry
+ * @var object
+ */
+ var $colormapentries = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ColorMap>\n";
+ foreach ($this->colormapentries as $colormapentry)
+ {
+ $temp .= $colormapentry->generateXml($offset." ");
+ }
+ $temp .= $offset."</ColorMap>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." ColorMap<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"colormap\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletecolormap&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $colormapentry_id = 0;
+ foreach ($this->colormapentries as $colormapentry)
+ {
+ $temp .= $colormapentry->generateHtmlForm($id."_colormapentry_".$colormapentry_id, $offset." ");
+ $colormapentry_id++;
+ }
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addcolormapentry&id=".$this->id."\">ColorMapEntry hinzufügen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countColorMapEntries = 0;
+ while (isset($_REQUEST[$id."_colormapentry_".$countColorMapEntries]))
+ {
+ $colormapentry = new ColorMapEntry();
+ $colormapentry->generateObjectFromPost($id."_colormapentry_".$countColorMapEntries);
+ $this->colormapentries[] = $colormapentry;
+ $countColorMapEntries++;
+ }
+ }
+
+ /**
+ * Adds a ColorMapEntry object to the array.
+ */
+ function addColorMapEntry()
+ {
+ $this->colormapentries[] = new ColorMapEntry();
+ }
+
+ /**
+ * Deletes the ColorMapEntry object at the given index.
+ * @param int $index index of the ColorMapEntry that has to be deleted
+ */
+ function deleteColorMapEntry($index)
+ {
+ array_splice($this->colormapentries, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/ColorMapEntry.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/ColorMapEntry.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/ColorMapEntry.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,165 @@
+<?php
+/**
+ * Implementation of the ColorMapEntry-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class ColorMapEntry
+{
+ /**
+ * The color attribute from the xml-scheme.
+ * @var string
+ */
+ var $color = "";
+
+ /**
+ * The opacity attribute from the xml-scheme.
+ * @var string
+ */
+ var $opacity = "";
+
+ /**
+ * The quantity attribute from the xml-scheme.
+ * @var int
+ */
+ var $quantity = "";
+
+ /**
+ * The label attribute from the xml-scheme.
+ * @var string
+ */
+ var $label = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ColorMapEntry";
+ if ($this->color != "") $temp.= " color=\"".htmlspecialchars($this->color)."\"";
+ if ($this->opacity != "") $temp.= " opacity=\"".htmlspecialchars($this->opacity)."\"";
+ if ($this->quantity != "") $temp.= " quantity=\"".htmlspecialchars($this->quantity)."\"";
+ if ($this->label != "") $temp.= " label=\"".htmlspecialchars($this->label)."\"";
+ $temp .= " />\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." ColormapEntry<br>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletecolormapentry&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"colormapentry\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+
+ $temp .= $offset." <table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td style=\"width: 100px\">\n";
+ $temp .= $offset." Color:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td";
+ $temp .= " id=\"".$id."_color_preview\" style=\"border: 1px solid black; width: 100px; cursor: hand; background-color:".htmlspecialchars($this->color).";\" ";
+ $temp .= "onClick=\"window.open('sld_pick_color.php?id=".$id."_color','Farbauswahl','width=299, height=194, resizable=no');\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_color\" value=\"".htmlspecialchars($this->color)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Opacity:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_opacity\" value=\"".htmlspecialchars($this->opacity)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Quantity:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_quantity\" value=\"".htmlspecialchars($this->quantity)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Label:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_label\" value=\"".htmlspecialchars($this->label)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_color"]))
+ {
+ $this->color = $_REQUEST[$id."_color"];
+ }
+ if (isset($_REQUEST[$id."_opacity"]))
+ {
+ $this->opacity = $_REQUEST[$id."_opacity"];
+ }
+ if (isset($_REQUEST[$id."_quantity"]))
+ {
+ $this->quantity = $_REQUEST[$id."_quantity"];
+ }
+ if (isset($_REQUEST[$id."_label"]))
+ {
+ $this->label = $_REQUEST[$id."_label"];
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/CssParameter.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/CssParameter.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/CssParameter.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Implementation of the CssParameter-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class CssParameter
+{
+ /**
+ * The name attribute from the xml-scheme.
+ * @var string
+ */
+ var $name = "";
+
+ /**
+ * The value attribute from the xml-scheme.
+ * @var string
+ */
+ var $value = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<CssParameter ";
+ $temp .= "name=\"".htmlspecialchars($this->name)."\">";
+ $temp .= htmlspecialchars($this->value);
+ $temp .= "</CssParameter>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." CssParameter<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"cssparameter\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletecssparameter&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." ".htmlspecialchars($this->name)."\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".htmlspecialchars($this->name)."\">\n";
+ $temp .= $offset." </td>\n";
+
+ //Farbauswahl
+ if ($this->name == "fill" || $this->name == "stroke")
+ {
+ $temp .= $offset." <td";
+ $temp .= " id=\"".$id."_value_preview\" style=\"border: 1px solid black; width: 100px; cursor: hand; background-color:".htmlspecialchars($this->value).";\" ";
+ $temp .= "onClick=\"window.open('sld_pick_color.php?id=".$id."_value','Farbauswahl','width=299, height=194, resizable=no');\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_value\" id=\"".$id."_value\" value=\"".htmlspecialchars($this->value)."\">\n";
+ $temp .= $offset." </td>\n";
+ }
+ else if ($this->name == "stroke-width" || $this->name == "font-size")
+ {
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <select name=\"".$id."_value\" onchange=\"document.getElementById('sld_editor_form').submit();\">\n";
+ for ($i=0; $i < 17; $i++)
+ {
+ $temp .= $offset." <option value=\"".$i."\"";
+ if ( $this->value == $i ) $temp .= " selected";
+ $temp .= ">".$i." px</option>\n";
+ }
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." </td>\n";
+ }
+ else if ($this->name == "font-family")
+ {
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <select name=\"".$id."_value\" onchange=\"document.getElementById('sld_editor_form').submit();\">\n";
+ $temp .= $offset." <option value=\"verdana\"";
+ if ($this->value == "verdana") $temp .= " selected";
+ $temp .= ">Verdana</option>\n";
+ $temp .= $offset." <option value=\"arial\"";
+ if ($this->value == "arial") $temp .= " selected";
+ $temp .= ">Arial</option>\n";
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." </td>\n";
+ }
+ else
+ {
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_value\" value=\"".htmlspecialchars($this->value)."\">\n";
+ $temp .= $offset." </td>\n";
+ }
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_name"]))
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ }
+ if (isset($_REQUEST[$id."_value"]))
+ {
+ $this->value = $_REQUEST[$id."_value"];
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/Displacement.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/Displacement.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/Displacement.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Implementation of the Displacement-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Displacement
+{
+ /**
+ * The displacementx attribute from the xml-scheme.
+ * @var int
+ */
+ var $displacementx = "";
+
+ /**
+ * The displacementy attribute from the xml-scheme.
+ * @var int
+ */
+ var $displacementy = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Displacement>\n";
+ $temp .= $offset." <DisplacementX>".htmlspecialchars($this->displacementx)."</DisplacementX>\n";
+ $temp .= $offset." <DisplacementY>".htmlspecialchars($this->displacementy)."</DisplacementY>\n";
+ $temp .= $offset."</Displacement>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"displacement\">\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." DisplacementX:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_displacementx\" value=\"".htmlspecialchars($this->displacementx)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." DisplacementY:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_displacementy\" value=\"".htmlspecialchars($this->displacementy)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_displacementx"]))
+ {
+ $this->displacementx = $_REQUEST[$id."_displacementx"];
+ }
+ if (isset($_REQUEST[$id."_displacementy"]))
+ {
+ $this->displacementy = $_REQUEST[$id."_displacementy"];
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/DisplayOperationModule.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/DisplayOperationModule.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/DisplayOperationModule.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Template Class that is used to display the operations
+ * creates the hmtl source code for the operations
+ * similar to the AddOperationModule
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class DisplayOperationModule
+{
+ /**
+ * function that creates the html-form-fragment sourcecode
+ *
+ * @param $offset string whitespaces that should be added in every row of sourcecode for formatting
+ * @param $operations array containing the operations for which the source should be created
+ * @return string the created code
+ */
+ function generateHtmlForm($offset = "", $operations, $id)
+ {
+ $temp = "";
+ $operation_id = 0;
+ $max = count($operations);
+ foreach ($operations as $operation)
+ {
+ if ($id == "")
+ {
+ $temp .= $operation->generateHtmlForm($id."operation_".$operation_id, $offset);
+ }
+ else
+ {
+ $temp .= $operation->generateHtmlForm($id."_operation_".$operation_id, $offset);
+ }
+ //Display emtpy row or line to separate the operations
+ if ($operation_id+1 < $max)
+ {
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"4\">\n";
+ $temp .= $offset." <hr style=\"color: black\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+ $operation_id++;
+ }
+ return $temp;
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/ElseFilter.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/ElseFilter.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/ElseFilter.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Implementation of the ElseFilter-element.
+ * An ElseFilter can be used instead of a Filter.
+ * An ElseFilter is always true an should be used to group those
+ * entities that do not have a specific rule for themselves.
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class ElseFilter extends Rule
+{
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<ElseFilter />\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"elsefilter\">\n";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." ElseFilter:<br>\n";
+ $temp .= $offset." <a class=\"edit\" href=\"sld_edit_filter.php?function=deletefilter\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/ExternalGraphic.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/ExternalGraphic.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/ExternalGraphic.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,125 @@
+<?php
+/**
+ * Implementation of the ExternalGraphic-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class ExternalGraphic
+{
+ /**
+ * The onlineresource element from the xml-scheme.
+ * @var string
+ */
+ var $onlineresource = "";
+
+ /**
+ * The format element from the xml-scheme.
+ * @var string
+ */
+ var $format = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ExternalGraphic>\n";
+ $temp .= $offset." <OnlineResource xlink:href=\"".htmlspecialchars($this->onlineresource)."\" />\n";
+ $temp .= $offset." <Format>".htmlspecialchars($this->format)."</Format>\n";
+ $temp .= $offset."</ExternalGraphic>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table style=\"border: 1px solid black;\" >\n";
+ $temp .= $offset." <tr valign='top'>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." ExternalGraphic<br>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deleteexternalgraphicormark&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"externalgraphic\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <table border=\"0\">\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." OnlineResource:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_onlineresource\" value=\"".htmlspecialchars($this->onlineresource)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Format:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_format\" value=\"".htmlspecialchars($this->format)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+
+ //TODO: Selectbox f�r Format
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset." <br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_onlineresource"]))
+ {
+ $this->onlineresource = $_REQUEST[$id."_onlineresource"];
+ }
+ if (isset($_REQUEST[$id."_format"]))
+ {
+ $this->format = $_REQUEST[$id."_format"];
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/FeatureTypeStyle.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/FeatureTypeStyle.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/FeatureTypeStyle.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,138 @@
+<?php
+/**
+ * Implementation of the FeatureTypeStyle-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class FeatureTypeStyle extends UserStyle
+{
+ /**
+ * Array containing the Rule-objects
+ *
+ * @see Rule
+ * @var array
+ */
+ var $rules = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<FeatureTypeStyle>\n";
+ foreach($this->rules as $rule)
+ {
+ $temp .= $rule->generateXml($offset." ");
+ }
+ $temp .= $offset."</FeatureTypeStyle>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ ###### -----------> Fensterrahmen Rule
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"featuretypestyle\">\n";
+ $temp .= $offset."<table border=\"0\" cellspacing=\"2\" cellspacing=\"1\">\n";
+
+ $rule_id = 0;
+ foreach ($this->rules as $rule)
+ {
+ $temp .= $offset." <tr>\n";
+ $temp .= $rule->generateHtmlForm($id."_rule_".$rule_id, $offset." ");
+ $rule_id++;
+ $temp .= $offset." </tr>\n";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td colspan=\"3\"' height='5'>\n";
+ $temp .= $offset."<hr size='1' noshade color='#86A6C5'>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td colspan=\"3\">\n";
+ $temp .= $offset."<table width='100%' border='0' cellspacing=\"2\" cellspacing=\"1\">\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addrule&id=".$this->id."\">\n";
+ $temp .= $offset."<img src='./img/plus.gif' border='0' alt='Rule hinzuf�gen'> hinzufügen\n";
+ $temp .= $offset."</a>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."</table>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countRules = 0;
+ while (isset($_REQUEST[$id."_rule_".$countRules]))
+ {
+ $rule = new Rule();
+ $rule->generateObjectFromPost($id."_rule_".$countRules);
+ $this->rules[] = $rule;
+ $countRules++;
+ }
+ }
+ /**
+ * adds a new Rule object to the $rules array
+ *
+ * this function is called from sld_function_handler.php
+ */
+ function addRule()
+ {
+ $this->rules[] = new Rule();
+ }
+ /**
+ * deletes the rule with the given index from the $rules array
+ *
+ * this function is called from sld_function_handler.php
+ *
+ * @param int $index index of the rule that has to be deleted
+ */
+ function deleteRule($index)
+ {
+ array_splice($this->rules, $index, 1);
+ }
+}
+
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/Fill.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/Fill.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/Fill.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,154 @@
+<?php
+/**
+ * Implementation of the Fill-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Fill
+{
+ /**
+ * The GraphicFill object from the xml-scheme.
+ *
+ * @see GraphicFill
+ * @var string
+ */
+ var $graphicfill = "";
+
+ /**
+ * Array containing the CssParameter objects from the xml-scheme.
+ *
+ * @see CssParameter
+ * @var array
+ */
+ var $cssparameters = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Fill>\n";
+ if ($this->graphicfill != "") $temp .= $this->graphicfill->generateXml($offset." ");
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateXml($offset." ");
+ }
+ $temp .= $offset."</Fill>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Fill<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"fill\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletefill&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td valign=\"top\">\n";
+ if ($this->graphicfill != "")
+ {
+ $temp .= $this->graphicfill->generateHtmlForm($id."_graphicfill", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addgraphicfill&id=".$this->id."\">GraphicFill hinzufügen</a><br>\n";
+ }
+ $cssparameter_id = 0;
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateHtmlForm($id."_cssparameter_".$cssparameter_id, $offset." ");
+ $cssparameter_id++;
+ }
+ $temp .= $offset." <select name=\"".$id."_newcssparameter\">\n";
+ $temp .= $offset." <option value=\"fill\">fill</option>\n";
+ $temp .= $offset." <option value=\"fill-opacity\">fill-opacity</option>\n";
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." <input type=\"button\" value=\"hinzufügen\"";
+ //Javascript to make a http request
+ $temp .= " onClick=\"url='sld_function_handler.php?function=addcssparameter&id=".$this->id."&cssparameter=';";
+ $temp .= " url += ".$id."_newcssparameter.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_graphicfill"]))
+ {
+ $this->graphicfill = new GraphicFill();
+ $this->graphicfill->generateObjectFromPost($id."_graphicfill");
+ }
+ $countCssParameters = 0;
+ while (isset($_REQUEST[$id."_cssparameter_".$countCssParameters]))
+ {
+ $cssParameter = new CssParameter();
+ $cssParameter->generateObjectFromPost($id."_cssparameter_".$countCssParameters);
+ $this->cssparameters[] = $cssParameter;
+ $countCssParameters++;
+ }
+ }
+
+ /**
+ * Function that adds a new CssParameter to the array.
+ * @param string $cssparameter the name of the new CssParameter object
+ */
+ function addCssParameter($cssParameter)
+ {
+ $newCssParameter = new CssParameter();
+ $newCssParameter->name = $cssParameter;
+ $this->cssparameters[] = $newCssParameter;
+ }
+
+ /**
+ * Deletes the CssParameter at the given index.
+ * @param int $index index of the CssParamater in the array that has to be deleted
+ */
+ function deleteCssParameter($index)
+ {
+ array_splice($this->cssparameters, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/Filter.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/Filter.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/Filter.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,162 @@
+<?php
+/**
+ * This file contains the classes used for editing filter expressions.
+ * Filter expressions are currently limited to logical and comparison operations.
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+
+
+
+/**
+ * This class is the implementation of the filter-element from ogc:filter.
+ *
+ * This element builds up the root of filter-expressions.
+ * This class is directly referred to in the sld_edit_filter.php.
+ *
+ * @package filter_classes
+ */
+class Filter extends Rule
+{
+ /**
+ * Array containing the operations of this filter
+ * @see UnaryLogicOp
+ * @see BinaryLogicOp
+ * @see BinaryComparisonOp
+ * @see PropertyIsLike
+ * @see PropertyIsNull
+ * @see PropertyIsBetween
+ * @var array
+ */
+ var $operations = array();
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ogc:Filter>\n";
+ foreach($this->operations as $operation)
+ {
+ $temp .= $operation->generateXml($offset." ");
+ }
+ $temp .= $offset."</ogc:Filter>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"filter\">\n";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Filter:<br>\n";
+ $temp .= $offset." <a class=\"edit\" href=\"sld_edit_filter.php?function=deletefilter\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td colspan=\"3\">\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+
+ $displayOperationModule = new DisplayOperationModule();
+ $temp .= $displayOperationModule->generateHtmlForm($offset." ", $this->operations, $id);
+
+ if (count($this->operations) == 0)
+ {
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td colspan=\"4\">\n";
+
+ $addOperationModule = new AddOperationModule($this->id, $id);
+ $temp .= $addOperationModule->generateHtmlForm($offset." ");
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ }
+ $temp .= $offset."</table>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countOperations = 0;
+ while (isset($_REQUEST[$id."operation_".$countOperations]))
+ {
+ if ($_REQUEST[$id."operation_".$countOperations] == "binaryComparisonOp")
+ {
+ $operation = new BinaryComparisonOp();
+ }
+ if ($_REQUEST[$id."operation_".$countOperations] == "binaryLogicOp")
+ {
+ $operation = new BinaryLogicOp();
+ }
+ if ($_REQUEST[$id."operation_".$countOperations] == "unaryLogicOp")
+ {
+ $operation = new UnaryLogicOp();
+ }
+ if ($_REQUEST[$id."operation_".$countOperations] == "propertyIsLike")
+ {
+ $operation = new PropertyIsLike();
+ }
+ if ($_REQUEST[$id."operation_".$countOperations] == "propertyIsNull")
+ {
+ $operation = new PropertyIsNull();
+ }
+ if ($_REQUEST[$id."operation_".$countOperations] == "propertyIsBetween")
+ {
+ $operation = new PropertyIsBetween();
+ }
+ $operation->generateObjectFromPost($id."operation_".$countOperations);
+ $this->operations[] = $operation;
+ $countOperations++;
+ }
+ }
+
+ /**
+ * deletes the rule with the given index from the $operations array
+ * @param int $index index of the operation that has to be deleted
+ */
+ function deleteOperation($index)
+ {
+ array_splice($this->operations, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/Font.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/Font.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/Font.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,138 @@
+<?php
+/**
+ * Implementation of the Font-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Font
+{
+ /**
+ * Array containing the CssParameter objects from the sld.
+ *
+ * @see CssParameter
+ * @var array
+ */
+ var $cssparameters = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Font>\n";
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateXml($offset." ");
+ }
+ $temp .= $offset."</Font>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Font<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"font\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletefont&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $cssparameter_id = 0;
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateHtmlForm($id."_cssparameter_".$cssparameter_id, $offset." ");
+ $cssparameter_id++;
+ }
+ $temp .= $offset." <select name=\"".$id."_newcssparameter\">\n";
+ $temp .= $offset." <option value=\"font-family\">font-family</option>\n";
+ $temp .= $offset." <option value=\"font-size\">font-size</option>\n";
+
+ //Probably not supported by Mapserver
+ //$temp .= $offset."<option value=\"font-style\">font-style</option>\n";
+ //$temp .= $offset."<option value=\"font-weight\">font-weight</option>\n";
+
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." <input type=\"button\" value=\"hinzufügen\"";
+ //Javascript to make a http request
+ $temp .= " onClick=\"url='sld_function_handler.php?function=addcssparameter&id=".$this->id."&cssparameter=';";
+ $temp .= " url += ".$id."_newcssparameter.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countCssParameters = 0;
+ while (isset($_REQUEST[$id."_cssparameter_".$countCssParameters]))
+ {
+ $cssParameter = new CssParameter();
+ $cssParameter->generateObjectFromPost($id."_cssparameter_".$countCssParameters);
+ $this->cssparameters[] = $cssParameter;
+ $countCssParameters++;
+ }
+ }
+
+ /**
+ * Adds a new CssParameter object to the array.
+ * @param string $cssParameter name of the new CssParameter object
+ */
+ function addCssParameter($cssParameter)
+ {
+ $newCssParameter = new CssParameter();
+ $newCssParameter->name = $cssParameter;
+ $this->cssparameters[] = $newCssParameter;
+ }
+
+ /**
+ * Deletes the CssParameter object at the given index.
+ * @param int $index index of the CssParameter object that should be deleted
+ */
+ function deleteCssParameter($index)
+ {
+ array_splice($this->cssparameters, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/Graphic.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/Graphic.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/Graphic.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,225 @@
+<?php
+/**
+ * Implementation of the Graphic-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Graphic
+{
+ /**
+ * Array containing ExternalGraphic or Mark objects.
+ *
+ * @see ExternalGraphic
+ * @see Mark
+ * @var array
+ */
+ var $externalgraphicsormarks = array();
+
+ /**
+ * The opacity element from the xml-scheme.
+ *
+ * Not sure if this feature is supported by UMN-MapServer!
+ *
+ * @var string
+ */
+ var $opacity = "";
+
+ /**
+ * The size element from the xml-scheme.
+ * @var string
+ */
+ var $size = "";
+
+ /**
+ * The rotation element from the xml-scheme.
+ *
+ * Not sure if this feature is supported by UMN-MapServer!
+ *
+ * @var int
+ */
+ var $rotation = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Graphic>\n";
+ foreach ($this->externalgraphicsormarks as $externalgraphicormark)
+ {
+ $temp .= $externalgraphicormark->generateXml($offset." ");
+ }
+ if ($this->opacity != "") $temp .= $offset." <Opacity>".htmlspecialchars($this->opacity)."</Opacity>\n";
+ if ($this->size != "") $temp .= $offset." <Size>".htmlspecialchars($this->size)."</Size>\n";
+ if ($this->rotation != "") $temp .= $offset." <Rotation>".htmlspecialchars($this->rotation)."</Rotation>\n";
+ $temp .= $offset."</Graphic>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table border='0' cellpadding='2' cellspacing='0'>\n";
+ $temp .= $offset."<tr valign='top'>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."<span>\n";
+ $temp .= $offset."Graphic:\n";
+ $temp .= $offset."</span>\n";
+ $temp .= $offset."<br>\n";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"graphic\">\n";
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=deletegraphic&id=".$this->parent."\">";
+ $temp .= $offset."<img src='./img/minus.gif' border='0' alt='Rule löschen'> löschen";
+ $temp .= $offset."</a>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td valign='top'>\n";
+
+ $temp .= $offset." <table border='1' cellpadding='2' cellspacing='1'>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text' style=\"width: 100px;\">\n";
+ $temp .= $offset." Opacity:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input class='inputfield edit_label_text' name=\"".$id."_opacity\" value=\"".htmlspecialchars($this->opacity)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>\n";
+ $temp .= $offset." Size:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input class='inputfield edit_label_text' name=\"".$id."_size\" value=\"".htmlspecialchars($this->size)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>\n";
+ $temp .= $offset." Rotation:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input class='inputfield edit_label_text' name=\"".$id."_rotation\" value=\"".htmlspecialchars($this->rotation)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td valign='top'>\n";
+ $temp .= $offset." <select class=\"edit_label_text\" name=\"".$id."_newexternalgraphicormark\">\n";
+ $temp .= $offset." <option value=\"mark\">Mark</option>\n";
+ $temp .= $offset." <option value=\"externalgraphic\">ExternalGraphic</option>\n";
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td colspan='2'>\n";
+ $externalgraphicormark_id = 0;
+ foreach ($this->externalgraphicsormarks as $externalgraphicormark)
+ {
+ $temp .= $externalgraphicormark->generateHtmlForm($id."_externalgraphicormark_".$externalgraphicormark_id, $offset."");
+ $externalgraphicormark_id++;
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset."<input class='edit' type=\"button\" value=\"hinzufügen\"";
+ $temp .= " onClick=\"url='sld_function_handler.php?function=addexternalgraphicormark&id=".$this->id."&externalgraphicormark=';";
+ $temp .= " url += ".$id."_newexternalgraphicormark.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countExternalGraphicsOrMarks = 0;
+ while (isset($_REQUEST[$id."_externalgraphicormark_".$countExternalGraphicsOrMarks]))
+ {
+ $externalgraphicormark = "";
+ if ($_REQUEST[$id."_externalgraphicormark_".$countExternalGraphicsOrMarks] == "mark")
+ {
+ $externalgraphicormark = new Mark();
+ }
+ else if ($_REQUEST[$id."_externalgraphicormark_".$countExternalGraphicsOrMarks] == "externalgraphic")
+ {
+ $externalgraphicormark = new ExternalGraphic();
+ }
+ $externalgraphicormark->generateObjectFromPost($id."_externalgraphicormark_".$countExternalGraphicsOrMarks);
+ $this->externalgraphicsormarks[] = $externalgraphicormark;
+ $countExternalGraphicsOrMarks++;
+ }
+ if (isset($_REQUEST[$id."_opacity"]))
+ {
+ $this->opacity = $_REQUEST[$id."_opacity"];
+ }
+ if (isset($_REQUEST[$id."_size"]))
+ {
+ $this->size = $_REQUEST[$id."_size"];
+ }
+ if (isset($_REQUEST[$id."_rotation"]))
+ {
+ $this->rotation = $_REQUEST[$id."_rotation"];
+ }
+ }
+ function addExternalGraphicOrMark($externalgraphicormark)
+ {
+ if ($externalgraphicormark == "externalgraphic")
+ {
+ $this->externalgraphicsormarks[] = new ExternalGraphic();
+ }
+ else if ($externalgraphicormark == "mark")
+ {
+ $test = new Mark();
+ $this->externalgraphicsormarks[] = $test;
+ }
+ }
+ function deleteExternalGraphicOrMark($index)
+ {
+ array_splice($this->externalgraphicsormarks, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/GraphicFill.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/GraphicFill.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/GraphicFill.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,98 @@
+<?php
+/**
+ * Implementation of the GraphicFill-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class GraphicFill
+{
+ /**
+ * The Graphic object from the xml-scheme.
+ *
+ * @see Graphic
+ * @var object
+ */
+ var $graphic = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<GraphicFill>\n";
+ if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
+ $temp .= $offset."</GraphicFill>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table style=\"border: 1px solid black;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." GraphicFill<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"graphicfill\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletegraphicfill&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ if ($this->graphic != "")
+ {
+ $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."Graphic hinzufügen<a class='edit' href=\"sld_function_handler.php?function=addgraphic&id=".$this->id."\">Graphic hinzufügen</a><br>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_graphic"]))
+ {
+ $this->graphic = new Graphic();
+ $this->graphic->generateObjectFromPost($id."_graphic");
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/GraphicStroke.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/GraphicStroke.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/GraphicStroke.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,100 @@
+<?php
+/**
+ * Implementation of the GraphicStroke-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class GraphicStroke
+{
+ /**
+ * The Graphic object from the xml-scheme.
+ *
+ * @see Graphic
+ * @var object
+ */
+ var $graphic = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Default constructor that automatically creates a Graphic object.
+ */
+ function GraphicStroke()
+ {
+ $this->graphic = new Graphic();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<GraphicStroke>\n";
+ if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
+ $temp .= $offset."</GraphicStroke>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table style=\"border: 1px solid black;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." GraphicStroke\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"graphicstroke\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ if ($this->graphic != "") $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_graphic"]))
+ {
+ $this->graphic = new Graphic();
+ $this->graphic->generateObjectFromPost($id."_graphic");
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/Halo.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/Halo.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/Halo.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Implementation of the Halo-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Halo
+{
+ /**
+ * The radius attribute from the xml-scheme.
+ * @var int
+ */
+ var $radius = "";
+
+ /**
+ * The Fill object from the xml-scheme.
+ *
+ * @see Fill
+ * @var string
+ */
+ var $fill = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Halo>\n";
+ if ($this->radius != "") $temp .= $offset." <Radius>".htmlspecialchars($this->radius)."</Radius>\n";
+ if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
+ $temp .= $offset."</Halo>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table style=\"border: 1px solid black;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Halo\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"halo\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." Radius: <input name=\"".$id."_radius\" value=\"".htmlspecialchars($this->radius)."\"><br>\n";
+ if ($this->fill != "") $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_radius"]))
+ {
+ $this->radius = $_REQUEST[$id."_radius"];
+ }
+ if (isset($_REQUEST[$id."_fill"]))
+ {
+ $this->fill = new Fill();
+ $this->fill->generateObjectFromPost($id."_fill");
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/LabelPlacement.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/LabelPlacement.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/LabelPlacement.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Implementation of the LabelPlacement-element
+ *
+ * This implementation only supports PointPlacement for Labels, because UMN-Mapservers's implementation is limited to PointPlacement, too.
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class LabelPlacement
+{
+ /**
+ * The Placement object from the xml-scheme.
+ * Only PointPlacement is supported in UMN-MapServer.
+ *
+ * @see Pointplacement
+ * @var object
+ */
+ var $placement = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Default constructor that automatically creates a PointPlacement object.
+ */
+ function LabelPlacement()
+ {
+ //Only PointPlacement is supported by MapServer
+ $this->placement = new PointPlacement();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<LabelPlacement>\n";
+ $temp .= $this->placement->generateXml($offset." ");
+ $temp .= $offset."</LabelPlacement>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." LabelPlacement<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"labelplacement\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletelabelplacement&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $this->placement->generateHtmlForm($id."_placement", $offset." ");
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ //Todo - Unterscheidung von PointPlacement und anderen Placements (wenn vorhanden)
+ //not supported by Mapserver
+ if (isset($_REQUEST[$id."_placement"]))
+ {
+ $this->placement = new PointPlacement();
+ $this->placement->generateObjectFromPost($id."_placement");
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/LegendGraphic.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/LegendGraphic.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/LegendGraphic.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,136 @@
+<?php
+/**
+ * Implementation of the LegendGraphic-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class LegendGraphic extends Rule
+{
+ /**
+ * The Graphic object from the xml-scheme.
+ *
+ * @see Graphic
+ * @var object
+ */
+ var $graphic = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<LegendGraphic>\n";
+ //Graphic must occur once
+ if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
+ $temp .= $offset."</LegendGraphic>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table width='100%' border='0' cellpadding='1' cellspacing='0'>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text' valign='top' width='136'>\n";
+ $temp .= $offset." LegendGraphic:\n";
+ $temp .= $offset." </td>\n";
+
+ if ($this->graphic != "")
+ {
+ $temp .= $offset."<td rowspan='2'>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."<td rowspan='2' style='border:1px solid black; background-color:#FFFFFF'>\n";
+ $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset." </tr>\n";
+ }
+ else
+ {
+ $temp .= $offset."<td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td class='text' style='border:1px solid black; border-bottom:none; background-color:#FFFFFF'>\n";
+ $temp .= $offset." Graphic:\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ //--------------------------
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td valign='bottom'>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"legendgraphic\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletelegendgraphic&id=".$this->parent."\">\n";
+ $temp .= $offset." <img src='./img/minus.gif' border='0' alt='LegendGraphic löschen'> löschen\n";
+ $temp .= $offset." </a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td style='border:1px solid black; border-top:none; background-color:#FFFFFF'>\n";
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addgraphic&id=".$this->id."\">\n";
+ $temp .= $offset." <img src='./img/plus.gif' border='0' alt='Graphic hinzufügen'> hinzufügen</a><br>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset." </tr>\n";
+ }
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_graphic"]))
+ {
+ $this->graphic = new Graphic();
+ $this->graphic->generateObjectFromPost($id."_graphic");
+ }
+ }
+
+ /**
+ * Function that adds a graphic object.
+ * Not sure if this function is neccessary / in use!
+ */
+ function addGraphic()
+ {
+ $this->graphic = new Graphic();
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/LineSymbolizer.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/LineSymbolizer.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/LineSymbolizer.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,111 @@
+<?php
+/**
+ * Implementation of the LineSymbolizer-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class LineSymbolizer extends Rule
+{
+ /**
+ * The Stroke object from the xml-scheme.
+ *
+ * @see Stroke
+ * @var object
+ */
+ var $stroke = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+
+ function LineSymbolizer()
+ {
+ //$this->stroke = new Stroke();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<LineSymbolizer>\n";
+ if ($this->stroke != "") $temp .= $this->stroke->generateXml($offset." ");
+ $temp .= $offset."</LineSymbolizer>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black; width:100%;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td class='text' style=\"width: 130px;\">\n";
+
+ $temp .= $offset." LineSymbolizer<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"linesymbolizer\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ if ($this->stroke != "")
+ {
+ $temp .= $this->stroke->generateHtmlForm($id."_stroke", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addstroke&id=".$this->id."\">Stroke hinzufügen</a>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_stroke"]))
+ {
+ $this->stroke = new Stroke();
+ $this->stroke->generateObjectFromPost($id."_stroke");
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/Mark.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/Mark.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/Mark.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,161 @@
+<?php
+/**
+ * Implementation of the Mark-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Mark
+{
+ /**
+ * The wellknownname element from the xml-scheme.
+ * @var string
+ */
+ var $wellknownname = "";
+
+ /**
+ * The Fill object from the xml-scheme.
+ *
+ * @see Fill
+ * @var object
+ */
+ var $fill = "";
+
+ /**
+ * The Stroke object from the xml-scheme.
+ *
+ * @see Stroke
+ * @var object
+ */
+ var $stroke = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Mark>\n";
+ if ($this->wellknownname != "") $temp .= $offset." <WellKnownName>".htmlspecialchars($this->wellknownname)."</WellKnownName>\n";
+ if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
+ if ($this->stroke != "") $temp .= $this->stroke->generateXml($offset." ");
+ $temp .= $offset."</Mark>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table style=\"border: 1px solid black;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px\">\n";
+ $temp .= $offset." Mark<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"mark\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deleteexternalgraphicormark&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." WellKnownName:\n";
+ $temp .= $offset." <select name=\"".$id."_wellknownname\">\n";
+ $temp .= $offset." <option value=\"square\"";
+ if ($this->wellknownname == "square") $temp .= " selected";
+ $temp .= ">square</option>\n";
+ $temp .= $offset." <option value=\"circle\"";
+ if ($this->wellknownname == "circle") $temp .= " selected";
+ $temp .= ">circle</option>\n";
+ $temp .= $offset." <option value=\"triangle\"";
+ if ($this->wellknownname == "triangle") $temp .= " selected";
+ $temp .= ">triangle</option>\n";
+ $temp .= $offset." <option value=\"star\"";
+ if ($this->wellknownname == "star") $temp .= " selected";
+ $temp .= ">star</option>\n";
+ $temp .= $offset." <option value=\"cross\"";
+ if ($this->wellknownname == "cross") $temp .= " selected";
+ $temp .= ">cross</option>\n";
+ $temp .= $offset."<option value=\"x\"";
+ if ($this->wellknownname == "x") $temp .= " selected";
+ $temp .= ">x</option>\n";
+ $temp .= $offset." </select>\n";
+ $temp .= $offset." <br>\n";
+ //TODO - Zeilenumbruch
+ if ($this->fill != "")
+ {
+ $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
+ }
+ if ($this->stroke != "")
+ {
+ $temp .= $this->stroke->generateHtmlForm($id."_stroke", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addstroke&id=".$this->id."\">Stroke hinzufügen</a><br>\n";
+ }
+
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_wellknownname"]))
+ {
+ $this->wellknownname = $_REQUEST[$id."_wellknownname"];
+ }
+ if (isset($_REQUEST[$id."_fill"]))
+ {
+ $this->fill = new Fill();
+ $this->fill->generateObjectFromPost($id."_fill");
+ }
+ if (isset($_REQUEST[$id."_stroke"]))
+ {
+ $this->stroke = new Stroke();
+ $this->stroke->generateObjectFromPost($id."_stroke");
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/NamedLayer.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/NamedLayer.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/NamedLayer.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,121 @@
+<?php
+
+/**
+ * Implementation of the NamedLayer-element
+ *
+ * @package sld_classes
+ * @see StyledLayerDescriptor::$layers
+ * @author Markus Krzyzanowski
+ */
+class NamedLayer extends StyledLayerDescriptor
+{
+ /**
+ * The name attribute from the xml-scheme.
+ * @var string
+ */
+ var $name = "";
+ //Probably not supported by Mapserver - TODO
+ //var $layerfeatureconstraints = "";
+ /**
+ * Array containing the style-objects of the layer.
+ *
+ * @see UserStyle
+ * @var array
+ */
+ var $styles = array();
+ // $id and $parent for the $objects session array
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<NamedLayer>\n";
+ $temp .= $offset." <Name>".htmlspecialchars($this->name)."</Name>\n";
+ foreach($this->styles as $style)
+ {
+ $temp .= $style->generateXml($offset." ");
+ }
+ $temp .= $offset."</NamedLayer>\n";
+ return $temp;
+ }
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text_head'>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"namedlayer\">\n";
+ $temp .= $offset." <em> Layer: ".htmlspecialchars($this->name)."</em>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".htmlspecialchars($this->name)."\">\n";
+ $style_id = 0;
+ foreach ($this->styles as $style)
+ {
+ $temp .= $style->generateHtmlForm($id."_style_".$style_id, $offset." ");
+ $style_id++;
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ $countStyles = 0;
+ while (isset($_REQUEST[$id."_style_".$countStyles]))
+ {
+ $style = "";
+ if ($_REQUEST[$id."_style_".$countStyles] == "userstyle")
+ {
+ $style = new UserStyle();
+ }
+ else
+ {
+ //Todo evtl: namedstyle erstellen
+ //NamedStyle is currently not supported by UMN-MapServer!
+ //$style = new NamedStyle();
+ }
+ $style->generateObjectFromPost($id."_style_".$countStyles);
+ $this->styles[] = $style;
+ $countStyles++;
+ }
+ }
+}
+
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/PointPlacement.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/PointPlacement.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/PointPlacement.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,133 @@
+<?php
+/**
+ * Implementation of the PointPlacement-element
+ *
+ * Creating an instance of this class will also create the anchorpoint and displacement objects for this instance.
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class PointPlacement
+{
+ /**
+ * The anchorpoint object from the xml-scheme.
+ *
+ * @see AnchorPoint
+ * @var object
+ */
+ var $anchorpoint = "";
+
+ /**
+ * The displacement object from the xml-scheme.
+ *
+ * @see Displacement
+ * @var object
+ */
+ var $displacement = "";
+
+ /**
+ * The rotation attribute from the xml-scheme.
+ *
+ * Not sure if this feature is supported in UMN-MapServer.
+ *
+ * @var int
+ */
+ var $rotation = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Default constructor that automatically creates an AnchorPoint and a Displacement object.
+ */
+ function PointPlacement()
+ {
+ $this->anchorpoint = new AnchorPoint();
+ $this->displacement = new Displacement();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<PointPlacement>\n";
+ $temp .= $this->anchorpoint->generateXml($offset." ");
+ $temp .= $this->displacement->generateXml($offset." ");
+ if ($this->rotation != "") $temp .= $offset." <Rotation>".htmlspecialchars($this->rotation)."</Rotation>\n";
+ $temp .= $offset."</PointPlacement>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"pointplacement\">\n";
+ $temp .= $offset."<table>\n";
+
+ $temp .= $this->anchorpoint->generateHtmlForm($id."_anchorpoint", $offset." ");
+ $temp .= $this->displacement->generateHtmlForm($id."_displacement", $offset." ");
+
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Rotation:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_rotation\" value=\"".htmlspecialchars($this->rotation)."\"><br>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_anchorpoint"]))
+ {
+ $this->anchorpoint = new AnchorPoint();
+ $this->anchorpoint->generateObjectFromPost($id."_anchorpoint");
+ }
+ if (isset($_REQUEST[$id."_displacement"]))
+ {
+ $this->displacement = new Displacement();
+ $this->displacement->generateObjectFromPost($id."_displacement");
+ }
+ if (isset($_REQUEST[$id."_rotation"]))
+ {
+ $this->placement = $_REQUEST[$id."_rotation"];
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/PointSymbolizer.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/PointSymbolizer.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/PointSymbolizer.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,119 @@
+<?php
+/**
+ * Implementation of the PointSymbolizer-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class PointSymbolizer extends Rule
+{
+ /**
+ * The Graphic object from the xml-scheme.
+ *
+ * @see Graphic
+ * @var object
+ */
+ var $graphic = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+
+ function PointSymbolizer()
+ {
+ //$this->graphic = new Graphic();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<PointSymbolizer>\n";
+ if ($this->graphic != "") $temp .= $this->graphic->generateXml($offset." ");
+ $temp .= $offset."</PointSymbolizer>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black; width:100%;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 130px;\">\n";
+ $temp .= $offset." PointSymbolizer<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"pointsymbolizer\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ if ($this->graphic != "")
+ {
+ $temp .= $this->graphic->generateHtmlForm($id."_graphic", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."Graphic: <a class='edit' href=\"sld_function_handler.php?function=addgraphic&id=".$this->id."\">Graphic hinzufügen</a>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_graphic"]))
+ {
+ $this->graphic = new Graphic();
+ $this->graphic->generateObjectFromPost($id."_graphic");
+ }
+ }
+
+ /**
+ * Function that creates a new Graphic object.
+ *
+ * Not sure if this function is neccessary / in use!
+ */
+ function addGraphic()
+ {
+ $this->graphic = new Graphic();
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/PolygonSymbolizer.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/PolygonSymbolizer.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/PolygonSymbolizer.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,133 @@
+<?php
+/**
+ * Implementation of the PolygonSymbolizer-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class PolygonSymbolizer extends Rule
+{
+ /**
+ * The Fill object from the xml-scheme.
+ *
+ * @see Fill
+ * @var object
+ */
+ var $fill = "";
+
+ /**
+ * The Stroke object from the xml-scheme.
+ *
+ * @see Stroke
+ * @var object
+ */
+ var $stroke = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+
+ function PolygonSymbolizer()
+ {
+ //$this->fill = new Fill();
+ //$this->stroke = new Stroke();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<PolygonSymbolizer>\n";
+ if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
+ if ($this->stroke != "") $temp .= $this->stroke->generateXml($offset." ");
+ $temp .= $offset."</PolygonSymbolizer>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black; width:100%;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 130px;\">\n";
+ $temp .= $offset." PolygonSymbolizer<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"polygonsymbolizer\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ if ($this->fill != "")
+ {
+ $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
+ }
+ if ($this->stroke != "")
+ {
+ $temp .= $this->stroke->generateHtmlForm($id."_stroke", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addstroke&id=".$this->id."\">Stroke hinzufügen</a>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_fill"]))
+ {
+ $this->fill = new Fill();
+ $this->fill->generateObjectFromPost($id."_fill");
+ }
+ if (isset($_REQUEST[$id."_stroke"]))
+ {
+ $this->stroke = new Stroke();
+ $this->stroke->generateObjectFromPost($id."_stroke");
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/PropertyIsBetween.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/PropertyIsBetween.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/PropertyIsBetween.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,134 @@
+<?php
+/**
+ * Implementation of the PropertyIsBetween-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class PropertyIsBetween
+{
+ /**
+ * The property name
+ * @var string
+ */
+ var $ogcPropertyName = "";
+
+ /**
+ * The lower boundary for this property
+ * @var float
+ */
+ var $upperBoundary = "";
+
+ /**
+ * The upper boundary for this property
+ * @var float
+ */
+ var $lowerBoundary = "";
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ogc:PropertyIsBetween>\n";
+ $temp .= $offset." <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
+ $temp .= $offset." <ogc:LowerBoundary><ogc:Literal>".$this->lowerBoundary."</ogc:Literal></ogc:LowerBoundary>\n";
+ $temp .= $offset." <ogc:UpperBoundary><ogc:Literal>".$this->upperBoundary."</ogc:Literal></ogc:UpperBoundary>\n";
+ $temp .= $offset."</ogc:PropertyIsBetween>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"propertyIsBetween\">\n";
+ $temp .= $offset." PropertyName\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width: 50px; text-align: center; font-size: large;\">=</td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." LowerBoundary\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width: 50px; text-align: center; font-size: large;\">=</td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_lowerboundary\" value=\"".$this->lowerBoundary."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." UpperBoundary\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width: 50px; text-align: center; font-size: large;\">=</td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_upperboundary\" value=\"".$this->upperBoundary."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
+ $this->lowerBoundary = $_REQUEST[$id."_lowerboundary"];
+ $this->upperBoundary = $_REQUEST[$id."_upperboundary"];
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/PropertyIsLike.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/PropertyIsLike.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/PropertyIsLike.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Implementation of the PropertyIsLike-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class PropertyIsLike
+{
+ /**
+ * wildcard attribute
+ * @var string
+ */
+ var $wildCard = "*";
+
+ /**
+ * singleChar attribute
+ * @var string
+ */
+ var $singleChar = "#";
+
+ /**
+ * escape character attribute
+ * @var string
+ */
+ var $escape = "!";
+
+ /**
+ * Name of the Property
+ * @var string
+ */
+ var $ogcPropertyName = "";
+
+ /**
+ * Regular Expression using the above variables as escape + ... chars.
+ * @var string
+ */
+ var $ogcLiteral = "";
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ogc:PropertyIsLike";
+ $temp .= " wildCard=\"".$this->wildCard."\"";
+ $temp .= " singleChar=\"".$this->singleChar."\"";
+ $temp .= " escape=\"".$this->escape."\"";
+ $temp .= ">\n";
+ $temp .= $offset. " <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
+ $temp .= $offset. " <ogc:Literal>".$this->ogcLiteral."</ogc:Literal>\n";
+ $temp .= $offset."</ogc:PropertyIsLike>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"2\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"propertyIsLike\">\n";
+ $temp .= $offset." WildCard\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_wildcard\" value=\"".$this->wildCard."\">";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td> </td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"2\">\n";
+ $temp .= $offset." singleChar\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_singlechar\" value=\"".$this->singleChar."\">";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td> </td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td colspan=\"2\">\n";
+ $temp .= $offset." Escape\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_escape\" value=\"".$this->escape."\">";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td> </td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width:50px; text-align: center;\">\n";
+ $temp .= $offset." LIKE";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_ogcliteral\" value=\"".$this->ogcLiteral."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">\n";
+ $temp .= $offset." <img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->wildCard = $_REQUEST[$id."_wildcard"];
+ $this->singleChar = $_REQUEST[$id."_singlechar"];
+ $this->escape = $_REQUEST[$id."_escape"];
+ $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
+ $this->ogcLiteral = $_REQUEST[$id."_ogcliteral"];
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/PropertyIsNull.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/PropertyIsNull.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/PropertyIsNull.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Implementation of the PropertyIsNull-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class PropertyIsNull
+{
+ /**
+ * Name of the Property
+ * @var string
+ */
+ var $ogcPropertyName = "";
+
+ /**
+ * String. Not sure was this is used for in ogc:filter.
+ * An "isNull" comparison usually does not require a literal string.
+ * @var string
+ */
+ var $ogcLiteral = "";
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<ogc:PropertyIsNull>\n";
+ $temp .= $offset. " <ogc:PropertyName>".$this->ogcPropertyName."</ogc:PropertyName>\n";
+ $temp .= $offset. " <ogc:Literal>".$this->ogcLiteral."</ogc:Literal>\n";
+ $temp .= $offset."</ogc:PropertyIsNull>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"propertyIsNull\">\n";
+ $temp .= $offset." <input name=\"".$id."_ogcpropertyname\" value=\"".$this->ogcPropertyName."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td style=\"width:50px; text-align: center;\">\n";
+ $temp .= $offset." NULL";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_ogcliteral\" value=\"".$this->ogcLiteral."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
+ $temp .= $offset." <img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->ogcPropertyName = $_REQUEST[$id."_ogcpropertyname"];
+ $this->ogcLiteral = $_REQUEST[$id."_ogcliteral"];
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/RasterSymbolizer.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/RasterSymbolizer.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/RasterSymbolizer.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Implementation of the RasterSymbolizer-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class RasterSymbolizer extends Rule
+{
+ /**
+ * The Opacity element from the xml-scheme.
+ * This element is not implemented as an object.
+ *
+ * @var string
+ */
+ var $opacity = "";
+
+ /**
+ * The ColorMap object from the xml-scheme.
+ *
+ * @see ColorMap
+ * @var object
+ */
+ var $colormap = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+
+ function RasterSymbolizer()
+ {
+ //$this->colormap = new ColorMap();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<RasterSymbolizer>\n";
+ if ($this->opacity != "") $temp .= $offset." <Opacity>".htmlspecialchars($this->opacity)."</Opacity>\n";
+ if ($this->colormap != "") $temp .= $this->colormap->generateXml($offset." ");
+ $temp .= $offset."</RasterSymbolizer>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" style=\"border: 1px solid black;width:100%\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 130px;\">\n";
+
+ $temp .= $offset." RasterSymbolizer<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"rastersymbolizer\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <table>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Opacity:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_opacity\" value=\"".htmlspecialchars($this->opacity)."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ if ($this->colormap != "")
+ {
+ $temp .= $this->colormap->generateHtmlForm($id."_colormap", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td colspan=\"2\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addcolormap&id=".$this->id."\">ColorMap hinzufügen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ }
+ $temp .= $offset." </table>\n";
+
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_opacity"]))
+ {
+ $this->opacity = $_REQUEST[$id."_opacity"];
+ }
+ if (isset($_REQUEST[$id."_colormap"]))
+ {
+ $this->colormap = new ColorMap();
+ $this->colormap->generateObjectFromPost($id."_colormap");
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/Rule.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/Rule.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/Rule.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,360 @@
+<?php
+/**
+ * Implementation of the Rule-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Rule extends FeatureTypeStyle
+{
+ /**
+ * The name attribute from the xml-scheme.
+ * @var string
+ */
+ var $name = "";
+
+ /**
+ * The title attribute from the xml-scheme.
+ * @var string
+ */
+ var $title = "";
+
+ /**
+ * The LegendGraphic element from the xml-scheme.
+ * @see LegendGraphic
+ * @var object
+ */
+ var $legendgraphic = "";
+
+ /**
+ * The complete filter expression.
+ *
+ * The parsing an editing of the filter expressions is not done in the main sld editor.
+ * This field contains the complete filter expression without any parsing.
+ * The parsing is done in sld_filter_parse.php using the classes in sld_filter_classes.php.
+ * Editing is possible in sld_edit_filter.php. This page is opened in a popup-window.
+ *
+ * @see sld_filter_classes.php
+ * @var string
+ */
+ var $filter = "";
+
+ /**
+ * The miscaledenominator attribute from the xml-scheme.
+ * @var int
+ */
+ var $minscaledenominator = "";
+
+ /**
+ * The maxscaledenominator attribute from the xml-scheme.
+ * @var int
+ */
+ var $maxscaledenominator = "";
+
+ /**
+ * Array containing the different symbolizers for this rule.
+ * @var array
+ */
+ var $symbolizers = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Rule>\n";
+ if ($this->name != "") $temp .= $offset." <Name>".htmlspecialchars($this->name)."</Name>\n";
+ if ($this->title != "") $temp .= $offset." <Title>".htmlspecialchars($this->title)."</Title>\n";
+ if ($this->legendgraphic != "") $temp .= $this->legendgraphic->generateXml($offset." ");
+
+ if ($this->filter != "") $temp .= $offset." ".$this->filter."\n";
+ if ($this->minscaledenominator != "") $temp .= $offset." <MinScaleDenominator>".htmlspecialchars($this->minscaledenominator)."</MinScaleDenominator>\n";
+ if ($this->maxscaledenominator != "") $temp .= $offset." <MaxScaleDenominator>".htmlspecialchars($this->maxscaledenominator)."</MaxScaleDenominator>\n";
+ foreach($this->symbolizers as $symbolizer)
+ {
+ $temp .= $symbolizer->generateXml($offset." ");
+ }
+ $temp .= $offset."</Rule>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<td rowspan=\"2\" valign='top'>\n";
+
+ //Table in the first cell for the attributes of this rule
+ ###### -----------> Fenster Rule Eigenschaften
+ $temp .= $offset." <table class='edit_label_bg2' border=\"0\" cellspacing=\"2\" cellpadding=\"1\">\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>\n";
+ $temp .= $offset." Rule:\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"rule\">\n";
+ $temp .= $offset." </td>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>Name:</td>\n";
+ $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_name\" value=\"".htmlspecialchars($this->name)."\"></td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>Title:</td>\n";
+ $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_title\" value=\"".htmlspecialchars($this->title)."\"></td>\n";
+ $temp .= $offset." </tr>\n";
+
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>";
+ $temp .= $offset." Filter:";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_filter\" value=\"".htmlspecialchars($this->filter)."\">\n";
+ $temp .= $offset." <img src='./img/lightning.png' class='hand' border='0' alt='Filter bearbeiten'";
+ $temp .= "onClick=\"window.open('sld_edit_filter.php?sld_form_element_id=".$id."_filter&sld_objects_rule_id=".$this->id."','editFilter',";
+ $temp .= " 'width=1000, height=800, resizable=yes');\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>Minscale:</td>\n";
+ $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_minscale\" value=\"".$this->minscaledenominator."\"></td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td class='edit_label_bg edit_label_text'>Maxscale:</td>\n";
+ $temp .= $offset." <td><input class='inputfield edit_label_text' name=\"".$id."_maxscale\" value=\"".$this->maxscaledenominator."\"></td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deleterule&id=".$this->parent."&number=".$number."\">\n";
+ $temp .= $offset." <img src='./img/minus.gif' border='0' alt='Rule löschen'> löschen\n";
+ $temp .= $offset." </a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." ";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+ //End Table in first cell
+
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."-\n";
+ $temp .= $offset."</td>\n";
+
+
+ $temp .= $offset."<td>\n";
+ //Second cell for the symbolizers and the legendgraphic
+ // Table1 in second cell
+ $temp .= $offset."<table class='edit_label_bg2' border=\"0\" cellspacing=\"2\" cellpadding=\"1\">\n";
+ $temp .= $offset."<tr>\n";
+ ########### -----------> LEGENDGRAPHIC
+ if ($this->legendgraphic != "")
+ {
+ $temp .= $offset."<td>\n";
+ $temp .= $this->legendgraphic->generateHtmlForm($id."_legendgraphic", $offset." ");
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+ else
+ {
+ $temp .= $offset."<td class='edit_label_bg edit_label_text' width='136'>\n";
+ $temp .= $offset."LegendGraphic:\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addlegendgraphic&id=".$this->id."\">\n";
+ $temp .= $offset."<img src='./img/plus.gif' border='0' alt='LegendGraphic hinzufügen'> hinzufügen</a>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset." \n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ }
+ $temp .= $offset."</table>\n";
+ //End Table1 in second cell
+
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td>\n";
+ $temp .= $offset."-\n";
+ $temp .= $offset."</td>\n";
+
+ $temp .= $offset."<td>\n";
+
+ // Table in second cell
+ $temp .= $offset."<table class='edit_label_bg2' border=\"0\" cellspacing=\"2\" cellpadding=\"1\">\n";
+ ########### -----------> SYMBOLIZER
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td class='edit_label_bg edit_label_text' valign='top'>\n";
+ $temp .= $offset." <select class=\"edit_label_text\" name=\"".$id."_newsymbolizer\">\n";
+ $temp .= $offset." <option value=\"textsymbolizer\">Textsymbolizer</option>\n";
+ $temp .= $offset." <option value=\"polygonsymbolizer\">Polygonsymbolizer</option>\n";
+ $temp .= $offset." <option value=\"pointsymbolizer\">Pointsymbolizer</option>\n";
+ $temp .= $offset." <option value=\"rastersymbolizer\">Rastersymbolizer</option>\n";
+ $temp .= $offset." <option value=\"linesymbolizer\">Linesymbolizer</option>\n";
+ $temp .= $offset." </select>\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td>\n";
+ $symbolizer_id = 0;
+ foreach ($this->symbolizers as $symbolizer)
+ {
+ $temp .= $symbolizer->generateHtmlForm($id."_symbolizer_".$symbolizer_id, $offset." ");
+ $symbolizer_id++;
+ }
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset."<td valign='bottom'>\n";
+ $temp .= $offset."<input class=\"edit\" type=\"button\" value=\"hinzufügen\"";
+ //Javascript to make a http request
+ $temp .= " onClick=\"url='sld_function_handler.php?function=addsymbolizer&id=".$this->id."&symbolizer=';";
+ $temp .= " url += ".$id."_newsymbolizer.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">\n";
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ $temp .= $offset."</table>\n";
+ //End Table in second cell
+
+ $temp .= $offset."</td>\n";
+ $temp .= $offset."</tr>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ $this->title = $_REQUEST[$id."_title"];
+
+ $this->filter = $_REQUEST[$id."_filter"];
+
+ $this->minscaledenominator = $_REQUEST[$id."_minscale"];
+ $this->maxscaledenominator = $_REQUEST[$id."_maxscale"];
+ if (isset($_REQUEST[$id."_legendgraphic"]))
+ {
+ $this->legendgraphic = new LegendGraphic();
+ $this->legendgraphic->generateObjectFromPost($id."_legendgraphic");
+ }
+ $countSymbolizers = 0;
+ while (isset($_REQUEST[$id."_symbolizer_".$countSymbolizers]))
+ {
+ $symbolizer = "";
+ if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "linesymbolizer")
+ {
+ $symbolizer = new LineSymbolizer();
+ }
+ else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "polygonsymbolizer")
+ {
+ $symbolizer = new PolygonSymbolizer();
+ }
+ else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "pointsymbolizer")
+ {
+ $symbolizer = new PointSymbolizer();
+ }
+ else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "textsymbolizer")
+ {
+ $symbolizer = new TextSymbolizer();
+ }
+ else if ($_REQUEST[$id."_symbolizer_".$countSymbolizers] == "rastersymbolizer")
+ {
+ $symbolizer = new RasterSymbolizer();
+ }
+
+ $symbolizer->generateObjectFromPost($id."_symbolizer_".$countSymbolizers);
+ $this->symbolizers[] = $symbolizer;
+ $countSymbolizers++;
+ }
+ }
+
+ /**
+ * Function that adds a symbolizer to the symbolizers array.
+ *
+ * This function is called from sld_function_handler.php
+ *
+ * @param string $symbolizer string containing the type of the symbolizer that has to be added
+ */
+ function addSymbolizer($symbolizer)
+ {
+ if ($symbolizer == "linesymbolizer")
+ {
+ $this->symbolizers[] = new LineSymbolizer();
+ }
+ else if ($symbolizer == "textsymbolizer")
+ {
+ $this->symbolizers[] = new TextSymbolizer();
+ }
+ else if ($symbolizer == "polygonsymbolizer")
+ {
+ $this->symbolizers[] = new PolygonSymbolizer();
+ }
+ else if ($symbolizer == "rastersymbolizer")
+ {
+ $this->symbolizers[] = new RasterSymbolizer();
+ }
+ else if ($symbolizer == "pointsymbolizer")
+ {
+ $this->symbolizers[] = new PointSymbolizer();
+ }
+ }
+
+ /**
+ * Deletes the symbolizer at the given index from the symbolizers array.
+ *
+ * This function is called from sld_function_handler.php
+ *
+ * @param int $index index of the symbolizer that should be deleted.
+ */
+ function deleteSymbolizer($index)
+ {
+ array_splice($this->symbolizers, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/Stroke.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/Stroke.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/Stroke.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,184 @@
+<?php
+/**
+ * Implementation of the Stroke-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class Stroke
+{
+ //choice
+ //GraphicFill and GraphicStroke are not supported by Mapserver
+ //var $graphicfill = "";
+ //var $graphicstroke = "";
+ //end choice
+
+ /**
+ * Array containing the CssParameter objects from the xml-scheme.
+ *
+ * @see CssParameter
+ * @var array
+ */
+ var $cssparameters = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<Stroke>\n";
+ //if ($this->graphicfill != "") $temp .= $this->graphicfill->generateXml($offset." ");
+ //if ($this->graphicstroke != "") $temp .= $this->graphicstroke->generateXml($offset." ");
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateXml($offset." ");
+ }
+ $temp .= $offset."</Stroke>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<table>\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td style=\"width: 100px;\">\n";
+ $temp .= $offset." Stroke<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"stroke\">\n";
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=deletestroke&id=".$this->parent."\">löschen</a>\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td valign=\"top\">\n";
+
+// if ($this->graphicfill == "" && $this->graphicstroke == "")
+// {
+// //Add new Graphicfill or Graphicstroke TODO!!!
+// $temp .= $offset."<select name=\"".$id."_newgraphicfillorgraphicstroke\">\n";
+// $temp .= $offset."<option value=\"graphicfill\">GraphicFill</option>\n";
+// $temp .= $offset."<option value=\"graphicstroke\">GraphicStroke</option>\n";
+// $temp .= $offset."</select>\n";
+// $temp .= $offset."<input type=\"button\" value=\"GraphicFill oder GraphicStroke hinzufügen\"";
+// $temp .= $offset." onClick=\"url='sld_function_handler.php?function=addgraphicfillorgraphicstroke&id=".$id."&graphicfillorgraphicstroke=';";
+// $temp .= $offset." url += ".$id."_newgraphicfillorgraphicstroke.value;";
+// $temp .= $offset." location.href = url;\"";
+// $temp .= $offset."><br>\n";
+// }
+// else if ($this->graphicfill != "")
+// {
+// $this->graphicfill->generateHtmlForm($id."_graphicfill");
+// }
+// else if ($this->graphicstroke != "")
+// {
+// $this->graphicstroke->generateHtmlForm($id."_graphicstroke");
+// }
+
+
+ $cssparameter_id = 0;
+ foreach ($this->cssparameters as $cssparameter)
+ {
+ $temp .= $cssparameter->generateHtmlForm($id."_cssparameter_".$cssparameter_id, $offset." ");
+ $cssparameter_id++;
+ }
+
+
+ $temp .= $offset." <select name=\"".$id."_newcssparameter\">\n";
+ //Some of the options are not supported by Mapserver
+ $temp .= $offset." <option value=\"stroke\">stroke</option>\n";
+ $temp .= $offset." <option value=\"stroke-width\">stroke-width</option>\n";
+ $temp .= $offset." <option value=\"stroke-dasharray\">stroke-dasharray</option>\n";
+ $temp .= $offset." </select>\n";
+
+
+ $temp .= $offset." <input type=\"button\" value=\"hinzufügen\"";
+ //Javascript to make a http request
+ $temp .= " onClick=\"url='sld_function_handler.php?function=addcssparameter&id=".$this->id."&cssparameter=';";
+ $temp .= " url += ".$id."_newcssparameter.value;";
+ $temp .= " location.href = url;\"";
+ $temp .= ">\n";
+
+
+
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+// if (isset($_REQUEST[$id."_graphicfill"]))
+// {
+// $this->graphicfill = new GraphicFill();
+// $this->graphicfill->generateObjectFromPost($id."_graphicfill");
+// }
+// if (isset($_REQUEST[$id."_graphicstroke"]))
+// {
+// $this->graphicstroke = new GraphicStroke();
+// $this->graphicstroke->generateObjectFromPost($id."_graphicstroke");
+// }
+ $countCssParameters = 0;
+ while (isset($_REQUEST[$id."_cssparameter_".$countCssParameters]))
+ {
+ $cssParameter = new CssParameter();
+ $cssParameter->generateObjectFromPost($id."_cssparameter_".$countCssParameters);
+ $this->cssparameters[] = $cssParameter;
+ $countCssParameters++;
+ }
+ }
+
+ /**
+ * Adds a new CssParameter to the array.
+ * @param string $cssParameter name attribute of the CssParameter that has to be created.
+ */
+ function addCssParameter($cssParameter)
+ {
+ $newCssParameter = new CssParameter();
+ $newCssParameter->name = $cssParameter;
+ $this->cssparameters[] = $newCssParameter;
+ }
+
+ /**
+ * Deletes a CssParameter from the array at the given index.
+ * @param int $index index of the CssParameter that has to be deleted.
+ */
+ function deleteCssParameter($index)
+ {
+ array_splice($this->cssparameters, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/StyledLayerDescriptor.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/StyledLayerDescriptor.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/StyledLayerDescriptor.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,188 @@
+<?php
+/**
+ * This file contains the class definitions for the sld-editor.
+ *
+ * This class is the implementation of the StyledLayerDescriptor-element of the sld-xml-scheme.
+ * This element builds up the root of every sld-document.
+ * This class is directly referred to in the sld_main.php.
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski, Design for all HTML-output by Bao Ngan
+ */
+class StyledLayerDescriptor
+{
+ /**
+ * The name attribute from the xml-scheme.
+ * @var string
+ */
+ var $name = "";
+ /**
+ * The title attribute from the xml-scheme.
+ * @var string
+ */
+ var $title = "";
+ /**
+ * The abstract attribute from the xml-scheme.
+ * @var string
+ */
+ var $abstract = "";
+ /**
+ * Array containing the layers of the sld.
+ * @see NamedLayer
+ * @var array
+ */
+ var $layers = array();
+ /**
+ * The version attribute from the xml-scheme.
+ * @var string
+ */
+ var $version = "";
+
+ /**
+ * Index of this object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * Generates the sld-document as an xml-string and returns it.
+ *
+ * Calls the generateXml-function of its child objects.
+ * This object only has layers as childs, all other child-elements of
+ * StyledLayerDescriptor are modelled as primitive datatypes
+ *
+ * @param string $offset string that should be added at the beginning
+ * of every line of xml that is being created. Should only contain
+ * a number of whitespaces to format the output and provide a
+ * good readability.
+ *
+ * @return string the created sld-document
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<StyledLayerDescriptor";
+ if ($this->version != "") $temp .= " version=\"".htmlspecialchars($this->version)."\"";
+ $temp .= ">\n";
+ if ($this->name != "") $temp .= $offset." <Name>".htmlspecialchars($this->name)."</Name>\n";
+ if ($this->title != "") $temp .= $offset." <Title>".htmlspecialchars($this->title)."</Title>\n";
+ if ($this->abstract != "") $temp .= $offset." <Abstract>".htmlspecialchars($this->abstract)."</Abstract>\n";
+
+
+ foreach($this->layers as $layer)
+ {
+ $temp .= $layer->generateXml($offset." ");
+ }
+ $temp .= $offset."</StyledLayerDescriptor>\n";
+ return $temp;
+ }
+
+
+ /**
+ * Generates a html-form-fragment
+ * that contains form-elements (e.g. input) for every member of this class.
+ * Some of these are hidden fields and so they are not editable by the user.
+ * The reason for this is that some values should not be changed (such as the layer name)
+ * or they are to complicated for end-users that are not familiar to the sld-xml-scheme.
+ *
+ * Calls the generateHtmlForm-function of its child objects.
+ *
+ * @param string $id string identifying the form-elements belonging to this object
+ * @param string $offset string for formatting the output
+ * @return string the created html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ //Commented out, because these options should not be changed by the end user
+ //$temp .= $offset."<table style=\"border: 1px solid black\">\n";
+ //$temp .= $offset."<tr>\n";
+ //$temp .= $offset."<td>Name:</td>\n";
+ //$temp .= $offset."<td><input name=\"name\" value=\"".$this->name."\"></td>\n";
+ //$temp .= $offset."</tr>\n";
+ //$temp .= $offset."<tr>\n";
+ //$temp .= $offset."<td>Title:</td>\n";
+ //$temp .= $offset."<td><input name=\"title\" value=\"".$this->title."\"></td>\n";
+ //$temp .= $offset."</tr>\n";
+ //$temp .= $offset."<tr>\n";
+ //$temp .= $offset."<td>Abstract:</td>\n";
+ //$temp .= $offset."<td><input name=\"abstract\" value=\"".$this->abstract."\"></td>\n";
+ //$temp .= $offset."</tr>\n";
+ //$temp .= $offset."<tr>\n";
+ //$temp .= $offset."<td>Version:</td>\n";
+ //$temp .= $offset."<td><input name=\"version\" value=\"".$this->version."\"></td>\n";
+ //$temp .= $offset."</tr>\n";
+ //$temp .= $offset."</table>\n";
+ //$temp .= $offset."<br>\n";
+
+ //Hidden fields to hold the values
+ $temp .= $offset."<input type=\"hidden\" name=\"name\" value=\"".htmlspecialchars($this->name)."\">\n";
+ $temp .= $offset."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($this->title)."\">\n";
+ $temp .= $offset."<input type=\"hidden\" name=\"abstract\" value=\"".htmlspecialchars($this->abstract)."\">\n";
+ $temp .= $offset."<input type=\"hidden\" name=\"version\" value=\"".htmlspecialchars($this->version)."\">\n";
+
+ $layer_id = 0;
+ foreach ($this->layers as $layer)
+ {
+ $temp .= $layer->generateHtmlForm("layer_".$layer_id, $offset." ");
+ $layer_id++;
+ }
+ return $temp;
+ }
+
+ /**
+ * Populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ * this parameter has no use for this object, because it is only called without a value
+ * in other classes this parameter should have the same value, that was used in
+ * generateHtmlForm(...) for the $id to create the html-form
+ *
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->version = $_REQUEST[$id."version"];
+ $this->name = $_REQUEST[$id."name"];
+ $this->title = $_REQUEST[$id."title"];
+ $this->abstract = $_REQUEST[$id."abstract"];
+ $countLayers = 0;
+ while (isset($_REQUEST[$id."layer_".$countLayers]))
+ {
+ if ($_REQUEST[$id."layer_".$countLayers] == "namedlayer")
+ {
+ $layer = new NamedLayer();
+ }
+ else
+ {
+ //Todo evtl: userlayer erstellen
+ $layer = new NamedLayer();
+ }
+ $layer->generateObjectFromPost($id."layer_".$countLayers);
+ $this->layers[] = $layer;
+ $countLayers++;
+ }
+ }
+}
+
+/**
+ * Loads classes by name
+ *
+ * If the php interpreter finds a class that is needed in a module or class
+ * and it is not yet included via include, then it tries to load this class
+ * with the given name in the current context. No need for includes ...
+ *
+ * @param string $class_name
+ */
+function __autoload($class_name) {
+ require_once $class_name . '.php';
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/TextSymbolizer.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/TextSymbolizer.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/TextSymbolizer.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,184 @@
+<?php
+/**
+ * Implementation of the TextSymbolizer-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class TextSymbolizer extends Rule
+{
+ /**
+ * The Label element from the xml-scheme.
+ * This element is not implemented as an object.
+ *
+ * @var string
+ */
+ var $label = "";
+
+ /**
+ * The Font object from the xml-scheme.
+ *
+ * @see Font
+ * @var object
+ */
+ var $font = "";
+
+ /**
+ * The Labelplacement object from the xml-scheme.
+ *
+ * @see LabelPlacement
+ * @var object
+ */
+ var $labelplacement = "";
+
+ //Halo is not supported by Mapserver
+ //var $halo = "";
+ //Fill is not supported by Mapserver - only solid color
+ var $fill = "";
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+
+ function TextSymbolizer()
+ {
+ //$this->font = new Font();
+ //$this->labelplacement = new LabelPlacement();
+ //$this->fill = new Fill();
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<TextSymbolizer>\n";
+ if ($this->label != "") $temp .= $offset." <Label>".htmlspecialchars($this->label)."</Label>\n";
+ if ($this->font != "") $temp .= $this->font->generateXml($offset." ");
+ if ($this->labelplacement != "") $temp .= $this->labelplacement->generateXml($offset." ");
+ //if ($this->halo != "") $temp .= $this->halo->generateXml($offset." ");
+ if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
+ $temp .= $offset."</TextSymbolizer>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset= "")
+ {
+ $temp = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" border='1' cellspacing='2' cellpadding='0' style=\"border: 1px solid black; width:100%;\">\n";
+ $temp .= $offset." <tr valign=\"top\">\n";
+ $temp .= $offset." <td class='text' style=\"width: 130px;\">\n";
+ $temp .= $offset." TextSymbolizer<br>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"textsymbolizer\">\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=deletesymbolizer&id=".$this->parent."&number=".$number."\">löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+
+ $temp .= $offset." <table>";
+ $temp .= $offset." <tr>\n";
+ $temp .= $offset." <td style=\"width: 100px\">\n";
+ $temp .= $offset." Label:\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input name=\"".$id."_label\" value=\"".$this->label."\">\n";
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset." </table>\n";
+
+ if ($this->font != "")
+ {
+ $temp .= $this->font->generateHtmlForm($id."_font", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addfont&id=".$this->id."\">Font hinzufügen</a><br>\n";
+ }
+ if ($this->labelplacement != "")
+ {
+ $temp .= $this->labelplacement->generateHtmlForm($id."_labelplacement", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addlabelplacement&id=".$this->id."\">Labelplacement hinzufügen</a><br>\n";
+ }
+ //Halo is not supported - removed from source
+ if ($this->fill != "")
+ {
+ $temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addfill&id=".$this->id."\">Fill hinzufügen</a><br>\n";
+ }
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." </tr>\n";
+ $temp .= $offset."</table>\n";
+ $temp .= $offset."<br>\n";
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ if (isset($_REQUEST[$id."_label"]))
+ {
+ $this->label = $_REQUEST[$id."_label"];
+ }
+ if (isset($_REQUEST[$id."_font"]))
+ {
+ $this->font = new Font();
+ $this->font->generateObjectFromPost($id."_font");
+ }
+ if (isset($_REQUEST[$id."_labelplacement"]))
+ {
+ $this->labelplacement = new LabelPlacement();
+ $this->labelplacement->generateObjectFromPost($id."_labelplacement");
+ }
+// if (isset($_REQUEST[$id."_halo"]))
+// {
+// $this->halo = new Halo();
+// $this->halo->generateObjectFromPost($id."_halo");
+// }
+ if (isset($_REQUEST[$id."_fill"]))
+ {
+ $this->fill = new Fill();
+ $this->fill->generateObjectFromPost($id."_fill");
+ }
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/UnaryLogicOp.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/UnaryLogicOp.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/UnaryLogicOp.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,173 @@
+<?php
+/**
+ * Implementation of the UnaryLogicOp-element
+ *
+ * @package filter_classes
+ * @author Markus Krzyzanowski
+ */
+class UnaryLogicOp
+{
+ /**
+ * Defines the type of logical operation.
+ * Possible value: not
+ * @var string
+ */
+ var $name = "";
+
+ /**
+ * Array containing the operations of this filter
+ * @see UnaryLogicOp
+ * @see BinaryLogicOp
+ * @see BinaryComparisonOp
+ * @see PropertyIsLike
+ * @see PropertyIsNull
+ * @see PropertyIsBetween
+ * @var array
+ */
+ var $operations = array();
+
+ /**
+ * Index of this object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $id = "";
+
+ /**
+ * Index of this object's parent object in the $_SESSION("sld_filter_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * constructor tha directly fills the $name variable
+ * @param string $name the type of this logical operation
+ */
+ function UnaryLogicOp($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<".$this->name.">\n";
+ foreach($this->operations as $operation)
+ {
+ $temp .= $operation->generateXml($offset." ");
+ }
+ $temp .= $offset."</".$this->name.">\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id = "", $offset = "")
+ {
+ $temp = "";
+
+ $temp .= $offset."<tr>\n";
+ $temp .= $offset." <td>\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."\" value=\"unaryLogicOp\">\n";
+ $temp .= $offset." <input type=\"hidden\" name=\"".$id."_name\" value=\"".$this->name."\">\n";
+ $temp .= $offset." ".$this->name."<br>\n";
+
+ $number = split("_", $id);
+ $number = $number[count($number)-1];
+ $temp .= $offset." <a class=\"edit\" href=\"?function=deleteoperation&id=".$this->parent."&number=".$number."\">";
+ $temp .= "<img src='./img/minus.gif' border='0'> löschen</a>\n";
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset." <td colspan=\"3\" valign=\"top\">\n";
+ //Only 1 operation
+ if (count($this->operations) < 1)
+ {
+ $addOperationModule = new AddOperationModule($this->id, $id);
+ $temp .= $addOperationModule->generateHtmlForm($offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <table>\n";
+ $displayOperationModule = new DisplayOperationModule();
+ $temp .= $displayOperationModule->generateHtmlForm($offset." ", $this->operations, $id);
+ $temp .= $offset." </table>\n";
+ }
+
+ $temp .= $offset." </td>\n";
+ $temp .= $offset."</tr>\n";
+
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $this->name = $_REQUEST[$id."_name"];
+ $countOperations = 0;
+ while (isset($_REQUEST[$id."_operation_".$countOperations]))
+ {
+ if ($_REQUEST[$id."_operation_".$countOperations] == "binaryComparisonOp")
+ {
+ $operation = new BinaryComparisonOp();
+ }
+// if ($_REQUEST[$id."_operation_".$countOperations] == "unaryComparisonOp")
+// {
+// $operation = new UnaryComparisonOp();
+// }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "binaryLogicOp")
+ {
+ $operation = new BinaryLogicOp();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "unaryLogicOp")
+ {
+ $operation = new UnaryLogicOp();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsLike")
+ {
+ $operation = new PropertyIsLike();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsNull")
+ {
+ $operation = new PropertyIsNull();
+ }
+ if ($_REQUEST[$id."_operation_".$countOperations] == "propertyIsBetween")
+ {
+ $operation = new PropertyIsBetween();
+ }
+ $operation->generateObjectFromPost($id."_operation_".$countOperations);
+ $this->operations[] = $operation;
+ $countOperations++;
+ }
+ }
+
+ /**
+ * deletes the rule with the given index from the $operations array
+ * @param int $index index of the operation that has to be deleted
+ */
+ function deleteOperation($index)
+ {
+ array_splice($this->operations, $index, 1);
+ }
+}
+?>
\ No newline at end of file
Added: branches/mapbender_sld/http/classes/sld/UserStyle.php
===================================================================
--- branches/mapbender_sld/http/classes/sld/UserStyle.php (rev 0)
+++ branches/mapbender_sld/http/classes/sld/UserStyle.php 2007-07-12 15:35:16 UTC (rev 1485)
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Implementation of the UserStyle-element
+ *
+ * @package sld_classes
+ * @author Markus Krzyzanowski
+ */
+class UserStyle extends NamedLayer
+{
+ /**
+ * Array containing the FeatureTypeStyle-objects.
+ *
+ * @see FeatureTypeStyle
+ * @var string
+ */
+ var $featuretypestyles = array();
+
+ /**
+ * Index identifying the object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $id = "";
+ /**
+ * Index identifying the object's parent object in the $_SESSION("sld_objects") array.
+ * @var int
+ */
+ var $parent = "";
+
+ /**
+ * creates the xml for this object and its child objects
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the xml-fragment
+ */
+ function generateXml($offset = "")
+ {
+ $temp = $offset."<UserStyle>\n";
+ foreach($this->featuretypestyles as $style)
+ {
+ $temp .= $style->generateXml($offset." ");
+ }
+ $temp .= $offset."</UserStyle>\n";
+ return $temp;
+ }
+
+ /**
+ * creates the html-form-fragment for this object
+ *
+ * @param $id string containing a prefix that should be used to identify this
+ * object's html fields. This must be done, so that the generateObjectFromPost(...)
+ * function can address the fields belonging to this object in the http-post.
+ *
+ * @param string $offset string used for formatting the output
+ * @return string containing the html-form-fragment
+ */
+ function generateHtmlForm($id, $offset = "")
+ {
+ $temp = "";
+ $temp .= $offset."<input type=\"hidden\" name=\"".$id."\" value=\"userstyle\">\n";
+ $featuretypestyle_id = 0;
+ foreach ($this->featuretypestyles as $featuretypestyle)
+ {
+ $temp .= $featuretypestyle->generateHtmlForm($id."_featuretypestyle_".$featuretypestyle_id, $offset);
+ $featuretypestyle_id++;
+ }
+ return $temp;
+ }
+
+ /**
+ * populates the member fields of a new object from the data in the http-post-request
+ * to rebuild the object after the submission of the html-form.
+ *
+ * creates its own child objects from the post parameters and calls their
+ * generateObjectFromPost(...) function
+ *
+ * @param string $id string that contains a prefix for the html-form-fields
+ * that is common to all of the fields belonging to this object
+ */
+ function generateObjectFromPost($id = "")
+ {
+ $countFeatureTypeStyles = 0;
+ while (isset($_REQUEST[$id."_featuretypestyle_".$countFeatureTypeStyles]))
+ {
+ $featuretypestyle = new FeatureTypeStyle();
+ $featuretypestyle->generateObjectFromPost($id."_featuretypestyle_".$countFeatureTypeStyles);
+ $this->featuretypestyles[] = $featuretypestyle;
+ $countFeatureTypeStyles++;
+ }
+ }
+}
+
+?>
\ No newline at end of file
More information about the Mapbender_commits
mailing list