X-Git-Url: https://git-public.kairo.at/?a=blobdiff_plain;ds=sidebyside;f=classes%2Fdocument.php-class;h=ed688b6e38b3c7dd50b38f41e68bc9ebdfeae3cf;hb=5ae00086e5e4a5ffe979d5462b388d8277417e9f;hp=f215f7bc36a275dbc54b320a6f0e7d60e8ceb508;hpb=d7403a92eac6ca945c5d163d860c0753be834f0a;p=php-utility-classes.git diff --git a/classes/document.php-class b/classes/document.php-class index f215f7b..ed688b6 100755 --- a/classes/document.php-class +++ b/classes/document.php-class @@ -173,8 +173,7 @@ class ExtendedDocument extends DOMDocument { // returns an ExtendedElement that is an HTML with the given src and alt attributes (set to '' by default) // // public function createElementForm($action, $method, $name) - // returns an ExtendedElement that is an HTML
that is a child of an HTML
- // with the given action, method, and name + // returns an ExtendedElement that is an HTML with the given action, method, and name // // public function createElementInputHidden($name, $value) // returns an ExtendedElement that is an HTML of type 'hidden' with the given name and value @@ -440,7 +439,7 @@ class ExtendedDocument extends DOMDocument { public 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); - if (strlen($value)) { $aelem->appendText($value); } + if (strlen($value ?? '')) { $aelem->appendText($value); } return $aelem; } @@ -554,23 +553,25 @@ class ExtendedDocument extends DOMDocument { } public function createElementInputDate($name, $id = null, $min = null, $max = null, $value = null) { - $telfield = $this->createElement('input'); - $telfield->setAttribute('type', 'date'); - if (!is_null($id)) { $telfield->setAttribute('id', $id); } - if (!is_null($min)) { $rgfield->setAttribute('min', $min); } - if (!is_null($max)) { $rgfield->setAttribute('max', $max); } - if (!is_null($value)) { $telfield->setAttribute('value', $value); } - return $telfield; + $dtfield = $this->createElement('input'); + $dtfield->setAttribute('type', 'date'); + if (!is_null($id)) { $dtfield->setAttribute('id', $id); } + $dtfield->setAttribute('name', $name); + if (!is_null($min)) { $dtfield->setAttribute('min', $min); } + if (!is_null($max)) { $dtfield->setAttribute('max', $max); } + if (!is_null($value)) { $dtfield->setAttribute('value', $value); } + return $dtfield; } public function createElementInputTime($name, $id = null, $min = null, $max = null, $value = null) { - $telfield = $this->createElement('input'); - $telfield->setAttribute('type', 'time'); - if (!is_null($id)) { $telfield->setAttribute('id', $id); } - if (!is_null($min)) { $rgfield->setAttribute('min', $min); } - if (!is_null($max)) { $rgfield->setAttribute('max', $max); } - if (!is_null($value)) { $telfield->setAttribute('value', $value); } - return $telfield; + $timefield = $this->createElement('input'); + $timefield->setAttribute('type', 'time'); + if (!is_null($id)) { $timefield->setAttribute('id', $id); } + $timefield->setAttribute('name', $name); + if (!is_null($min)) { $timefield->setAttribute('min', $min); } + if (!is_null($max)) { $timefield->setAttribute('max', $max); } + if (!is_null($value)) { $timefield->setAttribute('value', $value); } + return $timefield; } public function createElementInputColor($name, $id = null, $value = null) {