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 appendInputPassword($name, $maxlength, $size, [$id], [$value])
66 // appends an ExtendedDocument::createElementInputPassword() as a child of this document (see there for params)
67 // returns the new child
69 // function appendInputRadio($name, $id, $value, $checked)
70 // appends an ExtendedDocument::createElementInputRadio() as a child of this document (see there for params)
71 // returns the new child
73 // function appendInputCheckbox($name, $id, $value, $checked)
74 // appends an ExtendedDocument::createElementInputCheckbox() as a child of this document (see there for params)
75 // returns the new child
77 // function appendInputSubmit($value)
78 // appends an ExtendedDocument::createElementInputSubmit() as a child of this document (see there for params)
79 // returns the new child
81 // function appendButton($value, $onclick = null)
82 // appends an ExtendedDocument::createElementButton() as a child of this document (see there for params)
83 // returns the new child
85 // function appendTextArea($name, $columns, $rows, [$id], [$value])
86 // appends an ExtendedDocument::createElementTextArea() as a child of this document (see there for params)
87 // returns the new child
89 // function appendElementSelect($name, [$id], [$options], [$default])
90 // appends an ExtendedDocument::createElementSelect() as a child of this document (see there for params)
91 // returns the new child
93 // function appendElementOption($key, $desc, [$selected])
94 // appends an ExtendedDocument::createElementOption() as a child of this document (see there for params)
95 // returns the new child
97 // function appendLabel($for_id, $value)
98 // appends an ExtendedDocument::createElementLabel() as a child of this document (see there for params)
99 // returns the new child
101 // function appendText($text)
102 // appends a DOMDocument::createTextNode() as a child of this document (see there for params)
103 // returns the new child
105 // function appendComment($comment_data)
106 // appends a DOMDocument::createComment() as a child of this document (see there for params)
107 // returns the new child
109 // function appendHTMLMarkup($htmldata, [$parentNode])
110 // appends a representation of the HTML data as children of the given parent node, by default this document
113 // function appendXMLMarkup($xmldata, [$parentNode])
114 // appends a representation of the XML data as children of the given parent node, by default this document
117 // function appendJSElement($jsdata)
118 // appends an ExtendedDocument::createElementJS() as a child of this document (see there for params)
121 // function appendCOMElement($module, $attributes)
122 // appends an ExtendedDocument::createCOMElement() as a child of this document (see there for params)
123 // returns the new child
125 // function createElementLink($target, [$value])
126 // returns an ExtendedElement that is an HTML <a> with the given target (href) and (optional) value
128 // function createElementImage($src, [$alt_text])
129 // returns an ExtendedElement that is an HTML <img> with the given (src) and alt attributes (set to '' by default)
131 // function createElementForm($action, $method, $name)
132 // returns an ExtendedElement that is an HTML <div> that is a child of an HTML <form>
133 // with the given action, method, and name
135 // function createElementInputHidden($name, $value)
136 // returns an ExtendedElement that is an HTML <input> of type 'hidden' with the given name and value
138 // function createElementInputText($name, $maxlength, $size, [$id], [$value])
139 // returns an ExtendedElement that is an HTML <input> of type 'text' with the given name, maxlength, size,
140 // and optionally id and value
142 // function createElementInputPassword($name, $maxlength, $size, [$id], [$value])
143 // returns an ExtendedElement that is an HTML <input> of type 'password' with the given name, maxlength, size,
144 // and optionally id and value
146 // function createElementInputRadio($name, $id, $value, $checked)
147 // returns an ExtendedElement that is an HTML <input> of type 'radio' with the given name, id, value and
150 // function createElementInputCheckbox($name, $id, $value, $checked)
151 // returns an ExtendedElement that is an HTML <input> of type 'checkbox' with the given name, id, value and
154 // function createElementInputSubmit($value)
155 // returns an ExtendedElement that is an HTML <input> of type 'submit' with the given value as label
157 // function createElementButton($value, $onclick = null)
158 // returns an ExtendedElement that is an HTML button with the given value as label and optionally onclick attribute
160 // function createElementTextArea($name, $columns, $rows, [$id], [$value])
161 // returns an ExtendedElement that is an HTML <textarea> with the given name, columns, rows,
162 // and optionally id and value
164 // function createElementSelect($name, [$id], [$options], [$default])
165 // returns an ExtendedElement that is an HTML <select> with the given name, and optionally id,
166 // array of options (key => description) and key of the by-default selected entry
168 // function createElementOption($key, $desc, [$selected])
169 // returns an ExtendedElement that is an HTML <option> with the given key (value) and description (content)
170 // and optionally bool that tells if the entry is selected
172 // function createElementLabel($for_id, $value)
173 // returns an ExtendedElement that is an HTML <label> with the given 'for' and value
175 // function createElementJS($jsdata)
176 // returns an ExtendedElement that is an HTML <script> of JavaScript type with the JS data inside
178 // function createCOMElement($module, $attributes)
179 // returns an ExtendedElement that is in COM_NS namespace, with the given module as name and the
180 // given name=>value array as attributes
182 function __construct($version = '1.0', $encoding = 'utf-8') {
183 // make sure the default DOMDocument constructor runs
184 parent::__construct($version, $encoding);
185 $this->registerNodeClass('DOMElement', 'ExtendedElement');
186 $this->registerNodeClass('DOMDocumentFragment', 'ExtendedDocumentFragment');
189 function appendElement($name, $value = '') {
190 return $this->appendChild($this->createElement($name, $value));
192 function appendElementXML($name, $xmldata) {
193 $aelem = $this->appendChild($this->createElement($name));
194 $aelem->appendXMLMarkup($xmldata);
195 //$aelem->appendChild($this->createXMLFragment($xmldata));
198 function appendLink($target, $value = '') {
199 return $this->appendChild($this->createElementLink($target, $value));
201 function appendImage($src, $alt_text = '') {
202 return $this->appendChild($this->createElementImage($src, $alt_text));
204 function appendFormDiv($action, $method, $name) {
205 $formelem = $this->appendChild($this->createElementForm($action, $method, $name));
206 return $formelem->appendElement('div');
208 function appendInputHidden($name, $value) {
209 return $this->appendChild($this->createElementInputHidden($name, $value));
211 function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
212 return $this->appendChild($this->createElementInputText($name, $maxlength, $size, $id, $value));
214 function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
215 return $this->appendChild($this->createElementInputPassword($name, $maxlength, $size, $id, $value));
217 function appendInputRadio($name, $id, $value, $checked) {
218 return $this->appendChild($this->createElementInputRadio($name, $id, $value, $checked));
220 function appendInputCheckbox($name, $id, $value, $checked) {
221 return $this->appendChild($this->createElementInputCheckbox($name, $id, $value, $checked));
223 function appendInputSubmit($value) {
224 return $this->appendChild($this->createElementInputSubmit($value));
226 function appendButton($value, $onclick = null) {
227 return $this->appendChild($this->createElementButton($value, $onclick));
229 function appendTextArea($name, $columns, $rows, $id = null, $value = null) {
230 return $this->appendChild($this->createElementTextArea($name, $columns, $rows, $id, $value));
232 function appendElementSelect($name, $id = null, $options = array(), $default = null) {
233 return $this->appendChild($this->createElementSelect($name, $id, $options, $default));
235 function appendElementOption($key, $desc, $selected = false) {
236 return $this->appendChild($this->createElementOption($key, $desc, $selected));
238 function appendLabel($for_id, $value) {
239 return $this->appendChild($this->createElementLabel($for_id, $value));
241 function appendText($text) {
242 return $this->appendChild($this->createTextNode($text));
244 function appendComment($comment_data) {
245 return $this->appendChild($this->createComment($comment_data));
247 function appendJSElement($jsdata) {
248 $this->appendChild($this->createElementJS($jsdata));
250 function appendCOMElement($module, $attributes) {
251 $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));
254 function appendHTMLMarkup($htmldata, $parentNode = null) {
255 if (is_null($parentNode)) { $parentNode =& $this; }
256 // XXX: just a workaround for now!
257 $parentNode->appendChild($this->createCDATASection($htmldata));
260 function appendXMLMarkup($xmldata, $parentNode = null) {
261 if (is_null($parentNode)) { $parentNode =& $this; }
262 $tmpdoc = new ExtendedDocument;
263 $tmpxml = '<?xml version="1.0" encoding="utf-8"?>'."\n";
264 $tmpxml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'."\n";
265 $tmpxml .= '<root>'.$xmldata.'</root>';
266 $tmpdoc->loadXML($tmpxml);
267 foreach ($tmpdoc->getElementsByTagName('root')->item(0)->childNodes as $child) {
268 $parentNode->appendChild($this->importNode($child, true));
272 function createElementLink($target, $value = '') {
273 $link = $this->createElement('a', $value);
274 $link->setAttribute('href', $target); // XXX: take care of & etc. in links
278 function createElementImage($src, $alt_text = '') {
279 $img = $this->createElement('img');
280 $img->setAttribute('src', $src);
281 $img->setAttribute('alt', $alt_text);
285 function createElementForm($action, $method, $name) {
286 $formelem = $this->createElement('form');
287 $formelem->setAttribute('action', $action);
288 $formelem->setAttribute('method', $method);
289 $formelem->setAttribute('name', $name);
293 function createElementInputHidden($name, $value) {
294 $hidden = $this->createElement('input');
295 $hidden->setAttribute('type', 'hidden');
296 $hidden->setAttribute('name', $name);
297 $hidden->setAttribute('value', $value);
301 function createElementInputText($name, $maxlength, $size, $id = null, $value = null) {
302 $txfield = $this->createElement('input');
303 $txfield->setAttribute('type', 'text');
304 if (!is_null($id)) { $txfield->setAttribute('id', $id); }
305 $txfield->setAttribute('name', $name);
306 $txfield->setAttribute('maxlength', $maxlength);
307 $txfield->setAttribute('size', $size);
308 if (!is_null($value)) { $txfield->setAttribute('value', $value); }
312 function createElementInputPassword($name, $maxlength, $size, $id = null, $value = null) {
313 $pwfield = $this->createElement('input');
314 $pwfield->setAttribute('type', 'password');
315 if (!is_null($id)) { $pwfield->setAttribute('id', $id); }
316 $pwfield->setAttribute('name', $name);
317 $pwfield->setAttribute('maxlength', $maxlength);
318 $pwfield->setAttribute('size', $size);
319 if (!is_null($value)) { $pwfield->setAttribute('value', $value); }
323 function createElementInputRadio($name, $id, $value, $checked) {
324 $radio = $this->createElement('input');
325 $radio->setAttribute('type', 'radio');
326 $radio->setAttribute('name', $name);
327 $radio->setAttribute('id', $id);
328 $radio->setAttribute('value', $value);
329 if ($checked) { $radio->setAttribute('checked', ''); }
333 function createElementInputCheckbox($name, $id, $value, $checked) {
334 $cbox = $this->createElement('input');
335 $cbox->setAttribute('type', 'checkbox');
336 $cbox->setAttribute('name', $name);
337 $cbox->setAttribute('id', $id);
338 $cbox->setAttribute('value', $value);
339 if ($checked) { $cbox->setAttribute('checked', ''); }
343 function createElementInputSubmit($value) {
344 $submitbtn = $this->createElement('input');
345 $submitbtn->setAttribute('type', 'submit');
346 $submitbtn->setAttribute('value', $value);
350 function createElementButton($value, $onclick = null) {
351 $btn = $this->createElement('input');
352 $btn->setAttribute('type', 'button');
353 $btn->setAttribute('value', $value);
354 if (!is_null($onclick)) { $btn->setAttribute('onclick', $onclick); }
358 function createElementTextArea($name, $columns, $rows, $id = null, $value = null) {
359 $txtarea = $this->createElement('textarea', $value);
360 $txtarea->setAttribute('name', $name);
361 $txtarea->setAttribute('cols', $columns);
362 $txtarea->setAttribute('rows', $rows);
363 if (!is_null($id)) { $txtarea->setAttribute('id', $id); }
367 function createElementSelect($name, $id = null, $options = array(), $default = null) {
368 $select = $this->createElement('select');
369 $select->setAttribute('name', $name);
370 if (!is_null($id)) { $select->setAttribute('id', $id); }
371 foreach ($options as $key => $desc) {
372 $select->appendElementOption($key, $desc, ($key == $default));
377 function createElementOption($key, $desc, $selected = false) {
378 $option = $this->createElement('option', $desc);
379 $option->setAttribute('value', $key);
380 if ($selected) { $option->setAttribute('selected', ''); }
384 function createElementLabel($for_id, $value) {
385 $label = $this->createElement('label', $value);
386 $label->setAttribute('for', $for_id);
390 function createElementJS($jsdata) {
391 $jselem = $this->createElement('script');
392 $jselem->setAttribute('type', 'text/javascript');
393 $jselem->appendChild($this->createCDATASection($jsdata));
397 function createCOMElement($module, $attributes) {
398 $com_elem = $this->createElementNS(COM_NS, $module);
399 if (is_array($attributes) && count($attributes)) {
400 foreach ($attributes as $name=>$value) {
401 $com_elem->setAttribute($name, $value);
408 class ExtendedElement extends DOMElement {
409 // ExtendedElement PHP class
410 // this extends the general PHP DOM Element class to simplify some usual constructs
412 // function appendElement($name, [$value])
413 // appends a DOMDocument::createElement() as a child of this element (see there for params)
414 // returns the new child
416 // function appendElementXML($name, $xmldata)
417 // appends a DOMDocument::createElement() with the given name as a child of this element,
418 // with an ExtendedDocument::createXMLFragment() of the given XML data inside
419 // returns the new child
421 // function appendLink($target, [$value])
422 // appends an ExtendedDocument::createElementLink() as a child of this element (see there for params)
423 // returns the new child
425 // function appendImage($src, [$alt_text])
426 // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params)
427 // returns the new child
429 // function appendFormDiv($action, $method, $name)
430 // appends an ExtendedDocument::createElementForm() as a child of this element (see there for params)
431 // returns an HTML <div> that is a child of the new child
433 // function appendInputHidden($name, $value)
434 // appends an ExtendedDocument::createElementInputHidden() as a child of this element (see there for params)
435 // returns the new child
437 // function appendInputText($name, $maxlength, $size, [$id], [$value])
438 // appends an ExtendedDocument::createElementInputText() as a child of this element (see there for params)
439 // returns the new child
441 // function appendInputPassword($name, $maxlength, $size, [$id], [$value])
442 // appends an ExtendedDocument::createElementInputPassword() as a child of this element (see there for params)
443 // returns the new child
445 // function appendInputRadio($name, $id, $value, $checked)
446 // appends an ExtendedDocument::createElementInputRadio() as a child of this element (see there for params)
447 // returns the new child
449 // function appendInputCheckbox($name, $id, $value, $checked)
450 // appends an ExtendedDocument::createElementInputCheckbox() as a child of this element (see there for params)
451 // returns the new child
453 // function appendInputSubmit($value)
454 // appends an ExtendedDocument::createElementInputSubmit() as a child of this element (see there for params)
455 // returns the new child
457 // function appendButton($value, $onclick = null)
458 // appends an ExtendedDocument::createElementButton() as a child of this element (see there for params)
459 // returns the new child
461 // function appendTextArea($name, $columns, $rows, [$id], [$value])
462 // appends an ExtendedDocument::createElementTextArea() as a child of this element (see there for params)
463 // returns the new child
465 // function appendElementSelect($name, [$id], [$options], [$default])
466 // appends an ExtendedDocument::createElementSelect() as a child of this element (see there for params)
467 // returns the new child
469 // function appendElementOption($key, $desc, [$selected])
470 // appends an ExtendedDocument::createElementOption() as a child of this element (see there for params)
471 // returns the new child
473 // function appendLabel($for_id, $value)
474 // appends an ExtendedDocument::createElementLabel() as a child of this element (see there for params)
475 // returns the new child
477 // function appendText($text)
478 // appends a DOMDocument::createTextNode() as a child of this element (see there for params)
479 // returns the new child
481 // function appendComment($comment_data)
482 // appends a DOMDocument::createComment() as a child of this element (see there for params)
483 // returns the new child
485 // function appendHTMLMarkup($htmldata)
486 // appends a representation of the HTML data as children of this element
489 // function appendXMLMarkup($xmldata)
490 // appends a representation of the XML data as children of this element
493 // function appendJSElement($jsdata)
494 // appends an ExtendedDocument::createElementJS() as a child of this element (see there for params)
497 // function appendCOMElement($module, $attributes)
498 // appends an ExtendedDocument::createCOMElement() as a child of this element (see there for params)
499 // returns the new child
501 function appendElement($name, $value = '') {
502 return $this->appendChild($this->ownerDocument->createElement($name, $value));
504 function appendElementXML($name, $xmldata) {
505 $aelem = $this->appendChild($this->ownerDocument->createElement($name));
506 $aelem->appendXMLMarkup($xmldata);
509 function appendLink($target, $value = '') {
510 return $this->appendChild($this->ownerDocument->createElementLink($target, $value));
512 function appendImage($src, $alt_text = '') {
513 return $this->appendChild($this->ownerDocument->createElementImage($src, $alt_text));
515 function appendFormDiv($action, $method, $name) {
516 $formelem = $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name));
517 return $formelem->appendElement('div');
519 function appendInputHidden($name, $value) {
520 return $this->appendChild($this->ownerDocument->createElementInputHidden($name, $value));
522 function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
523 return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $value));
525 function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
526 return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value));
528 function appendInputRadio($name, $id, $value, $checked) {
529 return $this->appendChild($this->ownerDocument->createElementInputRadio($name, $id, $value, $checked));
531 function appendInputCheckbox($name, $id, $value, $checked) {
532 return $this->appendChild($this->ownerDocument->createElementInputCheckbox($name, $id, $value, $checked));
534 function appendInputSubmit($value) {
535 return $this->appendChild($this->ownerDocument->createElementInputSubmit($value));
537 function appendButton($value, $onclick = null) {
538 return $this->appendChild($this->ownerDocument->createElementButton($value, $onclick));
540 function appendTextArea($name, $columns, $rows, $id = null, $value = null) {
541 return $this->appendChild($this->ownerDocument->createElementTextArea($name, $columns, $rows, $id, $value));
543 function appendElementSelect($name, $id = null, $options = array(), $default = null) {
544 return $this->appendChild($this->ownerDocument->createElementSelect($name, $id, $options, $default));
546 function appendElementOption($key, $desc, $selected = false) {
547 return $this->appendChild($this->ownerDocument->createElementOption($key, $desc, $selected));
549 function appendLabel($for_id, $value) {
550 return $this->appendChild($this->ownerDocument->createElementLabel($for_id, $value));
552 function appendText($text) {
553 return $this->appendChild($this->ownerDocument->createTextNode($text));
555 function appendComment($comment_data) {
556 return $this->appendChild($this->ownerDocument->createComment($comment_data));
558 function appendHTMLMarkup($htmldata) {
559 $this->ownerDocument->appendHTMLMarkup($htmldata, $this);
561 function appendXMLMarkup($xmldata) {
562 $this->ownerDocument->appendXMLMarkup($xmldata, $this);
564 function appendJSElement($jsdata) {
565 $this->appendChild($this->ownerDocument->createElementJS($jsdata));
567 function appendCOMElement($module, $attributes) {
568 $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));
572 class ExtendedDocumentFragment extends DOMDocumentFragment {
573 // ExtendedDocumentFragment PHP class
574 // this extends the general PHP DOM Document Fragment class to simplify some usual constructs
576 // function appendElement($name, [$value])
577 // appends a DOMDocument::createElement() as a child of this fragment (see there for params)
578 // returns the new child
580 // function appendElementXML($name, $xmldata)
581 // appends a DOMDocument::createElement() with the given name as a child of this fragment,
582 // with an ExtendedDocument::createXMLFragment() of the given XML data inside
583 // returns the new child
585 // function appendLink($target, [$value])
586 // appends an ExtendedDocument::createElementLink() as a child of this fragment (see there for params)
587 // returns the new child
589 // function appendImage($src, [$alt_text])
590 // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params)
591 // returns the new child
593 // function appendFormDiv($action, $method, $name)
594 // appends an ExtendedDocument::createElementForm() as a child of this fragment (see there for params)
595 // returns an HTML <div> that is a child of the new child
597 // function appendInputHidden($name, $value)
598 // appends an ExtendedDocument::createElementInputHidden() as a child of this fragment (see there for params)
599 // returns the new child
601 // function appendInputText($name, $maxlength, $size, [$id], [$value])
602 // appends an ExtendedDocument::createElementInputText() as a child of this fragment (see there for params)
603 // returns the new child
605 // function appendInputPassword($name, $maxlength, $size, [$id], [$value])
606 // appends an ExtendedDocument::createElementInputPassword() as a child of this fragment (see there for params)
607 // returns the new child
609 // function appendInputRadio($name, $id, $value, $checked)
610 // appends an ExtendedDocument::createElementInputRadio() as a child of this fragment (see there for params)
611 // returns the new child
613 // function appendInputCheckbox($name, $id, $value, $checked)
614 // appends an ExtendedDocument::createElementInputCheckbox() as a child of this fragment (see there for params)
615 // returns the new child
617 // function appendInputSubmit($value)
618 // appends an ExtendedDocument::createElementInputSubmit() as a child of this fragment (see there for params)
619 // returns the new child
621 // function appendButton($value, $onclick = null)
622 // appends an ExtendedDocument::createElementButton() as a child of this fragment (see there for params)
623 // returns the new child
625 // function appendTextArea($name, $columns, $rows, [$id], [$value])
626 // appends an ExtendedDocument::createElementTextArea() as a child of this fragment (see there for params)
627 // returns the new child
629 // function appendElementSelect($name, [$id], [$options], [$default])
630 // appends an ExtendedDocument::createElementSelect() as a child of this fragment (see there for params)
631 // returns the new child
633 // function appendElementOption($key, $desc, [$selected])
634 // appends an ExtendedDocument::createElementOption() as a child of this fragment (see there for params)
635 // returns the new child
637 // function appendLabel($for_id, $value)
638 // appends an ExtendedDocument::createElementLabel() as a child of this fragment (see there for params)
639 // returns the new child
641 // function appendText($text)
642 // appends a DOMDocument::createTextNode() as a child of this fragment (see there for params)
643 // returns the new child
645 // function appendComment($comment_data)
646 // appends a DOMDocument::createComment() as a child of this fragment (see there for params)
647 // returns the new child
649 // function appendHTMLMarkup($htmldata)
650 // appends a representation of the HTML data as children of this fragment
653 // function appendXMLMarkup($xmldata)
654 // appends a representation of the XML data as children of this fragment
657 // function appendJSElement($jsdata)
658 // appends an ExtendedDocument::createElementJS() as a child of this fragment (see there for params)
661 // function appendCOMElement($module, $attributes)
662 // appends an ExtendedDocument::createCOMElement() as a child of this fragment (see there for params)
663 // returns the new child
665 function appendElement($name, $value = '') {
666 return $this->appendChild($this->ownerDocument->createElement($name, $value));
668 function appendElementXML($name, $xmldata) {
669 $aelem = $this->appendChild($this->ownerDocument->createElement($name));
670 $aelem->appendXMLMarkup($xmldata);
673 function appendLink($target, $value = '') {
674 return $this->appendChild($this->ownerDocument->createElementLink($target, $value));
676 function appendImage($src, $alt_text = '') {
677 return $this->appendChild($this->ownerDocument->createElementImage($src, $alt_text));
679 function appendFormDiv($action, $method, $name) {
680 $formelem = $this->appendChild($this->ownerDocument->createElementForm($action, $method, $name));
681 return $formelem->appendElement('div');
683 function appendInputHidden($name, $value) {
684 return $this->appendChild($this->ownerDocument->createElementInputHidden($name, $value));
686 function appendInputText($name, $maxlength, $size, $id = null, $value = null) {
687 return $this->appendChild($this->ownerDocument->createElementInputText($name, $maxlength, $size, $id, $value));
689 function appendInputPassword($name, $maxlength, $size, $id = null, $value = null) {
690 return $this->appendChild($this->ownerDocument->createElementInputPassword($name, $maxlength, $size, $id, $value));
692 function appendInputRadio($name, $id, $value, $checked) {
693 return $this->appendChild($this->ownerDocument->createElementInputRadio($name, $id, $value, $checked));
695 function appendInputCheckbox($name, $id, $value, $checked) {
696 return $this->appendChild($this->ownerDocument->createElementInputCheckbox($name, $id, $value, $checked));
698 function appendInputSubmit($value) {
699 return $this->appendChild($this->ownerDocument->createElementInputSubmit($value));
701 function appendButton($value, $onclick = null) {
702 return $this->appendChild($this->ownerDocument->createElementButton($value, $onclick));
704 function appendTextArea($name, $columns, $rows, $id = null, $value = null) {
705 return $this->appendChild($this->ownerDocument->createElementTextArea($name, $columns, $rows, $id, $value));
707 function appendElementSelect($name, $id = null, $options = array(), $default = null) {
708 return $this->appendChild($this->ownerDocument->createElementSelect($name, $id, $options, $default));
710 function appendElementOption($key, $desc, $selected = false) {
711 return $this->appendChild($this->ownerDocument->createElementOption($key, $desc, $selected));
713 function appendLabel($for_id, $value) {
714 return $this->appendChild($this->ownerDocument->createElementLabel($for_id, $value));
716 function appendText($text) {
717 return $this->appendChild($this->ownerDocument->createTextNode($text));
719 function appendComment($comment_data) {
720 return $this->appendChild($this->ownerDocument->createComment($comment_data));
722 function appendHTMLMarkup($htmldata) {
723 $this->ownerDocument->appendHTMLMarkup($htmldata, $this);
725 function appendXMLMarkup($xmldata) {
726 $this->ownerDocument->appendXMLMarkup($xmldata, $this);
728 function appendJSElement($jsdata) {
729 $this->appendChild($this->ownerDocument->createElementJS($jsdata));
731 function appendCOMElement($module, $attributes) {
732 $this->appendChild($this->ownerDocument->createCOMElement($module, $attributes));