add search input, fix warnings in UA class
[php-utility-classes.git] / classes / document.php-class
index 4490589210b157a29f6442c8ff8a1ce0c386d281..211ae44116cd35bd7ca3e74328591b94cad33576 100755 (executable)
@@ -65,6 +65,10 @@ class ExtendedDocument extends DOMDocument {
   //   appends an ExtendedDocument::createElementInputRange() as a child of this document (see there for params)
   //     returns the new child
   //
+  // public function appendInputSearch($name, $maxlength, $size, [$id], [$value])
+  //   appends an ExtendedDocument::createElementInputSearch() as a child of this document (see there for params)
+  //     returns the new child
+  //
   // public function appendInputUrl($name, $maxlength, $size, [$id], [$value])
   //   appends an ExtendedDocument::createElementInputUrl() as a child of this document (see there for params)
   //     returns the new child
@@ -202,6 +206,10 @@ class ExtendedDocument extends DOMDocument {
   //   returns an ExtendedElement that is an HTML <input> of type 'url' with the given name, maxlength, size,
   //   and optionally id and value
   //
+  // public function createElementInputSearch($name, $maxlength, $size, [$id], [$value])
+  //   returns an ExtendedElement that is an HTML <input> of type 'search' 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
@@ -350,6 +358,9 @@ class ExtendedDocument extends DOMDocument {
   public function appendInputRange($name, $id, $min, $max, $step = null, $value = null) {
     return $this->appendChild($this->createElementInputRange($name, $id, $min, $max, $step, $value));
   }
+  public function appendInputSearch($name, $maxlength, $size, $id = null, $value = null) {
+    return $this->appendChild($this->createElementInputSearch($name, $maxlength, $size, $id, $value));
+  }
   public function appendInputUrl($name, $maxlength, $size, $id = null, $value = null) {
     return $this->appendChild($this->createElementInputUrl($name, $maxlength, $size, $id, $value));
   }
@@ -529,6 +540,17 @@ class ExtendedDocument extends DOMDocument {
     return $rgfield;
   }
 
+  public function createElementInputSearch($name, $maxlength, $size, $id = null, $value = null) {
+    $urlfield = $this->createElement('input');
+    $urlfield->setAttribute('type', 'search');
+    if (!is_null($id)) { $urlfield->setAttribute('id', $id); }
+    $urlfield->setAttribute('name', $name);
+    $urlfield->setAttribute('maxlength', $maxlength);
+    $urlfield->setAttribute('size', $size);
+    if (!is_null($value)) { $urlfield->setAttribute('value', $value); }
+    return $urlfield;
+  }
+
   public function createElementInputUrl($name, $maxlength, $size, $id = null, $value = null) {
     $urlfield = $this->createElement('input');
     $urlfield->setAttribute('type', 'url');
@@ -760,6 +782,10 @@ class ExtendedElement extends DOMElement {
   //   appends an ExtendedDocument::createElementInputRange() as a child of this element (see there for params)
   //     returns the new child
   //
+  // public function appendInputSearch($name, $maxlength, $size, [$id], [$value])
+  //   appends an ExtendedDocument::createElementInputSearch() as a child of this element (see there for params)
+  //     returns the new child
+  //
   // public function appendInputUrl($name, $maxlength, $size, [$id], [$value])
   //   appends an ExtendedDocument::createElementInputUrl() as a child of this element (see there for params)
   //     returns the new child
@@ -910,6 +936,9 @@ class ExtendedElement extends DOMElement {
   public function appendInputRange($name, $id, $min, $max, $step = null, $value = null) {
     return $this->appendChild($this->ownerDocument->createElementInputRange($name, $id, $min, $max, $step, $value));
   }
+  public function appendInputSearch($name, $maxlength, $size, $id = null, $value = null) {
+    return $this->appendChild($this->ownerDocument->createElementInputSearch($name, $maxlength, $size, $id, $value));
+  }
   public function appendInputUrl($name, $maxlength, $size, $id = null, $value = null) {
     return $this->appendChild($this->ownerDocument->createElementInputUrl($name, $maxlength, $size, $id, $value));
   }
@@ -1052,6 +1081,10 @@ class ExtendedDocumentFragment extends DOMDocumentFragment {
   //   appends an ExtendedDocument::createElementInputRange() as a child of this fragment (see there for params)
   //     returns the new child
   //
+  // public function appendInputSearch($name, $maxlength, $size, [$id], [$value])
+  //   appends an ExtendedDocument::createElementInputSearch() as a child of this fragment (see there for params)
+  //     returns the new child
+  //
   // public function appendInputUrl($name, $maxlength, $size, [$id], [$value])
   //   appends an ExtendedDocument::createElementInputUrl() as a child of this fragment (see there for params)
   //     returns the new child
@@ -1192,6 +1225,9 @@ class ExtendedDocumentFragment extends DOMDocumentFragment {
   public function appendInputRange($name, $id, $min, $max, $step = null, $value = null) {
     return $this->appendChild($this->ownerDocument->createElementInputRange($name, $id, $min, $max, $step, $value));
   }
+  public function appendInputSearch($name, $maxlength, $size, $id = null, $value = null) {
+    return $this->appendChild($this->ownerDocument->createElementInputSearch($name, $maxlength, $size, $id, $value));
+  }
   public function appendInputUrl($name, $maxlength, $size, $id = null, $value = null) {
     return $this->appendChild($this->ownerDocument->createElementInputUrl($name, $maxlength, $size, $id, $value));
   }