// appends an ExtendedDocument::createElementImage() as a child of this document (see there for params)
// returns the new child
//
- // function appendFormDiv($action, $method, $name)
+ // function appendForm($action, $method, $name, [$id])
+ // appends an ExtendedDocument::createElementForm() as a child of this document (see there for params)
+ // returns the new child
+ //
+ // function appendFormDiv($action, $method, $name, [$id])
// appends an ExtendedDocument::createElementForm() as a child of this document (see there for params)
// returns an HTML <div> that is a child of the new child
//
// appends an ExtendedDocument::createElementInputText() as a child of this document (see there for params)
// returns the new child
//
+ // function appendInputNumber($name, $maxlength, $size, [$id], [$value])
+ // appends an ExtendedDocument::createElementInputNumber() as a child of this document (see there for params)
+ // returns the new child
+ //
// 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
// returns an ExtendedElement that is an HTML <input> of type 'text' with the given name, maxlength, size,
// and optionally id and value
//
+ // function createElementInputNumber($name, $maxlength, $size, [$id], [$value])
+ // returns an ExtendedElement that is an HTML <input> of type 'number' with the given name, maxlength, size,
+ // and optionally id and value
+ //
// 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
}
function appendElement($name, $value = '') {
- // Adding the $value in createElement does NOT escape it, so use appendText to support that.
- $aelem = $this->appendChild($this->createElement($name));
- $aelem->appendText($value);
- return $aelem;
+ return $this->appendChild($this->createElement($name, $value));
}
function appendElementXML($name, $xmldata) {
$aelem = $this->appendChild($this->createElement($name));
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));
+ function appendForm($action, $method, $name, $id = null) {
+ return $this->appendChild($this->createElementForm($action, $method, $name, $id));
+ }
+ function appendFormDiv($action, $method, $name, $id = null) {
+ $formelem = $this->appendChild($this->createElementForm($action, $method, $name, $id));
return $formelem->appendElement('div');
}
function appendInputHidden($name, $value) {
function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->createElementInputText($name, $maxlength, $size, $id, $value));
}
+ function appendInputNumber($name, $maxlength, $size, $id = null, $value = null) {
+ return $this->appendChild($this->createElementInputNumber($name, $maxlength, $size, $id, $value));
+ }
function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->createElementInputPassword($name, $maxlength, $size, $id, $value));
}
}
}
+ function createElement($name, $value = '') {
+ // Adding the $value in DOMDocument's createElement does NOT escape it, so override it and use appendText to support that.
+ $aelem = parent::createElement($name);
+ $aelem->appendText($value);
+ return $aelem;
+ }
+
function createElementLink($target, $value = '') {
- $link = $this->createElement('a');
- $link->appendText($value);
+ $link = $this->createElement('a', $value);
$link->setAttribute('href', $target); // XXX: take care of & etc. in links
return $link;
}
return $img;
}
- function createElementForm($action, $method, $name) {
+ function createElementForm($action, $method, $name, $id = null) {
$formelem = $this->createElement('form');
$formelem->setAttribute('action', $action);
$formelem->setAttribute('method', $method);
$formelem->setAttribute('name', $name);
+ $formelem->setAttribute('id', $id);
return $formelem;
}
return $txfield;
}
+ function createElementInputNumber($name, $maxlength, $size, $id = null, $value = null) {
+ $txfield = $this->createElement('input');
+ $txfield->setAttribute('type', 'number');
+ 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;
+ }
+
function createElementInputPassword($name, $maxlength, $size, $id = null, $value = null) {
$pwfield = $this->createElement('input');
$pwfield->setAttribute('type', 'password');
// appends an ExtendedDocument::createElementImage() as a child of this document (see there for params)
// returns the new child
//
- // function appendFormDiv($action, $method, $name)
+ // function appendForm($action, $method, $name, [$id])
+ // appends an ExtendedDocument::createElementForm() as a child of this element (see there for params)
+ // returns the new child
+ //
+ // function appendFormDiv($action, $method, $name, [$id])
// appends an ExtendedDocument::createElementForm() as a child of this element (see there for params)
// returns an HTML <div> that is a child of the new child
//
// appends an ExtendedDocument::createElementInputText() as a child of this element (see there for params)
// returns the new child
//
+ // function appendInputNumber($name, $maxlength, $size, [$id], [$value])
+ // appends an ExtendedDocument::createElementInputNumber() as a child of this element (see there for params)
+ // returns the new child
+ //
// 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
// returns the new child
function appendElement($name, $value = '') {
- // Adding the $value in createElement does NOT escape it, so use appendText to support that.
- $aelem = $this->appendChild($this->ownerDocument->createElement($name));
- $aelem->appendText($value);
- return $aelem;
+ return $this->appendChild($this->ownerDocument->createElement($name, $value));
}
function appendElementXML($name, $xmldata) {
$aelem = $this->appendChild($this->ownerDocument->createElement($name));
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));
+ function appendForm($action, $method, $name, $id = null) {
+ return $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name, $id));
+ }
+ function appendFormDiv($action, $method, $name, $id = null) {
+ $formelem = $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name, $id));
return $formelem->appendElement('div');
}
function appendInputHidden($name, $value) {
function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $value));
}
+ function appendInputNumber($name, $maxlength, $size, $id = null, $value = null) {
+ return $this->appendChild($this->ownerDocument->createElementInputNumber($name, $maxlength, $size, $id, $value));
+ }
function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value));
}
// appends an ExtendedDocument::createElementImage() as a child of this document (see there for params)
// returns the new child
//
- // function appendFormDiv($action, $method, $name)
+ // function appendForm($action, $method, $name, [$id])
+ // appends an ExtendedDocument::createElementForm() as a child of this fragment (see there for params)
+ // returns the new child
+ //
+ // function appendFormDiv($action, $method, $name, [$id])
// appends an ExtendedDocument::createElementForm() as a child of this fragment (see there for params)
// returns an HTML <div> that is a child of the new child
//
// appends an ExtendedDocument::createElementInputText() as a child of this fragment (see there for params)
// returns the new child
//
+ // function appendInputNumber($name, $maxlength, $size, [$id], [$value])
+ // appends an ExtendedDocument::createElementInputNumber() as a child of this fragment (see there for params)
+ // returns the new child
+ //
// 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
// returns the new child
function appendElement($name, $value = '') {
- // Adding the $value in createElement does NOT escape it, so use appendText to support that.
- $aelem = $this->appendChild($this->ownerDocument->createElement($name));
- $aelem->appendText($value);
- return $aelem;
+ return $this->appendChild($this->ownerDocument->createElement($name, $value));
}
function appendElementXML($name, $xmldata) {
$aelem = $this->appendChild($this->ownerDocument->createElement($name));
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));
+ function appendForm($action, $method, $name, $id = null) {
+ return $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name, $id));
+ }
+ function appendFormDiv($action, $method, $name, $id = null) {
+ $formelem = $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name, $id));
return $formelem->appendElement('div');
}
function appendInputHidden($name, $value) {
function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $value));
}
+ function appendInputNumber($name, $maxlength, $size, $id = null, $value = null) {
+ return $this->appendChild($this->ownerDocument->createElementInputNumber($name, $maxlength, $size, $id, $value));
+ }
function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value));
}