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 appendButton($value, $onclick = null)
78 // appends an ExtendedDocument::createElementButton() as a child of this document (see there for params)
79 // returns the new child
81 // function appendTextArea($name, $columns, $rows, [$id], [$value])
82 // appends an ExtendedDocument::createElementTextArea() as a child of this document (see there for params)
83 // returns the new child
85 // function appendElementSelect($name, [$id], [$options], [$default])
86 // appends an ExtendedDocument::createElementSelect() as a child of this document (see there for params)
87 // returns the new child
89 // function appendElementOption($key, $desc, [$selected])
90 // appends an ExtendedDocument::createElementOption() as a child of this document (see there for params)
91 // returns the new child
93 // function appendLabel($for_id, $value)
94 // appends an ExtendedDocument::createElementLabel() as a child of this document (see there for params)
95 // returns the new child
97 // function appendText($text)
98 // appends a DOMDocument::createTextNode() as a child of this document (see there for params)
99 // returns the new child
101 // function appendComment($comment_data)
102 // appends a DOMDocument::createComment() as a child of this document (see there for params)
103 // returns the new child
105 // function appendHTMLMarkup($htmldata, [$parentNode])
106 // appends a representation of the HTML data as children of the given parent node, by default this document
109 // function appendXMLMarkup($xmldata, [$parentNode])
110 // appends a representation of the XML data as children of the given parent node, by default this document
113 // function appendJSElement($jsdata)
114 // appends an ExtendedDocument::createElementJS() as a child of this document (see there for params)
117 // function appendCOMElement($module, $attributes)
118 // appends an ExtendedDocument::createCOMElement() as a child of this document (see there for params)
119 // returns the new child
121 // function createElementLink($target, [$value])
122 // returns an ExtendedElement that is an HTML <a> with the given target (href) and (optional) value
124 // function createElementImage($src, [$alt_text])
125 // returns an ExtendedElement that is an HTML <img> with the given (src) and alt attributes (set to '' by default)
127 // function createElementForm($action, $method, $name)
128 // returns an ExtendedElement that is an HTML <div> that is a child of an HTML <form>
129 // with the given action, method, and name
131 // function createElementInputHidden($name, $value)
132 // returns an ExtendedElement that is an HTML <input> of type 'hidden' with the given name and value
134 // function createElementInputText($name, $maxlength, $size, [$id], [$value])
135 // returns an ExtendedElement that is an HTML <input> of type 'text' with the given name, maxlength, size,
136 // and optionally id and value
138 // function createElementInputRadio($name, $id, $value, $checked)
139 // returns an ExtendedElement that is an HTML <input> of type 'radio' with the given name, id, value and
142 // function createElementInputCheckbox($name, $id, $value, $checked)
143 // returns an ExtendedElement that is an HTML <input> of type 'checkbox' with the given name, id, value and
146 // function createElementInputSubmit($value)
147 // returns an ExtendedElement that is an HTML <input> of type 'submit' with the given value as label
149 // function createElementButton($value, $onclick = null)
150 // returns an ExtendedElement that is an HTML button with the given value as label and optionally onclick attribute
152 // function createElementTextArea($name, $columns, $rows, [$id], [$value])
153 // returns an ExtendedElement that is an HTML <textarea> with the given name, columns, rows,
154 // and optionally id and value
156 // function createElementSelect($name, [$id], [$options], [$default])
157 // returns an ExtendedElement that is an HTML <select> with the given name, and optionally id,
158 // array of options (key => description) and key of the by-default selected entry
160 // function createElementOption($key, $desc, [$selected])
161 // returns an ExtendedElement that is an HTML <option> with the given key (value) and description (content)
162 // and optionally bool that tells if the entry is selected
164 // function createElementLabel($for_id, $value)
165 // returns an ExtendedElement that is an HTML <label> with the given 'for' and value
167 // function createElementJS($jsdata)
168 // returns an ExtendedElement that is an HTML <script> of JavaScript type with the JS data inside
170 // function createCOMElement($module, $attributes)
171 // returns an ExtendedElement that is in COM_NS namespace, with the given module as name and the
172 // given name=>value array as attributes
174 function __construct($version = '1.0', $encoding = 'utf-8') {
175 // make sure the default DOMDocument constructor runs
176 parent::__construct($version, $encoding);
177 $this->registerNodeClass('DOMElement', 'ExtendedElement');
178 $this->registerNodeClass('DOMDocumentFragment', 'ExtendedDocumentFragment');
181 function appendElement($name, $value = '') {
182 return $this->appendChild($this->createElement($name, $value));
184 function appendElementXML($name, $xmldata) {
185 $aelem = $this->appendChild($this->createElement($name));
186 $aelem->appendXMLMarkup($xmldata);
187 //$aelem->appendChild($this->createXMLFragment($xmldata));
190 function appendLink($target, $value = '') {
191 return $this->appendChild($this->createElementLink($target, $value));
193 function appendImage($src, $alt_text = '') {
194 return $this->appendChild($this->createElementImage($src, $alt_text));
196 function appendFormDiv($action, $method, $name) {
197 $formelem = $this->appendChild($this->createElementForm($action, $method, $name));
198 return $formelem->appendElement('div');
200 function appendInputHidden($name, $value) {
201 return $this->appendChild($this->createElementInputHidden($name, $value));
203 function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
204 return $this->appendChild($this->createElementInputText($name, $maxlength, $size, $id, $value));
206 function appendInputRadio($name, $id, $value, $checked) {
207 return $this->appendChild($this->createElementInputRadio($name, $id, $value, $checked));
209 function appendInputCheckbox($name, $id, $value, $checked) {
210 return $this->appendChild($this->createElementInputCheckbox($name, $id, $value, $checked));
212 function appendInputSubmit($value) {
213 return $this->appendChild($this->createElementInputSubmit($value));
215 function appendButton($value, $onclick = null) {
216 return $this->appendChild($this->createElementButton($value, $onclick));
218 function appendTextArea($name, $columns, $rows, $id = null, $value = null) {
219 return $this->appendChild($this->createElementTextArea($name, $columns, $rows, $id, $value));
221 function appendElementSelect($name, $id = null, $options = array(), $default = null) {
222 return $this->appendChild($this->createElementSelect($name, $id, $options, $default));
224 function appendElementOption($key, $desc, $selected = false) {
225 return $this->appendChild($this->createElementOption($key, $desc, $selected));
227 function appendLabel($for_id, $value) {
228 return $this->appendChild($this->createElementLabel($for_id, $value));
230 function appendText($text) {
231 return $this->appendChild($this->createTextNode($text));
233 function appendComment($comment_data) {
234 return $this->appendChild($this->createComment($comment_data));
236 function appendJSElement($jsdata) {
237 $this->appendChild($this->createElementJS($jsdata));
239 function appendCOMElement($module, $attributes) {
240 $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));
243 function appendHTMLMarkup($htmldata, $parentNode = null) {
244 if (is_null($parentNode)) { $parentNode =& $this; }
245 // XXX: just a workaround for now!
246 $parentNode->appendChild($this->createCDATASection($htmldata));
249 function appendXMLMarkup($xmldata, $parentNode = null) {
250 if (is_null($parentNode)) { $parentNode =& $this; }
251 $tmpdoc = new ExtendedDocument;
252 $tmpxml = '<?xml version="1.0" encoding="utf-8"?>'."\n";
253 $tmpxml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'."\n";
254 $tmpxml .= '<root>'.$xmldata.'</root>';
255 $tmpdoc->loadXML($tmpxml);
256 foreach ($tmpdoc->getElementsByTagName('root')->item(0)->childNodes as $child) {
257 $parentNode->appendChild($this->importNode($child, true));
261 function createElementLink($target, $value = '') {
262 $link = $this->createElement('a', $value);
263 $link->setAttribute('href', $target); // XXX: take care of & etc. in links
267 function createElementImage($src, $alt_text = '') {
268 $link = $this->createElement('img');
269 $link->setAttribute('src', $src);
270 $link->setAttribute('alt', $alt_text);
274 function createElementForm($action, $method, $name) {
275 $formelem = $this->createElement('form');
276 $formelem->setAttribute('action', $action);
277 $formelem->setAttribute('method', $method);
278 $formelem->setAttribute('name', $name);
282 function createElementInputHidden($name, $value) {
283 $hidden = $this->createElement('input');
284 $hidden->setAttribute('type', 'hidden');
285 $hidden->setAttribute('name', $name);
286 $hidden->setAttribute('value', $value);
290 function createElementInputText($name, $maxlength, $size, $id = null, $value = null) {
291 $txfield = $this->createElement('input');
292 $txfield->setAttribute('type', 'text');
293 if (!is_null($id)) { $txfield->setAttribute('id', $id); }
294 $txfield->setAttribute('name', $name);
295 $txfield->setAttribute('maxlength', $maxlength);
296 $txfield->setAttribute('size', $size);
297 if (!is_null($value)) { $txfield->setAttribute('value', $value); }
301 function createElementInputRadio($name, $id, $value, $checked) {
302 $radio = $this->createElement('input');
303 $radio->setAttribute('type', 'radio');
304 $radio->setAttribute('name', $name);
305 $radio->setAttribute('id', $id);
306 $radio->setAttribute('value', $value);
307 if ($checked) { $radio->setAttribute('checked', ''); }
311 function createElementInputCheckbox($name, $id, $value, $checked) {
312 $cbox = $this->createElement('input');
313 $cbox->setAttribute('type', 'checkbox');
314 $cbox->setAttribute('name', $name);
315 $cbox->setAttribute('id', $id);
316 $cbox->setAttribute('value', $value);
317 if ($checked) { $cbox->setAttribute('checked', ''); }
321 function createElementInputSubmit($value) {
322 $submitbtn = $this->createElement('input');
323 $submitbtn->setAttribute('type', 'submit');
324 $submitbtn->setAttribute('value', $value);
328 function createElementButton($value, $onclick = null) {
329 $btn = $this->createElement('input');
330 $btn->setAttribute('type', 'button');
331 $btn->setAttribute('value', $value);
332 if (!is_null($onclick)) { $btn->setAttribute('onclick', $onclick); }
336 function createElementTextArea($name, $columns, $rows, $id = null, $value = null) {
337 $txtarea = $this->createElement('textarea', $value);
338 $txtarea->setAttribute('name', $name);
339 $txtarea->setAttribute('cols', $columns);
340 $txtarea->setAttribute('rows', $rows);
341 if (!is_null($id)) { $txtarea->setAttribute('id', $id); }
345 function createElementSelect($name, $id = null, $options = array(), $default = null) {
346 $select = $this->createElement('select');
347 $select->setAttribute('name', $name);
348 if (!is_null($id)) { $select->setAttribute('id', $id); }
349 foreach ($options as $key => $desc) {
350 $select->appendElementOption($key, $desc, ($key == $default));
355 function createElementOption($key, $desc, $selected = false) {
356 $option = $this->createElement('option', $desc);
357 $option->setAttribute('value', $key);
358 if ($selected) { $option->setAttribute('selected', ''); }
362 function createElementLabel($for_id, $value) {
363 $label = $this->createElement('label', $value);
364 $label->setAttribute('for', $for_id);
368 function createElementJS($jsdata) {
369 $jselem = $this->createElement('script');
370 $jselem->setAttribute('type', 'text/javascript');
371 $jselem->appendChild($this->createCDATASection($jsdata));
375 function createCOMElement($module, $attributes) {
376 $com_elem = $this->createElementNS(COM_NS, $module);
377 if (is_array($attributes) && count($attributes)) {
378 foreach ($attributes as $name=>$value) {
379 $com_elem->setAttribute($name, $value);
386 class ExtendedElement extends DOMElement {
387 // ExtendedElement PHP class
388 // this extends the general PHP DOM Element class to simplify some usual constructs
390 // function appendElement($name, [$value])
391 // appends a DOMDocument::createElement() as a child of this element (see there for params)
392 // returns the new child
394 // function appendElementXML($name, $xmldata)
395 // appends a DOMDocument::createElement() with the given name as a child of this element,
396 // with an ExtendedDocument::createXMLFragment() of the given XML data inside
397 // returns the new child
399 // function appendLink($target, [$value])
400 // appends an ExtendedDocument::createElementLink() as a child of this element (see there for params)
401 // returns the new child
403 // function appendImage($src, [$alt_text])
404 // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params)
405 // returns the new child
407 // function appendFormDiv($action, $method, $name)
408 // appends an ExtendedDocument::createElementForm() as a child of this element (see there for params)
409 // returns an HTML <div> that is a child of the new child
411 // function appendInputHidden($name, $value)
412 // appends an ExtendedDocument::createElementInputHidden() as a child of this element (see there for params)
413 // returns the new child
415 // function appendInputText($name, $maxlength, $size, [$id], [$value])
416 // appends an ExtendedDocument::createElementInputText() as a child of this element (see there for params)
417 // returns the new child
419 // function appendInputRadio($name, $id, $value, $checked)
420 // appends an ExtendedDocument::createElementInputRadio() as a child of this element (see there for params)
421 // returns the new child
423 // function appendInputCheckbox($name, $id, $value, $checked)
424 // appends an ExtendedDocument::createElementInputCheckbox() as a child of this element (see there for params)
425 // returns the new child
427 // function appendInputSubmit($value)
428 // appends an ExtendedDocument::createElementInputSubmit() as a child of this element (see there for params)
429 // returns the new child
431 // function appendButton($value, $onclick = null)
432 // appends an ExtendedDocument::createElementButton() as a child of this element (see there for params)
433 // returns the new child
435 // function appendTextArea($name, $columns, $rows, [$id], [$value])
436 // appends an ExtendedDocument::createElementTextArea() as a child of this element (see there for params)
437 // returns the new child
439 // function appendElementSelect($name, [$id], [$options], [$default])
440 // appends an ExtendedDocument::createElementSelect() as a child of this element (see there for params)
441 // returns the new child
443 // function appendElementOption($key, $desc, [$selected])
444 // appends an ExtendedDocument::createElementOption() as a child of this element (see there for params)
445 // returns the new child
447 // function appendLabel($for_id, $value)
448 // appends an ExtendedDocument::createElementLabel() as a child of this element (see there for params)
449 // returns the new child
451 // function appendText($text)
452 // appends a DOMDocument::createTextNode() as a child of this element (see there for params)
453 // returns the new child
455 // function appendComment($comment_data)
456 // appends a DOMDocument::createComment() as a child of this element (see there for params)
457 // returns the new child
459 // function appendHTMLMarkup($htmldata)
460 // appends a representation of the HTML data as children of this element
463 // function appendXMLMarkup($xmldata)
464 // appends a representation of the XML data as children of this element
467 // function appendJSElement($jsdata)
468 // appends an ExtendedDocument::createElementJS() as a child of this element (see there for params)
471 // function appendCOMElement($module, $attributes)
472 // appends an ExtendedDocument::createCOMElement() as a child of this element (see there for params)
473 // returns the new child
475 function appendElement($name, $value = '') {
476 return $this->appendChild($this->ownerDocument->createElement($name, $value));
478 function appendElementXML($name, $xmldata) {
479 $aelem = $this->appendChild($this->ownerDocument->createElement($name));
480 $aelem->appendXMLMarkup($xmldata);
483 function appendLink($target, $value = '') {
484 return $this->appendChild($this->ownerDocument->createElementLink($target, $value));
486 function appendImage($src, $alt_text = '') {
487 return $this->appendChild($this->ownerDocument->createElementImage($src, $alt_text));
489 function appendFormDiv($action, $method, $name) {
490 $formelem = $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name));
491 return $formelem->appendElement('div');
493 function appendInputHidden($name, $value) {
494 return $this->appendChild($this->ownerDocument->createElementInputHidden($name, $value));
496 function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
497 return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $value));
499 function appendInputRadio($name, $id, $value, $checked) {
500 return $this->appendChild($this->ownerDocument->createElementInputRadio($name, $id, $value, $checked));
502 function appendInputCheckbox($name, $id, $value, $checked) {
503 return $this->appendChild($this->ownerDocument->createElementInputCheckbox($name, $id, $value, $checked));
505 function appendInputSubmit($value) {
506 return $this->appendChild($this->ownerDocument->createElementInputSubmit($value));
508 function appendButton($value, $onclick = null) {
509 return $this->appendChild($this->ownerDocument->createElementButton($value, $onclick));
511 function appendTextArea($name, $columns, $rows, $id = null, $value = null) {
512 return $this->appendChild($this->ownerDocument->createElementTextArea($name, $columns, $rows, $id, $value));
514 function appendElementSelect($name, $id = null, $options = array(), $default = null) {
515 return $this->appendChild($this->ownerDocument->createElementSelect($name, $id, $options, $default));
517 function appendElementOption($key, $desc, $selected = false) {
518 return $this->appendChild($this->ownerDocument->createElementOption($key, $desc, $selected));
520 function appendLabel($for_id, $value) {
521 return $this->appendChild($this->ownerDocument->createElementLabel($for_id, $value));
523 function appendText($text) {
524 return $this->appendChild($this->ownerDocument->createTextNode($text));
526 function appendComment($comment_data) {
527 return $this->appendChild($this->ownerDocument->createComment($comment_data));
529 function appendHTMLMarkup($htmldata) {
530 $this->ownerDocument->appendHTMLMarkup($htmldata, $this);
532 function appendXMLMarkup($xmldata) {
533 $this->ownerDocument->appendXMLMarkup($xmldata, $this);
535 function appendJSElement($jsdata) {
536 $this->appendChild($this->ownerDocument->createElementJS($jsdata));
538 function appendCOMElement($module, $attributes) {
539 $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));
543 class ExtendedDocumentFragment extends DOMDocumentFragment {
544 // ExtendedDocumentFragment PHP class
545 // this extends the general PHP DOM Document Fragment class to simplify some usual constructs
547 // function appendElement($name, [$value])
548 // appends a DOMDocument::createElement() as a child of this fragment (see there for params)
549 // returns the new child
551 // function appendElementXML($name, $xmldata)
552 // appends a DOMDocument::createElement() with the given name as a child of this fragment,
553 // with an ExtendedDocument::createXMLFragment() of the given XML data inside
554 // returns the new child
556 // function appendLink($target, [$value])
557 // appends an ExtendedDocument::createElementLink() as a child of this fragment (see there for params)
558 // returns the new child
560 // function appendImage($src, [$alt_text])
561 // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params)
562 // returns the new child
564 // function appendFormDiv($action, $method, $name)
565 // appends an ExtendedDocument::createElementForm() as a child of this fragment (see there for params)
566 // returns an HTML <div> that is a child of the new child
568 // function appendInputHidden($name, $value)
569 // appends an ExtendedDocument::createElementInputHidden() as a child of this fragment (see there for params)
570 // returns the new child
572 // function appendInputText($name, $maxlength, $size, [$id], [$value])
573 // appends an ExtendedDocument::createElementInputText() as a child of this fragment (see there for params)
574 // returns the new child
576 // function appendInputRadio($name, $id, $value, $checked)
577 // appends an ExtendedDocument::createElementInputRadio() as a child of this fragment (see there for params)
578 // returns the new child
580 // function appendInputCheckbox($name, $id, $value, $checked)
581 // appends an ExtendedDocument::createElementInputCheckbox() as a child of this fragment (see there for params)
582 // returns the new child
584 // function appendInputSubmit($value)
585 // appends an ExtendedDocument::createElementInputSubmit() as a child of this fragment (see there for params)
586 // returns the new child
588 // function appendButton($value, $onclick = null)
589 // appends an ExtendedDocument::createElementButton() as a child of this fragment (see there for params)
590 // returns the new child
592 // function appendTextArea($name, $columns, $rows, [$id], [$value])
593 // appends an ExtendedDocument::createElementTextArea() as a child of this fragment (see there for params)
594 // returns the new child
596 // function appendElementSelect($name, [$id], [$options], [$default])
597 // appends an ExtendedDocument::createElementSelect() as a child of this fragment (see there for params)
598 // returns the new child
600 // function appendElementOption($key, $desc, [$selected])
601 // appends an ExtendedDocument::createElementOption() as a child of this fragment (see there for params)
602 // returns the new child
604 // function appendLabel($for_id, $value)
605 // appends an ExtendedDocument::createElementLabel() as a child of this fragment (see there for params)
606 // returns the new child
608 // function appendText($text)
609 // appends a DOMDocument::createTextNode() as a child of this fragment (see there for params)
610 // returns the new child
612 // function appendComment($comment_data)
613 // appends a DOMDocument::createComment() as a child of this fragment (see there for params)
614 // returns the new child
616 // function appendHTMLMarkup($htmldata)
617 // appends a representation of the HTML data as children of this fragment
620 // function appendXMLMarkup($xmldata)
621 // appends a representation of the XML data as children of this fragment
624 // function appendJSElement($jsdata)
625 // appends an ExtendedDocument::createElementJS() as a child of this fragment (see there for params)
628 // function appendCOMElement($module, $attributes)
629 // appends an ExtendedDocument::createCOMElement() as a child of this fragment (see there for params)
630 // returns the new child
632 function appendElement($name, $value = '') {
633 return $this->appendChild($this->ownerDocument->createElement($name, $value));
635 function appendElementXML($name, $xmldata) {
636 $aelem = $this->appendChild($this->ownerDocument->createElement($name));
637 $aelem->appendXMLMarkup($xmldata);
640 function appendLink($target, $value = '') {
641 return $this->appendChild($this->ownerDocument->createElementLink($target, $value));
643 function appendImage($src, $alt_text = '') {
644 return $this->appendChild($this->ownerDocument->createElementImage($src, $alt_text));
646 function appendFormDiv($action, $method, $name) {
647 $formelem = $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name));
648 return $formelem->appendElement('div');
650 function appendInputHidden($name, $value) {
651 return $this->appendChild($this->ownerDocument->createElementInputHidden($name, $value));
653 function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
654 return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $value));
656 function appendInputRadio($name, $id, $value, $checked) {
657 return $this->appendChild($this->ownerDocument->createElementInputRadio($name, $id, $value, $checked));
659 function appendInputCheckbox($name, $id, $value, $checked) {
660 return $this->appendChild($this->ownerDocument->createElementInputCheckbox($name, $id, $value, $checked));
662 function appendInputSubmit($value) {
663 return $this->appendChild($this->ownerDocument->createElementInputSubmit($value));
665 function appendButton($value, $onclick = null) {
666 return $this->appendChild($this->ownerDocument->createElementButton($value, $onclick));
668 function appendTextArea($name, $columns, $rows, $id = null, $value = null) {
669 return $this->appendChild($this->ownerDocument->createElementTextArea($name, $columns, $rows, $id, $value));
671 function appendElementSelect($name, $id = null, $options = array(), $default = null) {
672 return $this->appendChild($this->ownerDocument->createElementSelect($name, $id, $options, $default));
674 function appendElementOption($key, $desc, $selected = false) {
675 return $this->appendChild($this->ownerDocument->createElementOption($key, $desc, $selected));
677 function appendLabel($for_id, $value) {
678 return $this->appendChild($this->ownerDocument->createElementLabel($for_id, $value));
680 function appendText($text) {
681 return $this->appendChild($this->ownerDocument->createTextNode($text));
683 function appendComment($comment_data) {
684 return $this->appendChild($this->ownerDocument->createComment($comment_data));
686 function appendHTMLMarkup($htmldata) {
687 $this->ownerDocument->appendHTMLMarkup($htmldata, $this);
689 function appendXMLMarkup($xmldata) {
690 $this->ownerDocument->appendXMLMarkup($xmldata, $this);
692 function appendJSElement($jsdata) {
693 $this->appendChild($this->ownerDocument->createElementJS($jsdata));
695 function appendCOMElement($module, $attributes) {
696 $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));