\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."\n"; return $temp; } /** * creates the html-form-fragment for this object * * @param $id string containing a prefix that should be used to identify this * object's html fields. This must be done, so that the generateObjectFromPost(...) * function can address the fields belonging to this object in the http-post. * * @param string $offset string used for formatting the output * @return string containing the html-form-fragment */ function generateHtmlForm($id, $offset = "") { $temp = $offset."
\n"; $temp .= $offset."\n"; $temp .= $offset." \n"; $temp .= $offset." \n"; $temp .= $offset." \n"; $temp .= $offset."
\n"; $temp .= $offset." Stroke
\n"; $temp .= $offset." \n"; $temp .= $offset." parent."\">löschen\n"; $temp .= $offset."
\n"; // if ($this->graphicfill == "" && $this->graphicstroke == "") // { // //Add new Graphicfill or Graphicstroke TODO!!! // $temp .= $offset."\n"; // $temp .= $offset."
\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." \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 = "") { // 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); } } ?>