From: Robert Kaiser Date: Sun, 8 Mar 2015 23:09:58 +0000 (+0100) Subject: add appendComment() methods so we can add comments in an easy fashion X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=commitdiff_plain;h=cadc5980a5f1769114b3f9235442b19a970a8be2 add appendComment() methods so we can add comments in an easy fashion --- diff --git a/include/cbsm/util/document.php-class b/include/cbsm/util/document.php-class index 5863785..8f6c6cf 100755 --- a/include/cbsm/util/document.php-class +++ b/include/cbsm/util/document.php-class @@ -94,6 +94,10 @@ class ExtendedDocument extends DOMDocument { // appends a DOMDocument::createTextNode() as a child of this document (see there for params) // returns the new child // + // function appendComment($comment_data) + // appends a DOMDocument::createComment() as a child of this document (see there for params) + // returns the new child + // // function appendHTMLMarkup($htmldata, [$parentNode]) // appends a representation of the HTML data as children of the given parent node, by default this document // NO return value! @@ -216,6 +220,9 @@ class ExtendedDocument extends DOMDocument { function appendText($text) { return $this->appendChild($this->createTextNode($text)); } + function appendComment($comment_data) { + return $this->appendChild($this->createComment($comment_data)); + } function appendJSElement($jsdata) { $this->appendChild($this->createElementJS($jsdata)); } @@ -423,6 +430,10 @@ class ExtendedElement extends DOMElement { // appends a DOMDocument::createTextNode() as a child of this element (see there for params) // returns the new child // + // function appendComment($comment_data) + // appends a DOMDocument::createComment() as a child of this element (see there for params) + // returns the new child + // // function appendHTMLMarkup($htmldata) // appends a representation of the HTML data as children of this element // NO return value! @@ -487,6 +498,9 @@ class ExtendedElement extends DOMElement { function appendText($text) { return $this->appendChild($this->ownerDocument->createTextNode($text)); } + function appendComment($comment_data) { + return $this->appendChild($this->ownerDocument->createComment($comment_data)); + } function appendHTMLMarkup($htmldata) { $this->ownerDocument->appendHTMLMarkup($htmldata, $this); } @@ -566,6 +580,10 @@ class ExtendedDocumentFragment extends DOMDocumentFragment { // appends a DOMDocument::createTextNode() as a child of this fragment (see there for params) // returns the new child // + // function appendComment($comment_data) + // appends a DOMDocument::createComment() as a child of this fragment (see there for params) + // returns the new child + // // function appendHTMLMarkup($htmldata) // appends a representation of the HTML data as children of this fragment // NO return value! @@ -630,6 +648,9 @@ class ExtendedDocumentFragment extends DOMDocumentFragment { function appendText($text) { return $this->appendChild($this->ownerDocument->createTextNode($text)); } + function appendComment($comment_data) { + return $this->appendChild($this->ownerDocument->createComment($comment_data)); + } function appendHTMLMarkup($htmldata) { $this->ownerDocument->appendHTMLMarkup($htmldata, $this); }