projects
/
php-utility-classes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
61cc8aa
)
add email input and JS script tags pointing to files, return element from appendCOMEl...
author
Robert Kaiser
<kairo@kairo.at>
Mon, 24 Oct 2016 01:56:00 +0000
(
03:56
+0200)
committer
Robert Kaiser
<kairo@kairo.at>
Mon, 24 Oct 2016 01:56:00 +0000
(
03:56
+0200)
include/cbsm/util/document.php-class
patch
|
blob
|
blame
|
history
diff --git
a/include/cbsm/util/document.php-class
b/include/cbsm/util/document.php-class
index 475f2c4ae91e35811c91b398c10d89bf50d48ba0..32d4e3ee23a715d281353d11f0b1c04024563e07 100755
(executable)
--- a/
include/cbsm/util/document.php-class
+++ b/
include/cbsm/util/document.php-class
@@
-68,6
+68,10
@@
class ExtendedDocument extends DOMDocument {
// appends an ExtendedDocument::createElementInputNumber() as a child of this document (see there for params)
// returns the new child
//
// appends an ExtendedDocument::createElementInputNumber() as a child of this document (see there for params)
// returns the new child
//
+ // public function appendInputEmail($name, $maxlength, $size, [$id], [$value])
+ // appends an ExtendedDocument::createElementInputEmail() as a child of this document (see there for params)
+ // returns the new child
+ //
// public function appendInputPassword($name, $maxlength, $size, [$id], [$value])
// appends an ExtendedDocument::createElementInputPassword() as a child of this document (see there for params)
// returns the new child
// public function appendInputPassword($name, $maxlength, $size, [$id], [$value])
// appends an ExtendedDocument::createElementInputPassword() as a child of this document (see there for params)
// returns the new child
@@
-128,6
+132,10
@@
class ExtendedDocument extends DOMDocument {
// appends an ExtendedDocument::createElementJS() as a child of this document (see there for params)
// NO return value!
//
// appends an ExtendedDocument::createElementJS() as a child of this document (see there for params)
// NO return value!
//
+ // public function appendJSFile($jsURL)
+ // appends an ExtendedDocument::createElementJSFile() as a child of this document (see there for params)
+ // returns the new child
+ //
// public function appendCOMElement($module, $attributes)
// appends an ExtendedDocument::createCOMElement() as a child of this document (see there for params)
// returns the new child
// public function appendCOMElement($module, $attributes)
// appends an ExtendedDocument::createCOMElement() as a child of this document (see there for params)
// returns the new child
@@
-153,6
+161,10
@@
class ExtendedDocument extends DOMDocument {
// returns an ExtendedElement that is an HTML <input> of type 'number' with the given name, maxlength, size,
// and optionally id and value
//
// returns an ExtendedElement that is an HTML <input> of type 'number' with the given name, maxlength, size,
// and optionally id and value
//
+ // public function createElementInputEmail($name, $maxlength, $size, [$id], [$value])
+ // returns an ExtendedElement that is an HTML <input> of type 'email' with the given name, maxlength, size,
+ // and optionally id and value
+ //
// public function createElementInputPassword($name, $maxlength, $size, [$id], [$value])
// returns an ExtendedElement that is an HTML <input> of type 'password' with the given name, maxlength, size,
// and optionally id and value
// public function createElementInputPassword($name, $maxlength, $size, [$id], [$value])
// returns an ExtendedElement that is an HTML <input> of type 'password' with the given name, maxlength, size,
// and optionally id and value
@@
-192,6
+204,9
@@
class ExtendedDocument extends DOMDocument {
// public function createElementJS($jsdata)
// returns an ExtendedElement that is an HTML <script> of JavaScript type with the JS data inside
//
// public function createElementJS($jsdata)
// returns an ExtendedElement that is an HTML <script> of JavaScript type with the JS data inside
//
+ // public function createElementJSFile($jsURL)
+ // returns an ExtendedElement that is an HTML <script> of JavaScript type linking to the file given by the URL
+ //
// public function createCOMElement($module, $attributes)
// returns an ExtendedElement that is in COM_NS namespace, with the given module as name and the
// given name=>value array as attributes
// public function createCOMElement($module, $attributes)
// returns an ExtendedElement that is in COM_NS namespace, with the given module as name and the
// given name=>value array as attributes
@@
-251,6
+266,9
@@
class ExtendedDocument extends DOMDocument {
public function appendInputNumber($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->createElementInputNumber($name, $maxlength, $size, $id, $value));
}
public function appendInputNumber($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->createElementInputNumber($name, $maxlength, $size, $id, $value));
}
+ public function appendInputEmail($name, $maxlength, $size, $id = null, $value = null) {
+ return $this->appendChild($this->createElementInputEmail($name, $maxlength, $size, $id, $value));
+ }
public function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->createElementInputPassword($name, $maxlength, $size, $id, $value));
}
public function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->createElementInputPassword($name, $maxlength, $size, $id, $value));
}
@@
-290,8
+308,11
@@
class ExtendedDocument extends DOMDocument {
public function appendJSElement($jsdata) {
$this->appendChild($this->createElementJS($jsdata));
}
public function appendJSElement($jsdata) {
$this->appendChild($this->createElementJS($jsdata));
}
+ public function appendJSFile($jsdata) {
+ return $this->appendChild($this->createElementJSFile($jsdata));
+ }
public function appendCOMElement($module, $attributes) {
public function appendCOMElement($module, $attributes) {
-
$this->appendChild($this->ownerDocument
->createCOMElement($module, $attributes));
+
return $this->appendChild($this
->createCOMElement($module, $attributes));
}
public function appendHTMLMarkup($htmldata, $parentNode = null) {
}
public function appendHTMLMarkup($htmldata, $parentNode = null) {
@@
-371,6
+392,17
@@
class ExtendedDocument extends DOMDocument {
return $txfield;
}
return $txfield;
}
+ public function createElementInputEmail($name, $maxlength, $size, $id = null, $value = null) {
+ $txfield = $this->createElement('input');
+ $txfield->setAttribute('type', 'email');
+ if (!is_null($id)) { $txfield->setAttribute('id', $id); }
+ $txfield->setAttribute('name', $name);
+ $txfield->setAttribute('maxlength', $maxlength);
+ $txfield->setAttribute('size', $size);
+ if (!is_null($value)) { $txfield->setAttribute('value', $value); }
+ return $txfield;
+ }
+
public function createElementInputPassword($name, $maxlength, $size, $id = null, $value = null) {
$pwfield = $this->createElement('input');
$pwfield->setAttribute('type', 'password');
public function createElementInputPassword($name, $maxlength, $size, $id = null, $value = null) {
$pwfield = $this->createElement('input');
$pwfield->setAttribute('type', 'password');
@@
-460,11
+492,20
@@
class ExtendedDocument extends DOMDocument {
public function createElementJS($jsdata) {
$jselem = $this->createElement('script');
public function createElementJS($jsdata) {
$jselem = $this->createElement('script');
+ // Note: type can/should be left out for HTML5.
$jselem->setAttribute('type', 'text/javascript');
$jselem->appendChild($this->createCDATASection($jsdata));
return $jselem;
}
$jselem->setAttribute('type', 'text/javascript');
$jselem->appendChild($this->createCDATASection($jsdata));
return $jselem;
}
+ public function createElementJSFile($jsURL) {
+ $jselem = $this->createElement('script');
+ // Note: type can/should be left out for HTML5.
+ $jselem->setAttribute('type', 'text/javascript');
+ $jselem->setAttribute('src', $jsURL);
+ return $jselem;
+ }
+
public function createCOMElement($module, $attributes) {
$com_elem = $this->createElementNS(COM_NS, $module);
if (is_array($attributes) && count($attributes)) {
public function createCOMElement($module, $attributes) {
$com_elem = $this->createElementNS(COM_NS, $module);
if (is_array($attributes) && count($attributes)) {
@@
-517,6
+558,10
@@
class ExtendedElement extends DOMElement {
// appends an ExtendedDocument::createElementInputNumber() as a child of this element (see there for params)
// returns the new child
//
// appends an ExtendedDocument::createElementInputNumber() as a child of this element (see there for params)
// returns the new child
//
+ // public function appendInputEmail($name, $maxlength, $size, [$id], [$value])
+ // appends an ExtendedDocument::createElementInputEmail() as a child of this element (see there for params)
+ // returns the new child
+ //
// public function appendInputPassword($name, $maxlength, $size, [$id], [$value])
// appends an ExtendedDocument::createElementInputPassword() as a child of this element (see there for params)
// returns the new child
// public function appendInputPassword($name, $maxlength, $size, [$id], [$value])
// appends an ExtendedDocument::createElementInputPassword() as a child of this element (see there for params)
// returns the new child
@@
-580,6
+625,10
@@
class ExtendedElement extends DOMElement {
// public function appendCOMElement($module, $attributes)
// appends an ExtendedDocument::createCOMElement() as a child of this element (see there for params)
// returns the new child
// public function appendCOMElement($module, $attributes)
// appends an ExtendedDocument::createCOMElement() as a child of this element (see there for params)
// returns the new child
+ //
+ // public function appendCOMElement($module, $attributes)
+ // appends an ExtendedDocument::createCOMElement() as a child of this element (see there for params)
+ // returns the new child
public function appendElement($name, $value = '') {
return $this->appendChild($this->ownerDocument->createElement($name, $value));
public function appendElement($name, $value = '') {
return $this->appendChild($this->ownerDocument->createElement($name, $value));
@@
-611,6
+660,9
@@
class ExtendedElement extends DOMElement {
public function appendInputNumber($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputNumber($name, $maxlength, $size, $id, $value));
}
public function appendInputNumber($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputNumber($name, $maxlength, $size, $id, $value));
}
+ public function appendInputEmail($name, $maxlength, $size, $id = null, $value = null) {
+ return $this->appendChild($this->ownerDocument->createElementInputEmail($name, $maxlength, $size, $id, $value));
+ }
public function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value));
}
public function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value));
}
@@
-656,8
+708,11
@@
class ExtendedElement extends DOMElement {
public function appendJSElement($jsdata) {
$this->appendChild($this->ownerDocument->createElementJS($jsdata));
}
public function appendJSElement($jsdata) {
$this->appendChild($this->ownerDocument->createElementJS($jsdata));
}
+ public function appendJSFile($jsdata) {
+ return $this->appendChild($this->ownerDocument->createElementJSFile($jsdata));
+ }
public function appendCOMElement($module, $attributes) {
public function appendCOMElement($module, $attributes) {
- $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));
+
return
$this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));
}
}
}
}
@@
-702,6
+757,10
@@
class ExtendedDocumentFragment extends DOMDocumentFragment {
// appends an ExtendedDocument::createElementInputNumber() as a child of this fragment (see there for params)
// returns the new child
//
// appends an ExtendedDocument::createElementInputNumber() as a child of this fragment (see there for params)
// returns the new child
//
+ // public function appendInputEmail($name, $maxlength, $size, [$id], [$value])
+ // appends an ExtendedDocument::createElementInputEmail() as a child of this fragment (see there for params)
+ // returns the new child
+ //
// public function appendInputPassword($name, $maxlength, $size, [$id], [$value])
// appends an ExtendedDocument::createElementInputPassword() as a child of this fragment (see there for params)
// returns the new child
// public function appendInputPassword($name, $maxlength, $size, [$id], [$value])
// appends an ExtendedDocument::createElementInputPassword() as a child of this fragment (see there for params)
// returns the new child
@@
-765,6
+824,10
@@
class ExtendedDocumentFragment extends DOMDocumentFragment {
// public function appendCOMElement($module, $attributes)
// appends an ExtendedDocument::createCOMElement() as a child of this fragment (see there for params)
// returns the new child
// public function appendCOMElement($module, $attributes)
// appends an ExtendedDocument::createCOMElement() as a child of this fragment (see there for params)
// returns the new child
+ //
+ // public function appendCOMElement($module, $attributes)
+ // appends an ExtendedDocument::createCOMElement() as a child of this fragment (see there for params)
+ // returns the new child
public function appendElement($name, $value = '') {
return $this->appendChild($this->ownerDocument->createElement($name, $value));
public function appendElement($name, $value = '') {
return $this->appendChild($this->ownerDocument->createElement($name, $value));
@@
-796,6
+859,9
@@
class ExtendedDocumentFragment extends DOMDocumentFragment {
public function appendInputNumber($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputNumber($name, $maxlength, $size, $id, $value));
}
public function appendInputNumber($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputNumber($name, $maxlength, $size, $id, $value));
}
+ public function appendInputEmail($name, $maxlength, $size, $id = null, $value = null) {
+ return $this->appendChild($this->ownerDocument->createElementInputEmail($name, $maxlength, $size, $id, $value));
+ }
public function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value));
}
public function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value));
}
@@
-841,8
+907,11
@@
class ExtendedDocumentFragment extends DOMDocumentFragment {
public function appendJSElement($jsdata) {
$this->appendChild($this->ownerDocument->createElementJS($jsdata));
}
public function appendJSElement($jsdata) {
$this->appendChild($this->ownerDocument->createElementJS($jsdata));
}
+ public function appendJSFile($jsdata) {
+ return $this->appendChild($this->ownerDocument->createElementJSFile($jsdata));
+ }
public function appendCOMElement($module, $attributes) {
public function appendCOMElement($module, $attributes) {
- $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));
+
return
$this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));
}
}
?>
}
}
?>