add support for number inputs to ExtendedDocument
[php-utility-classes.git] / include / cbsm / util / document.php-class
index 1563e9fa13d1c08996f87057da9992e7570f175b..c64d9a4a81c3f6e501036f9136beeca86bc4e962 100755 (executable)
@@ -66,6 +66,10 @@ class ExtendedDocument extends DOMDocument {
   //   appends an ExtendedDocument::createElementInputText() as a child of this document (see there for params)
   //     returns 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
   // 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
@@ -143,6 +147,10 @@ class ExtendedDocument extends DOMDocument {
   //   returns an ExtendedElement that is an HTML <input> of type 'text' with the given name, maxlength, size,
   //   and optionally id and value
   //
   //   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 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
@@ -221,6 +229,9 @@ class ExtendedDocument extends DOMDocument {
   function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
     return $this->appendChild($this->createElementInputText($name, $maxlength, $size, $id, $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 appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
     return $this->appendChild($this->createElementInputPassword($name, $maxlength, $size, $id, $value));
   }
@@ -321,6 +332,17 @@ class ExtendedDocument extends DOMDocument {
     return $txfield;
   }
 
     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');
   function createElementInputPassword($name, $maxlength, $size, $id = null, $value = null) {
     $pwfield = $this->createElement('input');
     $pwfield->setAttribute('type', 'password');
@@ -454,6 +476,10 @@ class ExtendedElement extends DOMElement {
   //   appends an ExtendedDocument::createElementInputText() as a child of this element (see there for params)
   //     returns 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
   // 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
@@ -544,6 +570,9 @@ class ExtendedElement extends DOMElement {
   function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
     return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $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));
   }
   function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
     return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value));
   }
@@ -628,6 +657,10 @@ class ExtendedDocumentFragment extends DOMDocumentFragment {
   //   appends an ExtendedDocument::createElementInputText() as a child of this fragment (see there for params)
   //     returns 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
   // 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
@@ -718,6 +751,9 @@ class ExtendedDocumentFragment extends DOMDocumentFragment {
   function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
     return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $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));
   }
   function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
     return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value));
   }