2 /* ***** BEGIN LICENSE BLOCK *****
4 * The contents of this file are subject to Austrian copyright reegulations
5 * ("Urheberrecht"); you may not use this file except in compliance with
7 * This contents and any derived work, if it gets distributed in any way,
8 * is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
9 * either express or implied.
11 * The Original Code is KaiRo's extended DOM document classes.
13 * The Initial Developer of the Original Code is
14 * KaiRo - Robert Kaiser.
15 * Portions created by the Initial Developer are Copyright (C) 2010
16 * the Initial Developer. All Rights Reserved.
18 * Contributor(s): Robert Kaiser <kairo@kairo.at>
20 * ***** END LICENSE BLOCK ***** */
22 class ExtendedDocument extends DOMDocument {
23 // ExtendedDocument PHP class
24 // this extends the general PHP DOM Document class to simplify some usual constructs
26 // function __construct([$version], [$encoding])
28 // construct a new DOM Document that uses our element definitions
31 // the default XML header
33 // private $xhtmldtype
34 // the XHTML doctype to use by default
36 // function appendElement($name, [$value])
37 // appends a DOMDocument::createElement() as a child of this document (see there for params)
38 // returns the new child
40 // function appendElementXML($name, $xmldata)
41 // appends a DOMDocument::createElement() with the given name as a child of this document,
42 // with an ExtendedDocument::createXMLFragment() of the given XML data inside
43 // returns the new child
45 // function appendLink($target, [$value])
46 // appends an ExtendedDocument::createElementLink() as a child of this document (see there for params)
47 // returns the new child
49 // function appendImage($src, [$alt_text])
50 // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params)
51 // returns the new child
53 // function appendFormDiv($action, $method, $name)
54 // appends an ExtendedDocument::createElementForm() as a child of this document (see there for params)
55 // returns an HTML <div> that is a child of the new child
57 // function appendInputHidden($name, $value)
58 // appends an ExtendedDocument::createElementInputHidden() as a child of this document (see there for params)
59 // returns the new child
61 // function appendInputText($name, $maxlength, $size, [$id], [$value])
62 // appends an ExtendedDocument::createElementInputText() as a child of this document (see there for params)
63 // returns the new child
65 // function appendInputRadio($name, $id, $value, $checked)
66 // appends an ExtendedDocument::createElementInputRadio() as a child of this document (see there for params)
67 // returns the new child
69 // function appendInputCheckbox($name, $id, $value, $checked)
70 // appends an ExtendedDocument::createElementInputCheckbox() as a child of this document (see there for params)
71 // returns the new child
73 // function appendInputSubmit($value)
74 // appends an ExtendedDocument::createElementInputSubmit() as a child of this document (see there for params)
75 // returns the new child
77 // function appendTextArea($name, $columns, $rows, [$id], [$value])
78 // appends an ExtendedDocument::createElementTextArea() as a child of this document (see there for params)
79 // returns the new child
81 // function appendElementSelect($name, [$id], [$options], [$default])
82 // appends an ExtendedDocument::createElementSelect() as a child of this document (see there for params)
83 // returns the new child
85 // function appendElementOption($key, $desc, [$selected])
86 // appends an ExtendedDocument::createElementOption() as a child of this document (see there for params)
87 // returns the new child
89 // function appendLabel($for_id, $value)
90 // appends an ExtendedDocument::createElementLabel() as a child of this document (see there for params)
91 // returns the new child
93 // function appendText($text)
94 // appends a DOMDocument::createTextNode() as a child of this document (see there for params)
95 // returns the new child
97 // function appendComment($comment_data)
98 // appends a DOMDocument::createComment() as a child of this document (see there for params)
99 // returns the new child
101 // function appendHTMLMarkup($htmldata, [$parentNode])
102 // appends a representation of the HTML data as children of the given parent node, by default this document
105 // function appendXMLMarkup($xmldata, [$parentNode])
106 // appends a representation of the XML data as children of the given parent node, by default this document
109 // function appendJSElement($jsdata)
110 // appends an ExtendedDocument::createElementJS() as a child of this document (see there for params)
113 // function appendCOMElement($module, $attributes)
114 // appends an ExtendedDocument::createCOMElement() as a child of this document (see there for params)
115 // returns the new child
117 // function createElementLink($target, [$value])
118 // returns an ExtendedElement that is an HTML <a> with the given target (href) and (optional) value
120 // function createElementImage($src, [$alt_text])
121 // returns an ExtendedElement that is an HTML <img> with the given (src) and alt attributes (set to '' by default)
123 // function createElementForm($action, $method, $name)
124 // returns an ExtendedElement that is an HTML <div> that is a child of an HTML <form>
125 // with the given action, method, and name
127 // function createElementInputHidden($name, $value)
128 // returns an ExtendedElement that is an HTML <input> of type 'hidden' with the given name and value
130 // function createElementInputText($name, $maxlength, $size, [$id], [$value])
131 // returns an ExtendedElement that is an HTML <input> of type 'text' with the given name, maxlength, size,
132 // and optionally id and value
134 // function createElementInputRadio($name, $id, $value, $checked)
135 // returns an ExtendedElement that is an HTML <input> of type 'radio' with the given name, id, value and
138 // function createElementInputCheckbox($name, $id, $value, $checked)
139 // returns an ExtendedElement that is an HTML <input> of type 'checkbox' with the given name, id, value and
142 // function createElementInputSubmit($value)
143 // returns an ExtendedElement that is an HTML <input> of type 'submit' with the given name and value
145 // function createElementTextArea($name, $columns, $rows, [$id], [$value])
146 // returns an ExtendedElement that is an HTML <textarea> with the given name, columns, rows,
147 // and optionally id and value
149 // function createElementSelect($name, [$id], [$options], [$default])
150 // returns an ExtendedElement that is an HTML <select> with the given name, and optionally id,
151 // array of options (key => description) and key of the by-default selected entry
153 // function createElementOption($key, $desc, [$selected])
154 // returns an ExtendedElement that is an HTML <option> with the given key (value) and description (content)
155 // and optionally bool that tells if the entry is selected
157 // function createElementLabel($for_id, $value)
158 // returns an ExtendedElement that is an HTML <label> with the given 'for' and value
160 // function createElementJS($jsdata)
161 // returns an ExtendedElement that is an HTML <script> of JavaScript type with the JS data inside
163 // function createCOMElement($module, $attributes)
164 // returns an ExtendedElement that is in COM_NS namespace, with the given module as name and the
165 // given name=>value array as attributes
167 function __construct($version = '1.0', $encoding = 'utf-8') {
168 // make sure the default DOMDocument constructor runs
169 parent::__construct($version, $encoding);
170 $this->registerNodeClass('DOMElement', 'ExtendedElement');
171 $this->registerNodeClass('DOMDocumentFragment', 'ExtendedDocumentFragment');
174 function appendElement($name, $value = '') {
175 return $this->appendChild($this->createElement($name, $value));
177 function appendElementXML($name, $xmldata) {
178 $aelem = $this->appendChild($this->createElement($name));
179 $aelem->appendXMLMarkup($xmldata);
180 //$aelem->appendChild($this->createXMLFragment($xmldata));
183 function appendLink($target, $value = '') {
184 return $this->appendChild($this->createElementLink($target, $value));
186 function appendImage($src, $alt_text = '') {
187 return $this->appendChild($this->createElementImage($src, $alt_text));
189 function appendFormDiv($action, $method, $name) {
190 $formelem = $this->appendChild($this->createElementForm($action, $method, $name));
191 return $formelem->appendElement('div');
193 function appendInputHidden($name, $value) {
194 return $this->appendChild($this->createElementInputHidden($name, $value));
196 function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
197 return $this->appendChild($this->createElementInputText($name, $maxlength, $size, $id, $value));
199 function appendInputRadio($name, $id, $value, $checked) {
200 return $this->appendChild($this->createElementInputRadio($name, $id, $value, $checked));
202 function appendInputCheckbox($name, $id, $value, $checked) {
203 return $this->appendChild($this->createElementInputCheckbox($name, $id, $value, $checked));
205 function appendInputSubmit($value) {
206 return $this->appendChild($this->createElementInputSubmit($value));
208 function appendTextArea($name, $columns, $rows, $id = null, $value = null) {
209 return $this->appendChild($this->createElementTextArea($name, $columns, $rows, $id, $value));
211 function appendElementSelect($name, $id = null, $options = array(), $default = null) {
212 return $this->appendChild($this->createElementSelect($name, $id, $options, $default));
214 function appendElementOption($key, $desc, $selected = false) {
215 return $this->appendChild($this->createElementOption($key, $desc, $selected));
217 function appendLabel($for_id, $value) {
218 return $this->appendChild($this->createElementLabel($for_id, $value));
220 function appendText($text) {
221 return $this->appendChild($this->createTextNode($text));
223 function appendComment($comment_data) {
224 return $this->appendChild($this->createComment($comment_data));
226 function appendJSElement($jsdata) {
227 $this->appendChild($this->createElementJS($jsdata));
229 function appendCOMElement($module, $attributes) {
230 $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));
233 function appendHTMLMarkup($htmldata, $parentNode = null) {
234 if (is_null($parentNode)) { $parentNode =& $this; }
235 // XXX: just a workaround for now!
236 $parentNode->appendChild($this->createCDATASection($htmldata));
239 function appendXMLMarkup($xmldata, $parentNode = null) {
240 if (is_null($parentNode)) { $parentNode =& $this; }
241 $tmpdoc = new ExtendedDocument;
242 $tmpxml = '<?xml version="1.0" encoding="utf-8"?>'."\n";
243 $tmpxml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'."\n";
244 $tmpxml .= '<root>'.$xmldata.'</root>';
245 $tmpdoc->loadXML($tmpxml);
246 foreach ($tmpdoc->getElementsByTagName('root')->item(0)->childNodes as $child) {
247 $parentNode->appendChild($this->importNode($child, true));
251 function createElementLink($target, $value = '') {
252 $link = $this->createElement('a', $value);
253 $link->setAttribute('href', $target); // XXX: take care of & etc. in links
257 function createElementImage($src, $alt_text = '') {
258 $link = $this->createElement('img');
259 $link->setAttribute('src', $src);
260 $link->setAttribute('alt', $alt_text);
264 function createElementForm($action, $method, $name) {
265 $formelem = $this->createElement('form');
266 $formelem->setAttribute('action', $action);
267 $formelem->setAttribute('method', $method);
268 $formelem->setAttribute('name', $name);
272 function createElementInputHidden($name, $value) {
273 $hidden = $this->createElement('input');
274 $hidden->setAttribute('type', 'hidden');
275 $hidden->setAttribute('name', $name);
276 $hidden->setAttribute('value', $value);
280 function createElementInputText($name, $maxlength, $size, $id = null, $value = null) {
281 $txfield = $this->createElement('input');
282 $txfield->setAttribute('type', 'text');
283 if (!is_null($id)) { $txfield->setAttribute('id', $id); }
284 $txfield->setAttribute('name', $name);
285 $txfield->setAttribute('maxlength', $maxlength);
286 $txfield->setAttribute('size', $size);
287 if (!is_null($value)) { $txfield->setAttribute('value', $value); }
291 function createElementInputRadio($name, $id, $value, $checked) {
292 $radio = $this->createElement('input');
293 $radio->setAttribute('type', 'radio');
294 $radio->setAttribute('name', $name);
295 $radio->setAttribute('id', $id);
296 $radio->setAttribute('value', $value);
297 if ($checked) { $radio->setAttribute('checked', ''); }
301 function createElementInputCheckbox($name, $id, $value, $checked) {
302 $cbox = $this->createElement('input');
303 $cbox->setAttribute('type', 'checkbox');
304 $cbox->setAttribute('name', $name);
305 $cbox->setAttribute('id', $id);
306 $cbox->setAttribute('value', $value);
307 if ($checked) { $cbox->setAttribute('checked', ''); }
311 function createElementInputSubmit($value) {
312 $submitbtn = $this->createElement('input');
313 $submitbtn->setAttribute('type', 'submit');
314 $submitbtn->setAttribute('value', $value);
318 function createElementTextArea($name, $columns, $rows, $id = null, $value = null) {
319 $txtarea = $this->createElement('textarea', $value);
320 $txtarea->setAttribute('name', $name);
321 $txtarea->setAttribute('cols', $columns);
322 $txtarea->setAttribute('rows', $rows);
323 if (!is_null($id)) { $txtarea->setAttribute('id', $id); }
327 function createElementSelect($name, $id = null, $options = array(), $default = null) {
328 $select = $this->createElement('select');
329 $select->setAttribute('name', $name);
330 if (!is_null($id)) { $select->setAttribute('id', $id); }
331 foreach ($options as $key => $desc) {
332 $select->appendElementOption($key, $desc, ($key == $default));
337 function createElementOption($key, $desc, $selected = false) {
338 $option = $this->createElement('option', $desc);
339 $option->setAttribute('value', $key);
340 if ($selected) { $option->setAttribute('selected', ''); }
344 function createElementLabel($for_id, $value) {
345 $label = $this->createElement('label', $value);
346 $label->setAttribute('for', $for_id);
350 function createElementJS($jsdata) {
351 $jselem = $this->createElement('script');
352 $jselem->setAttribute('type', 'text/javascript');
353 $jselem->appendChild($this->createCDATASection($jsdata));
357 function createCOMElement($module, $attributes) {
358 $com_elem = $this->createElementNS(COM_NS, $module);
359 if (is_array($attributes) && count($attributes)) {
360 foreach ($attributes as $name=>$value) {
361 $com_elem->setAttribute($name, $value);
368 class ExtendedElement extends DOMElement {
369 // ExtendedElement PHP class
370 // this extends the general PHP DOM Element class to simplify some usual constructs
372 // function appendElement($name, [$value])
373 // appends a DOMDocument::createElement() as a child of this element (see there for params)
374 // returns the new child
376 // function appendElementXML($name, $xmldata)
377 // appends a DOMDocument::createElement() with the given name as a child of this element,
378 // with an ExtendedDocument::createXMLFragment() of the given XML data inside
379 // returns the new child
381 // function appendLink($target, [$value])
382 // appends an ExtendedDocument::createElementLink() as a child of this element (see there for params)
383 // returns the new child
385 // function appendImage($src, [$alt_text])
386 // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params)
387 // returns the new child
389 // function appendFormDiv($action, $method, $name)
390 // appends an ExtendedDocument::createElementForm() as a child of this element (see there for params)
391 // returns an HTML <div> that is a child of the new child
393 // function appendInputHidden($name, $value)
394 // appends an ExtendedDocument::createElementInputHidden() as a child of this element (see there for params)
395 // returns the new child
397 // function appendInputText($name, $maxlength, $size, [$id], [$value])
398 // appends an ExtendedDocument::createElementInputText() as a child of this element (see there for params)
399 // returns the new child
401 // function appendInputRadio($name, $id, $value, $checked)
402 // appends an ExtendedDocument::createElementInputRadio() as a child of this element (see there for params)
403 // returns the new child
405 // function appendInputCheckbox($name, $id, $value, $checked)
406 // appends an ExtendedDocument::createElementInputCheckbox() as a child of this element (see there for params)
407 // returns the new child
409 // function appendInputSubmit($value)
410 // appends an ExtendedDocument::createElementInputSubmit() as a child of this element (see there for params)
411 // returns the new child
413 // function appendTextArea($name, $columns, $rows, [$id], [$value])
414 // appends an ExtendedDocument::createElementTextArea() as a child of this element (see there for params)
415 // returns the new child
417 // function appendElementSelect($name, [$id], [$options], [$default])
418 // appends an ExtendedDocument::createElementSelect() as a child of this element (see there for params)
419 // returns the new child
421 // function appendElementOption($key, $desc, [$selected])
422 // appends an ExtendedDocument::createElementOption() as a child of this element (see there for params)
423 // returns the new child
425 // function appendLabel($for_id, $value)
426 // appends an ExtendedDocument::createElementLabel() as a child of this element (see there for params)
427 // returns the new child
429 // function appendText($text)
430 // appends a DOMDocument::createTextNode() as a child of this element (see there for params)
431 // returns the new child
433 // function appendComment($comment_data)
434 // appends a DOMDocument::createComment() as a child of this element (see there for params)
435 // returns the new child
437 // function appendHTMLMarkup($htmldata)
438 // appends a representation of the HTML data as children of this element
441 // function appendXMLMarkup($xmldata)
442 // appends a representation of the XML data as children of this element
445 // function appendJSElement($jsdata)
446 // appends an ExtendedDocument::createElementJS() as a child of this element (see there for params)
449 // function appendCOMElement($module, $attributes)
450 // appends an ExtendedDocument::createCOMElement() as a child of this element (see there for params)
451 // returns the new child
453 function appendElement($name, $value = '') {
454 return $this->appendChild($this->ownerDocument->createElement($name, $value));
456 function appendElementXML($name, $xmldata) {
457 $aelem = $this->appendChild($this->ownerDocument->createElement($name));
458 $aelem->appendXMLMarkup($xmldata);
461 function appendLink($target, $value = '') {
462 return $this->appendChild($this->ownerDocument->createElementLink($target, $value));
464 function appendImage($src, $alt_text = '') {
465 return $this->appendChild($this->ownerDocument->createElementImage($src, $alt_text));
467 function appendFormDiv($action, $method, $name) {
468 $formelem = $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name));
469 return $formelem->appendElement('div');
471 function appendInputHidden($name, $value) {
472 return $this->appendChild($this->ownerDocument->createElementInputHidden($name, $value));
474 function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
475 return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $value));
477 function appendInputRadio($name, $id, $value, $checked) {
478 return $this->appendChild($this->ownerDocument->createElementInputRadio($name, $id, $value, $checked));
480 function appendInputCheckbox($name, $id, $value, $checked) {
481 return $this->appendChild($this->ownerDocument->createElementInputCheckbox($name, $id, $value, $checked));
483 function appendInputSubmit($value) {
484 return $this->appendChild($this->ownerDocument->createElementInputSubmit($value));
486 function appendTextArea($name, $columns, $rows, $id = null, $value = null) {
487 return $this->appendChild($this->ownerDocument->createElementTextArea($name, $columns, $rows, $id, $value));
489 function appendElementSelect($name, $id = null, $options = array(), $default = null) {
490 return $this->appendChild($this->ownerDocument->createElementSelect($name, $id, $options, $default));
492 function appendElementOption($key, $desc, $selected = false) {
493 return $this->appendChild($this->ownerDocument->createElementOption($key, $desc, $selected));
495 function appendLabel($for_id, $value) {
496 return $this->appendChild($this->ownerDocument->createElementLabel($for_id, $value));
498 function appendText($text) {
499 return $this->appendChild($this->ownerDocument->createTextNode($text));
501 function appendComment($comment_data) {
502 return $this->appendChild($this->ownerDocument->createComment($comment_data));
504 function appendHTMLMarkup($htmldata) {
505 $this->ownerDocument->appendHTMLMarkup($htmldata, $this);
507 function appendXMLMarkup($xmldata) {
508 $this->ownerDocument->appendXMLMarkup($xmldata, $this);
510 function appendJSElement($jsdata) {
511 $this->appendChild($this->ownerDocument->createElementJS($jsdata));
513 function appendCOMElement($module, $attributes) {
514 $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));
518 class ExtendedDocumentFragment extends DOMDocumentFragment {
519 // ExtendedDocumentFragment PHP class
520 // this extends the general PHP DOM Document Fragment class to simplify some usual constructs
522 // function appendElement($name, [$value])
523 // appends a DOMDocument::createElement() as a child of this fragment (see there for params)
524 // returns the new child
526 // function appendElementXML($name, $xmldata)
527 // appends a DOMDocument::createElement() with the given name as a child of this fragment,
528 // with an ExtendedDocument::createXMLFragment() of the given XML data inside
529 // returns the new child
531 // function appendLink($target, [$value])
532 // appends an ExtendedDocument::createElementLink() as a child of this fragment (see there for params)
533 // returns the new child
535 // function appendImage($src, [$alt_text])
536 // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params)
537 // returns the new child
539 // function appendFormDiv($action, $method, $name)
540 // appends an ExtendedDocument::createElementForm() as a child of this fragment (see there for params)
541 // returns an HTML <div> that is a child of the new child
543 // function appendInputHidden($name, $value)
544 // appends an ExtendedDocument::createElementInputHidden() as a child of this fragment (see there for params)
545 // returns the new child
547 // function appendInputText($name, $maxlength, $size, [$id], [$value])
548 // appends an ExtendedDocument::createElementInputText() as a child of this fragment (see there for params)
549 // returns the new child
551 // function appendInputRadio($name, $id, $value, $checked)
552 // appends an ExtendedDocument::createElementInputRadio() as a child of this fragment (see there for params)
553 // returns the new child
555 // function appendInputCheckbox($name, $id, $value, $checked)
556 // appends an ExtendedDocument::createElementInputCheckbox() as a child of this fragment (see there for params)
557 // returns the new child
559 // function appendInputSubmit($value)
560 // appends an ExtendedDocument::createElementInputSubmit() as a child of this fragment (see there for params)
561 // returns the new child
563 // function appendTextArea($name, $columns, $rows, [$id], [$value])
564 // appends an ExtendedDocument::createElementTextArea() as a child of this fragment (see there for params)
565 // returns the new child
567 // function appendElementSelect($name, [$id], [$options], [$default])
568 // appends an ExtendedDocument::createElementSelect() as a child of this fragment (see there for params)
569 // returns the new child
571 // function appendElementOption($key, $desc, [$selected])
572 // appends an ExtendedDocument::createElementOption() as a child of this fragment (see there for params)
573 // returns the new child
575 // function appendLabel($for_id, $value)
576 // appends an ExtendedDocument::createElementLabel() as a child of this fragment (see there for params)
577 // returns the new child
579 // function appendText($text)
580 // appends a DOMDocument::createTextNode() as a child of this fragment (see there for params)
581 // returns the new child
583 // function appendComment($comment_data)
584 // appends a DOMDocument::createComment() as a child of this fragment (see there for params)
585 // returns the new child
587 // function appendHTMLMarkup($htmldata)
588 // appends a representation of the HTML data as children of this fragment
591 // function appendXMLMarkup($xmldata)
592 // appends a representation of the XML data as children of this fragment
595 // function appendJSElement($jsdata)
596 // appends an ExtendedDocument::createElementJS() as a child of this fragment (see there for params)
599 // function appendCOMElement($module, $attributes)
600 // appends an ExtendedDocument::createCOMElement() as a child of this fragment (see there for params)
601 // returns the new child
603 function appendElement($name, $value = '') {
604 return $this->appendChild($this->ownerDocument->createElement($name, $value));
606 function appendElementXML($name, $xmldata) {
607 $aelem = $this->appendChild($this->ownerDocument->createElement($name));
608 $aelem->appendXMLMarkup($xmldata);
611 function appendLink($target, $value = '') {
612 return $this->appendChild($this->ownerDocument->createElementLink($target, $value));
614 function appendImage($src, $alt_text = '') {
615 return $this->appendChild($this->ownerDocument->createElementImage($src, $alt_text));
617 function appendFormDiv($action, $method, $name) {
618 $formelem = $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name));
619 return $formelem->appendElement('div');
621 function appendInputHidden($name, $value) {
622 return $this->appendChild($this->ownerDocument->createElementInputHidden($name, $value));
624 function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
625 return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $value));
627 function appendInputRadio($name, $id, $value, $checked) {
628 return $this->appendChild($this->ownerDocument->createElementInputRadio($name, $id, $value, $checked));
630 function appendInputCheckbox($name, $id, $value, $checked) {
631 return $this->appendChild($this->ownerDocument->createElementInputCheckbox($name, $id, $value, $checked));
633 function appendInputSubmit($value) {
634 return $this->appendChild($this->ownerDocument->createElementInputSubmit($value));
636 function appendTextArea($name, $columns, $rows, $id = null, $value = null) {
637 return $this->appendChild($this->ownerDocument->createElementTextArea($name, $columns, $rows, $id, $value));
639 function appendElementSelect($name, $id = null, $options = array(), $default = null) {
640 return $this->appendChild($this->ownerDocument->createElementSelect($name, $id, $options, $default));
642 function appendElementOption($key, $desc, $selected = false) {
643 return $this->appendChild($this->ownerDocument->createElementOption($key, $desc, $selected));
645 function appendLabel($for_id, $value) {
646 return $this->appendChild($this->ownerDocument->createElementLabel($for_id, $value));
648 function appendText($text) {
649 return $this->appendChild($this->ownerDocument->createTextNode($text));
651 function appendComment($comment_data) {
652 return $this->appendChild($this->ownerDocument->createComment($comment_data));
654 function appendHTMLMarkup($htmldata) {
655 $this->ownerDocument->appendHTMLMarkup($htmldata, $this);
657 function appendXMLMarkup($xmldata) {
658 $this->ownerDocument->appendXMLMarkup($xmldata, $this);
660 function appendJSElement($jsdata) {
661 $this->appendChild($this->ownerDocument->createElementJS($jsdata));
663 function appendCOMElement($module, $attributes) {
664 $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));