\n"; foreach($this->operations as $operation) { $temp .= $operation->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." \n"; $temp .= $offset." \n"; $temp .= $offset." \n"; $temp .= $offset." \n"; $displayOperationModule = new DisplayOperationModule(); $temp .= $displayOperationModule->generateHtmlForm($offset." ", $this->operations, $id); if (count($this->operations) == 0) { $temp .= $offset." \n"; $temp .= $offset." \n"; $temp .= $offset." \n"; } $temp .= $offset."
\n"; $temp .= $offset." Filter:
\n"; $temp .= $offset." "; $temp .= " löschen\n"; $temp .= $offset."
\n"; $temp .= $offset."  \n"; $temp .= $offset."
\n"; $addOperationModule = new AddOperationModule($this->id, $id); $temp .= $addOperationModule->generateHtmlForm($offset." "); $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 = "") { $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); } } ?>