X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=blobdiff_plain;f=classes%2Fdocument.php-class;fp=classes%2Fdocument.php-class;h=41e817a4d96b678740e1fa0ca82591a886af529c;hp=0000000000000000000000000000000000000000;hb=7b9ebce7d25e4eaa557e8a64f8b1ed15aad1a9bb;hpb=6638efd5690cd46471a3e01c164e572956a34aa3 diff --git a/classes/document.php-class b/classes/document.php-class new file mode 100755 index 0000000..41e817a --- /dev/null +++ b/classes/document.php-class @@ -0,0 +1,938 @@ + + * + * ***** END LICENSE BLOCK ***** */ + +class ExtendedDocument extends DOMDocument { + // ExtendedDocument PHP class + // this extends the general PHP DOM Document class to simplify some usual constructs + // + // function __construct([$version], [$encoding]) + // CONSTRUCTOR + // construct a new DOM Document that uses our element definitions + // + // static function initHTML5() + // initialize as an HTML5 document and return references to its basic elements. + // returns an associative array with the following elements: 'html', 'head', 'title', 'body' + // + // public function appendElement($name, [$value]) + // appends a DOMDocument::createElement() as a child of this document (see there for params) + // returns the new child + // + // public function appendElementXML($name, $xmldata) + // appends a DOMDocument::createElement() with the given name as a child of this document, + // with an ExtendedDocument::createXMLFragment() of the given XML data inside + // returns the new child + // + // public function appendLink($target, [$value]) + // appends an ExtendedDocument::createElementLink() as a child of this document (see there for params) + // returns the new child + // + // public function appendImage($src, [$alt_text]) + // appends an ExtendedDocument::createElementImage() as a child of this document (see there for params) + // returns the new child + // + // public function appendForm($action, $method, $name, [$id]) + // appends an ExtendedDocument::createElementForm() as a child of this document (see there for params) + // returns the new child + // + // public function appendFormDiv($action, $method, $name, [$id]) + // appends an ExtendedDocument::createElementForm() as a child of this document (see there for params) + // returns an HTML
that is a child of the new child + // + // public function appendInputHidden($name, $value) + // appends an ExtendedDocument::createElementInputHidden() as a child of this document (see there for params) + // returns the new child + // + // public function appendInputText($name, $maxlength, $size, [$id], [$value]) + // appends an ExtendedDocument::createElementInputText() as a child of this document (see there for params) + // returns the new child + // + // public function appendInputNumber($name, $maxlength, $size, [$id], [$value]) + // appends an ExtendedDocument::createElementInputNumber() as a child of this document (see there for params) + // returns the new child + // + // public function appendInputEmail($name, $maxlength, $size, [$id], [$value]) + // appends an ExtendedDocument::createElementInputEmail() as a child of this document (see there for params) + // returns the new child + // + // public function appendInputPassword($name, $maxlength, $size, [$id], [$value]) + // appends an ExtendedDocument::createElementInputPassword() as a child of this document (see there for params) + // returns the new child + // + // public function appendInputRadio($name, $id, $value, $checked) + // appends an ExtendedDocument::createElementInputRadio() as a child of this document (see there for params) + // returns the new child + // + // public function appendInputCheckbox($name, $id, $value, $checked) + // appends an ExtendedDocument::createElementInputCheckbox() as a child of this document (see there for params) + // returns the new child + // + // public function appendInputFile($name, $id, $accept) + // appends an ExtendedDocument::createElementInputFile() as a child of this document (see there for params) + // returns the new child + // + // public function appendInputSubmit($value) + // appends an ExtendedDocument::createElementInputSubmit() as a child of this document (see there for params) + // returns the new child + // + // public function appendButton($value, $onclick = null) + // appends an ExtendedDocument::createElementButton() as a child of this document (see there for params) + // returns the new child + // + // public function appendTextArea($name, $columns, $rows, [$id], [$value]) + // appends an ExtendedDocument::createElementTextArea() as a child of this document (see there for params) + // returns the new child + // + // public function appendElementSelect($name, [$id], [$options], [$default]) + // appends an ExtendedDocument::createElementSelect() as a child of this document (see there for params) + // returns the new child + // + // public function appendElementOption($key, $desc, [$selected]) + // appends an ExtendedDocument::createElementOption() as a child of this document (see there for params) + // returns the new child + // + // public function appendLabel($for_id, $value) + // appends an ExtendedDocument::createElementLabel() as a child of this document (see there for params) + // returns the new child + // + // public function appendText($text) + // appends a DOMDocument::createTextNode() as a child of this document (see there for params) + // returns the new child + // + // public function appendEntity($name) + // appends a DOMDocument::createEntityReference() as a child of this document (see there for params) + // returns the new child + // + // public function appendComment($comment_data) + // appends a DOMDocument::createComment() as a child of this document (see there for params) + // returns the new child + // + // public function appendHTMLMarkup($htmldata, [$parentNode]) + // appends a representation of the HTML data as children of the given parent node, by default this document + // NO return value! + // + // public function appendXMLMarkup($xmldata, [$parentNode]) + // appends a representation of the XML data as children of the given parent node, by default this document + // NO return value! + // + // public function appendJSElement($jsdata) + // appends an ExtendedDocument::createElementJS() as a child of this document (see there for params) + // NO return value! + // + // public function appendJSFile($jsURL) + // appends an ExtendedDocument::createElementJSFile() as a child of this document (see there for params) + // returns the new child + // + // public function appendCOMElement($module, $attributes) + // appends an ExtendedDocument::createCOMElement() as a child of this document (see there for params) + // returns the new child + // + // public function createElementLink($target, [$value]) + // returns an ExtendedElement that is an HTML with the given target (href) and (optional) value + // + // public function createElementImage($src, [$alt_text]) + // 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 + // + // public function createElementInputHidden($name, $value) + // returns an ExtendedElement that is an HTML of type 'hidden' with the given name and value + // + // public function createElementInputText($name, $maxlength, $size, [$id], [$value]) + // returns an ExtendedElement that is an HTML of type 'text' with the given name, maxlength, size, + // and optionally id and value + // + // public function createElementInputNumber($name, $maxlength, $size, [$id], [$value]) + // returns an ExtendedElement that is an HTML of type 'number' with the given name, maxlength, size, + // and optionally id and value + // + // public function createElementInputEmail($name, $maxlength, $size, [$id], [$value]) + // returns an ExtendedElement that is an HTML of type 'email' with the given name, maxlength, size, + // and optionally id and value + // + // public function createElementInputPassword($name, $maxlength, $size, [$id], [$value]) + // returns an ExtendedElement that is an HTML of type 'password' with the given name, maxlength, size, + // and optionally id and value + // + // public function createElementInputRadio($name, $id, $value, $checked) + // returns an ExtendedElement that is an HTML of type 'radio' with the given name, id, value and + // checked state + // + // public function createElementInputCheckbox($name, $id, $value, $checked) + // returns an ExtendedElement that is an HTML of type 'checkbox' with the given name, id, value and + // checked state + // + // public function createElementInputFile($name, $id, $accept) + // returns an ExtendedElement that is an HTML of type 'file' with the given name, id and accept + // + // public function createElementInputSubmit($value) + // returns an ExtendedElement that is an HTML of type 'submit' with the given value as label + // + // public function createElementButton($value, $onclick = null) + // returns an ExtendedElement that is an HTML button with the given value as label and optionally onclick attribute + // + // public function createElementTextArea($name, $columns, $rows, [$id], [$value]) + // returns an ExtendedElement that is an HTML