attrs[$name] = $array; } /** * creates the xml for this object and its child objects * * @param string $offset string used for formatting the output * @return string containing the xml-fragment */ function generateXml($offset = "") { $temp = $offset."\n"; foreach($this->rules as $rule) { $temp .= $rule->generateXml($offset." "); } $temp .= $offset."\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."\n"; $temp .= $offset."\n"; $rule_id = 0; foreach ($this->rules as $rule) { $temp .= $offset." \n"; $temp .= $rule->generateHtmlForm($id."_rule_".$rule_id, $offset." "); $rule_id++; $temp .= $offset." \n"; $temp .= $offset."\n"; $temp .= $offset."\n"; $temp .= $offset."\n"; } $temp .= $offset."\n"; $temp .= $offset."\n"; $temp .= $offset."\n"; $temp .= $offset."
\n"; $temp .= $offset."
\n"; $temp .= $offset."
\n"; $temp .= $offset."\n"; $temp .= $offset."\n"; $temp .= $offset."\n"; $temp .= $offset."\n"; $temp .= $offset."
\n"; $temp .= $offset."id."\">\n"; $temp .= $offset."Rule hinzuf�gen hinzufügen\n"; $temp .= $offset."\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 = "") { $countRules = 0; while (isset($_REQUEST[$id."_rule_".$countRules])) { $rule = new Rule(); $rule->generateObjectFromPost($id."_rule_".$countRules); $this->rules[] = $rule; $countRules++; } } /** * adds a new Rule object to the $rules array * * this function is called from sld_function_handler.php */ function addRule() { $this->rules[] = new Rule(); } /** * deletes the rule with the given index from the $rules array * * this function is called from sld_function_handler.php * * @param int $index index of the rule that has to be deleted */ function deleteRule($index) { array_splice($this->rules, $index, 1); } /** * generates html with the fts elements to choose from, useful for Label, Filter, etc. * * @param string $field string that holds the id of the form field where to return the selected value * * @param string $value string that holds the name of an already used element name * * @return string html-fragment that lists the elements, each can be clicked and the name is * returned to the form field */ final function generateElementsHtml($field,$value) { $html = ""; if ($this->attrs) { $html .= "\n"; } return $html; } } ?>