Creates HTML document.

@return \DOMDocument
510634
protected function getDocument()
    {
        if (null === $this->document) {
            $this->document = \DOMImplementation::createDocument(
                'http://www.w3.org/1999/xhtml',
                'html',
                \DOMImplementation::createDocumentType(
                    'html',
                    '-//W3C//DTD XHTML 1.0 Strict//EN',
                    'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'
                )
            );
        }

        return $this->document;
    }
1107532
public function toHtml() {

        // Add the class at the last minute.
        if ($this->get_force_ltr()) {
            if (!isset($this->_attributes['class'])) {
                $this->_attributes['class'] = 'text-ltr';
            } else {
                $this->_attributes['class'] .= ' text-ltr';
            }
        }

        $this->_generateId();
        if ($this->_flagFrozen) {
            return $this->getFrozenHtml();
        }
        $html = $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />';

        if ($this->_hiddenLabel){
            return '<label class="accesshide" for="'.$this->getAttribute('id').'" >'.
                        $this->getLabel() . '</label>' . $html;
        } else {
             return $html;
        }
    }
131469
public function toHtml()
	{
		$html = '';
		
		// if this group isn't a destination
		if ( ! $this->isDestination()) {
			// set the first element's "old" style to the group's style
			$oldStyle = $this->style;
			
			// define a flag indicating whether or not this group is the root group
			//
			// setting this flag here feel a little hackish!
			// however, the first element in the first group is different than the first
			//     element in any other group
			//
			$isFirstGroup = empty($this->parent);
			
			// a flag indicating whether or not the element is the first "textual" element
			//     in the group (i.e., control word with a special symbol, an actual text
			//     element, etc)
			//
			$isFirstTextualElement = true;
			
			// loop through the group's children
			foreach ($this->children as $child) {
				// if the child is a textual element
				$string = $child->format('html');
				if ( ! empty($string)) {
					// get the child's style
					$newStyle = $child->getStyle();
					// if the child is the first textual element in the first (aka, "root") group
					if ($isFirstGroup && $isFirstTextualElement) {
						// open the document's first section, paragraph, and character tags
						$html .= '<section style="'.$newStyle->getSection()->format('css').'">'
							 . '<p style="'.$newStyle->getParagraph()->format('css').'">'
							 . '<span style="'.$newStyle->getCharacter()->format('css').'">';
						// set the flag to false
						$isFirstTextualElement = false;
					} else {
						// otherwise, the child is not the first textual element in the root group 
						//    and we only close and open the section, paragraph, and character tags
						//    if the style has changed between elements
						//
						// keep in mind, a section takes precedence over a paragraph and a character;
						//     a paragraph takes precedence over a character; so on and so forth
						//
						if ($oldStyle->getSection() != $newStyle->getSection()) {
							$html .= '</span></p></section>'
								. '<section style="'.$newStyle->getSection()->format('css').'">'
								. '<p style="'.$newStyle->getParagraph()->format('css').'">'
								. '<span style="'.$newStyle->getCharacter()->format('css').'">';
						} elseif ($oldStyle->getParagraph() != $newStyle->getParagraph()) {
							$html .= '</span></p>'
								. '<p style="'.$newStyle->getParagraph()->format('css').'">'
								. '<span style="'.$newStyle->getCharacter()->format('css').'">';
						} elseif ($oldStyle->getCharacter() != $newStyle->getCharacter()) {
							$html .= '</span>'
								. '<span style="'.$newStyle->getCharacter()->format('css').'">';
						}
					}
					
					// append the html string
					$html .= $string;
					
					// set the "old" style to the current element's style for the next iteration
					$oldStyle = $newStyle;
				}
			}
		}
		
		return $html;
	}
637644
public function getDocument()
    {
        $doc = new Document();
        $doc->setData($this->getSource());
        $hit = $this->getHit();
        unset($hit['_source']);
        unset($hit['_explanation']);
        unset($hit['highlight']);
        unset($hit['_score']);
        $doc->setParams($hit);

        return $doc;
    }
1251130
public function toDOM(\DOMDocument $doc): \DOMNode
    {
        $paragraph = $doc->createElement('p');

        $this->customAttributesToDOM($paragraph);
        $this->containerToDOM($doc, $paragraph);

        return $paragraph;
    }
