\n"; foreach ($this->colormapentries as $colormapentry) { $temp .= $colormapentry->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 = ""; $temp .= $offset."\n"; $temp .= $offset." \n"; $temp .= $offset." ColorMap
\n"; $temp .= $offset." \n"; $temp .= $offset." parent."\">löschen\n"; $temp .= $offset." \n"; $temp .= $offset." \n"; $colormapentry_id = 0; foreach ($this->colormapentries as $colormapentry) { $temp .= $colormapentry->generateHtmlForm($id."_colormapentry_".$colormapentry_id, $offset." "); $colormapentry_id++; } $temp .= $offset." id."\">ColorMapEntry hinzufügen\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 = "") { $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); } } ?>