X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=blobdiff_plain;f=include%2Fcbsm%2Futil%2Fdocument.php-class;h=8f6c6cff7916bbf3a4de2682ed1a2fcd61a48720;hp=e641d23c56364fec3610153d65803280cf03c726;hb=cadc5980a5f1769114b3f9235442b19a970a8be2;hpb=f88289d7985a04283afff5cdaa81b0cd5449091e diff --git a/include/cbsm/util/document.php-class b/include/cbsm/util/document.php-class index e641d23..8f6c6cf 100755 --- a/include/cbsm/util/document.php-class +++ b/include/cbsm/util/document.php-class @@ -46,6 +46,10 @@ class ExtendedDocument extends DOMDocument { // appends an ExtendedDocument::createElementLink() as a child of this document (see there for params) // returns the new child // + // function appendImage($src, [$alt_text]) + // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params) + // returns the new child + // // function appendFormDiv($action, $method, $name) // appends an ExtendedDocument::createElementForm() as a child of this document (see there for params) // returns an HTML
that is a child of the new child @@ -90,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! @@ -109,6 +117,9 @@ class ExtendedDocument extends DOMDocument { // function createElementLink($target, [$value]) // returns an ExtendedElement that is an HTML with the given target (href) and (optional) value // + // function createElementImage($src, [$alt_text]) + // returns an ExtendedElement that is an HTML with the given (src) and alt attributes (set to '' by default) + // // function createElementForm($action, $method, $name) // returns an ExtendedElement that is an HTML
that is a child of an HTML
// with the given action, method, and name @@ -172,6 +183,9 @@ class ExtendedDocument extends DOMDocument { function appendLink($target, $value = '') { return $this->appendChild($this->createElementLink($target, $value)); } + function appendImage($src, $alt_text = '') { + return $this->appendChild($this->createElementImage($src, $alt_text)); + } function appendFormDiv($action, $method, $name) { $formelem = $this->appendChild($this->createElementForm($action, $method, $name)); return $formelem->appendElement('div'); @@ -206,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)); } @@ -237,6 +254,13 @@ class ExtendedDocument extends DOMDocument { return $link; } + function createElementImage($src, $alt_text = '') { + $link = $this->createElement('img'); + $link->setAttribute('src', $src); + $link->setAttribute('alt', $alt_text); + return $link; + } + function createElementForm($action, $method, $name) { $formelem = $this->createElement('form'); $formelem->setAttribute('action', $action); @@ -358,6 +382,10 @@ class ExtendedElement extends DOMElement { // appends an ExtendedDocument::createElementLink() as a child of this element (see there for params) // returns the new child // + // function appendImage($src, [$alt_text]) + // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params) + // returns the new child + // // function appendFormDiv($action, $method, $name) // appends an ExtendedDocument::createElementForm() as a child of this element (see there for params) // returns an HTML
that is a child of the new child @@ -402,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! @@ -429,6 +461,9 @@ class ExtendedElement extends DOMElement { function appendLink($target, $value = '') { return $this->appendChild($this->ownerDocument->createElementLink($target, $value)); } + function appendImage($src, $alt_text = '') { + return $this->appendChild($this->ownerDocument->createElementImage($src, $alt_text)); + } function appendFormDiv($action, $method, $name) { $formelem = $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name)); return $formelem->appendElement('div'); @@ -463,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); } @@ -494,6 +532,10 @@ class ExtendedDocumentFragment extends DOMDocumentFragment { // appends an ExtendedDocument::createElementLink() as a child of this fragment (see there for params) // returns the new child // + // function appendImage($src, [$alt_text]) + // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params) + // returns the new child + // // function appendFormDiv($action, $method, $name) // appends an ExtendedDocument::createElementForm() as a child of this fragment (see there for params) // returns an HTML
that is a child of the new child @@ -538,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! @@ -565,6 +611,9 @@ class ExtendedDocumentFragment extends DOMDocumentFragment { function appendLink($target, $value = '') { return $this->appendChild($this->ownerDocument->createElementLink($target, $value)); } + function appendImage($src, $alt_text = '') { + return $this->appendChild($this->ownerDocument->createElementImage($src, $alt_text)); + } function appendFormDiv($action, $method, $name) { $formelem = $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name)); return $formelem->appendElement('div'); @@ -599,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); }