822802
public function CreatePage()
	{
		$myWords = $this->WordCollection();

		$ht = array();
		$hasError = false;

		if ($this->_fromName == "")
		{
			$ht[$myWords->Value("FLDNAME")] = $myWords->Value("ERRORBLANK");
			$hasError = true;
		}
		if ($this->_fromEmail == "")
		{
			$ht[$myWords->Value("FLDEMAIL")] = $myWords->Value("ERRORBLANK");
			$hasError = true;
		}
		else
		{
			if (strrpos( $this->_fromEmail, "@") === false )
			{
				$ht[$myWords->Value("FLDEMAIL")] = $myWords->Value("FLDEMAIL") . " " . $myWords->Value("ERRORINVALID");
				$hasError = true;
			}
		}
		if ($this->_subject == "")
		{
			$ht[$myWords->Value("FLDSUBJECT")] = $myWords->Value("ERRORBLANK");
			$hasError = true;
		}
		if ($this->_message == "")
		{
			$ht[$myWords->Value("FLDMESSAGE")] = $myWords->Value("ERRORBLANK");
			$hasError = true;
		}

		if  ($hasError)
		{
			return $this->CreatePageArgs($myWords->Value("MSGERROR"), $ht);
		}
		elseif (!XmlInputImageValidate::validateText($this->_context))
		{
			$document = new XmlnukeDocument($myWords->ValueArgs("TITLE", array( $this->_context->get("SERVER_NAME")) ), $myWords->ValueArgs("ABSTRACT", array( $this->_context->get("SERVER_NAME")) ));
			$blockcenter = new XmlBlockCollection($myWords->Value("MSGERROR"), BlockPosition::Center );
			$document->addXmlnukeObject($blockcenter);

			$form = new XmlFormCollection($this->_context, "module:sendemail", $myWords->Value("MSGERROR"));
			$form->addXmlnukeObject(new XmlInputCaption($myWords->Value("RETRYVALIDATE")));
			$form->addXmlnukeObject(new XmlInputHidden("toname_id", $this->_context->get("toname_id")));
			$form->addXmlnukeObject(new XmlInputHidden("name", $this->_context->get("name")));
			$form->addXmlnukeObject(new XmlInputHidden("email", $this->_context->get("email")));
			$form->addXmlnukeObject(new XmlInputHidden("subject", $this->_context->get("subject")));
			$form->addXmlnukeObject(new XmlInputHidden("message", $this->_extraMessage . $this->_context->get("message")));
			$form->addXmlnukeObject(new XmlInputHidden("redirect", $this->_context->get("redirect")));
			$form->addXmlnukeObject(new XmlInputImageValidate(""));
			$buttons = new XmlInputButtons();
			$buttons->addSubmit($myWords->Value("RETRY"), "");
			$form->addXmlnukeObject($buttons);
			$blockcenter->addXmlnukeObject($form);

			return $document->generatePage();
		}
		else
		{
			$envelope = new MailEnvelope(MailUtil::getEmailFromID($this->_toName_ID), $this->_subject, $this->_extraMessage . $this->_message);
			$envelope->setFrom(MailUtil::getEmailFromID("DEFAULT", $this->_fromName));
			$envelope->setReplyTo(\ByJG\Mail\Util::getFullEmail($this->_fromEmail, $this->_fromName));
			$envelope->setBCC($this->_fromEmail);
			$envelope->Send();

			if ($this->_redirect != "")
			{
				//Redirect Here!!
				//Response.End
				return $document->generatePage();
			}
			else
			{
				$ht[$myWords->Value("FLDNAME")] = $this->_fromName . " [" . $this->_fromEmail . "]" ;
				$ht[$myWords->Value("FLDSUBJECT")] = $this->_subject;
				$ht[$myWords->Value("FLDMESSAGE")] = $this->_message ;

				return $this->CreatePageArgs($myWords->Value("MSGOK"), $ht);
			}
		}
	}
506624
public function render(\DOMDocument $domDocument)
    {
        $frame = new Frame();
        $frame->setAlign($this->hAlign, $this->vAlign);
        $frame->setPosition($this->posX, $this->posy);
        $frame->addClasses($this->frameClasses);
        $frame->setSize($this->getWidth(), $this->getHeight()+4);
        
        $startY = $this->startY;

        foreach ($this->elements as $idx => $element) {
            $element->setY($startY);
            $startY -= $element->getHeight() + $this->margin;
            $frame->addChild($element);
        }

        return $frame->render($domDocument);
    }
168327
public function getInnerHtml()
    {
        $html = '';
        if ($content_node = $this->getFirstElmNode()) {
            $document = $content_node->ownerDocument;

            foreach ($content_node->childNodes as $node) {
                if ($this->xml_mode) {
                    $html .= $document->saveXML($node);
                } else {
                    $html .= $document->saveHTML($node);
                }
            }

            $html = $this->handleHtmlResult($html);
        }

        return $html;
    }
636977
public function buildHtml()
	{
		$list	= array();
		$divs	= array();
		foreach( $this->steps as $nr => $step )
		{
			$id		= $this->id."_link".$nr;
			$list[]	= UI_HTML_Elements::ListItem( $step['label'], 0, array( 'id' => $id ) );
			$id		= $this->id."_".$nr;
			$divs[] = UI_HTML_Tag::create( 'div', $step['content'], array( 'id' => $id ) );
		}
		$list	= UI_HTML_Elements::unorderedList( $list );
		$divs	= implode( "\n", $divs );
		$div	= UI_HTML_Tag::create( 'div', "\n".$list.$divs."\n", array( 'id' => $this->id ) );
		return $div;
	}
