X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=blobdiff_plain;f=classes%2Fdocument.php-class;h=e98d292a134c8f256c5c60f6c6f0ea3372b5fb5e;hp=be9d1502ec1e58805329dc14b613f6fdce4f8b00;hb=da8e7efd5f6301bb07ac205f8dae87b6a25dcf43;hpb=f887cdcbbd6e0442cfa2e8971135efb67d12ab52
diff --git a/classes/document.php-class b/classes/document.php-class
index be9d150..e98d292 100755
--- a/classes/document.php-class
+++ b/classes/document.php-class
@@ -101,6 +101,10 @@ class ExtendedDocument extends DOMDocument {
// appends a DOMDocument::createTextNode() as a child of this document (see there for params)
// returns the new child
//
+ // public function appendLinebreak()
+ // appends a
as a child of this document
+ // returns the new child
+ //
// public function appendEntity($name)
// appends a DOMDocument::createEntityReference() as a child of this document (see there for params)
// returns the new child
@@ -284,6 +288,9 @@ class ExtendedDocument extends DOMDocument {
public function appendText($text) {
return $this->appendChild($this->createTextNode($text));
}
+ public function appendLinebreak() {
+ return $this->appendChild($this->createElement('br'));
+ }
public function appendEntity($name) {
return $this->appendChild($this->createEntityReference($name));
}
@@ -328,7 +335,7 @@ class ExtendedDocument extends DOMDocument {
}
public function createElementLink($target, $value = '') {
- $link = $this->createElement('a', $value);
+ $link = $this->createElement('a', (strlen($value) ? $value : $target));
$link->setAttribute('href', $target); // XXX: take care of & etc. in links
return $link;
}
@@ -589,6 +596,10 @@ class ExtendedElement extends DOMElement {
// appends a DOMDocument::createTextNode() as a child of this element (see there for params)
// returns the new child
//
+ // public function appendLinebreak()
+ // appends a
as a child of this element
+ // returns the new child
+ //
// public function appendEntity($name)
// appends a DOMDocument::createEntityReference() as a child of this element (see there for params)
// returns the new child
@@ -689,6 +700,9 @@ class ExtendedElement extends DOMElement {
public function appendText($text) {
return $this->appendChild($this->ownerDocument->createTextNode($text));
}
+ public function appendLinebreak() {
+ return $this->appendChild($this->ownerDocument->createElement('br'));
+ }
public function appendEntity($name) {
return $this->appendChild($this->ownerDocument->createEntityReference($name));
}
@@ -811,6 +825,10 @@ class ExtendedDocumentFragment extends DOMDocumentFragment {
// appends a DOMDocument::createTextNode() as a child of this fragment (see there for params)
// returns the new child
//
+ // public function appendLinebreak()
+ // appends a
as a child of this fragment
+ // returns the new child
+ //
// public function appendEntity($name)
// appends a DOMDocument::createEntityReference() as a child of this fragment (see there for params)
// returns the new child
@@ -901,6 +919,9 @@ class ExtendedDocumentFragment extends DOMDocumentFragment {
public function appendText($text) {
return $this->appendChild($this->ownerDocument->createTextNode($text));
}
+ public function appendLinebreak() {
+ return $this->appendChild($this->ownerDocument->createElement('br'));
+ }
public function appendEntity($name) {
return $this->appendChild($this->ownerDocument->createEntityReference($name));
}