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."name.">\n"; $temp .= $offset. " ".$this->ogcPropertyName."\n"; $temp .= $offset. " ".$this->ogcLiteral."\n"; $temp .= $offset."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."\n"; $temp .= $offset." \n"; $temp .= $offset." \n"; $temp .= $offset." name."\">\n"; if (count($_SESSION["sld_objects"][3]->attrs)>0) { $temp .= $offset." ogcPropertyName."\">\n"; $temp_elements = $_SESSION["sld_objects"][3]->generateElementsHtml($id."_ogcpropertyname",$this->ogcPropertyName); $temp .= $offset.$temp_elements; } else { $temp .= $offset." ogcPropertyName."\">\n"; } $temp .= $offset." \n"; $temp .= $offset." "; switch($this->name) { case "PropertyIsEqualTo": $temp .= "="; break; case "PropertyIsNotEqualTo": $temp .= "!="; break; case "PropertyIsGreaterThan": $temp .= ">"; break; case "PropertyIsGreaterThanOrEqualTo": $temp .= ">="; break; case "PropertyIsLessThan": $temp .= "<"; break; case "PropertyIsLessThanOrEqualTo": $temp .= "<="; break; default: $temp .= $this->name; } $temp .= "\n"; $temp .= $offset." \n"; $temp .= $offset." \n"; $temp .= $offset." ogcLiteral."\">\n"; $temp .= $offset." \n"; $temp .= $offset." \n"; $number = split("_", $id); $number = $number[count($number)-1]; $temp .= $offset." parent."&number=".$number."\">"; $temp .= " löschen\n"; $temp .= $offset." \n"; $temp .= $offset."\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"]; } } ?>