1309253
protected function getDomDocument()
    {
        if(null === $this->domDocument)
        {
            $this->domDocument = new \DOMDocument($this->getVersion(), $this->getEncoding());
            $this->domDocument->formatOutput = $this->formatOutputFlag;
        }

        return $this->domDocument;
    }
938974
protected function createBasicDocument()
    {
        $this->doc->loadXML(
            '<?xml version="1.0" encoding="UTF-8"?>' .
            '<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"><file><body></body></file></xliff>',
            LIBXML_NSCLEAN
        );

        // Set some basic information.
        $this->setDataType('plaintext');
        $this->setDate(time());
        $this->setOriginal('');
        $this->setSrcLang('en');
        $this->setTgtLang('en');
    }
1348165
protected function createBlankDom()
    {
        $dom = new \DOMDocument();
        $dom->preserveWhiteSpace = false;
        $dom->formatOutput = true;

        return $dom;
    }
534922
function toHtml(){

        $id     = $this->_attributes['id'];
        $elname = $this->_attributes['name'];

        // Add the class at the last minute.
        if ($this->get_force_ltr()) {
            if (!isset($this->_attributes['class'])) {
                $this->_attributes['class'] = 'text-ltr';
            } else {
                $this->_attributes['class'] .= ' text-ltr';
            }
        }

        if ($this->_hiddenLabel) {
            $this->_generateId();
            $str = '<label class="accesshide" for="'.$this->getAttribute('id').'" >'.
                        $this->getLabel().'</label>'.parent::toHtml();
        } else {
            $str = parent::toHtml();
        }
        if (empty($this->_options['usefilepicker'])) {
            return $str;
        }

        // Print out file picker.
        $str .= $this->getFilePickerHTML();
        $str = '<div id="url-wrapper-' . $this->get_filepicker_unique_id() . '">' . $str . '</div>';

        return $str;
    }
239341
public function html()
    {
        if ($this::$callback !== null) {
            call_user_func($this::$callback, $this);
        }

        return trim($this->document->saveHTML($this->document->documentElement));
    }
692553
protected function createSubHTML()
    {
        // prepare the subObject, if never prepare before
        if (self::$_subobj === null) {
            $this->_prepareSubObj();
        }

        // calculate the width to use
        if ($this->parsingCss->value['width']) {
            $marge = $this->parsingCss->value['padding']['l'] + $this->parsingCss->value['padding']['r'];
            $marge+= $this->parsingCss->value['border']['l']['width'] + $this->parsingCss->value['border']['r']['width'];
            $marge = $this->pdf->getW() - $this->parsingCss->value['width'] + $marge;
        } else {
            $marge = $this->_margeLeft+$this->_margeRight;
        }

        // BUGFIX : we have to call the method, because of a bug in php 5.1.6
        self::$_subobj->pdf->getPage();

        // clone the sub object
        $subHtml = clone self::$_subobj;
        $subHtml->parsingCss->table = $this->parsingCss->table;
        $subHtml->parsingCss->value = $this->parsingCss->value;
        $subHtml->initSubHtml(
            $this->_format,
            $this->_orientation,
            $marge,
            $this->_page,
            $this->_defList,
            $this->pdf->getMyLastPageGroup(),
            $this->pdf->getMyLastPageGroupNb()
        );

        return $subHtml;
    }
15592
public function createXmlDocument()
    {
        $dom = new \DOMDocument('1.0', 'utf-8');
        $dom->formatOutput = true;
        $rss = $dom->appendChild($dom->createElement('rss'));

        $version = $dom->createAttribute('version');
        $version->appendChild($dom->createTextNode('2.0'));
        $rss->appendChild($version);

        $datetime = $this->publishDate ? $this->publishDate : new \DateTime('now');
        $datetime = $datetime->format('M d Y H:i:s');

        $channel = $rss->appendChild($dom->createElement('channel'));
        $channel->appendChild($dom->createElement('title', $this->title));
        $channel->appendChild($dom->createElement('link', $this->link));
        $channel->appendChild($dom->createElement('description', $this->description));
        $channel->appendChild($dom->createElement('lastBuildDate', $datetime));
        $channel->appendChild($dom->createElement('pubDate', $datetime));

        foreach ($this->items as $item) {
            $description = $item->getDescription();
            $description = str_replace(array("\r\n", "\r", "\n"), "<br /> ", $description);
            $description = html_entity_decode(strip_tags($description), ENT_QUOTES, 'utf-8');

            $node = $channel->appendChild($dom->createElement('item'));
            $node->appendChild($dom->createElement('title', $item->getTitle()));
            $node->appendChild($dom->createElement('link', $item->getLink()));
            $node->appendChild($dom->createElement('description', $description));
            $node->appendChild($dom->createElement('pubDate', $item->getPublishDate()));
        }

        return $dom->saveXML();
    }
595839
public function getHtml()
    {
        $html = new Core\Tag(
            'html',
            array((isset($this->args[1]) ? $this->args[1] : null)),
            array('generate', 'start')
        );
        $html->setAttrs($this->htmlattrs);

        return $html;
    }