Create html 5 document type.

@return  string

@throws  \Exception
336805
public function type()
    {
        $lang = $this->lang();
        $html = [
            '<!doctype html>',
            '<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7 ie6" '
            . 'lang="' . $lang . '" dir="' . $this->dir . '"> <![endif]-->',
            '<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8 ie7" '
            . 'lang="' . $lang . '" dir="' . $this->dir . '"> <![endif]-->',
            '<!--[if IE 8]><html class="no-js lt-ie9 ie8" '
            . 'lang="' . $lang . '" dir="' . $this->dir . '"> <![endif]-->',
            '<!--[if gt IE 8]><!--><html class="no-js" xmlns="http://www.w3.org/1999/xhtml" '
            . 'lang="' . $lang . '" dir="' . $this->dir . '" '
            . 'prefix="og: http://ogp.me/ns#" '
            . '> <!--<![endif]-->',
        ];
        return implode($this->eol, $html) . $this->eol;
    }
757722
public function create()
    {
        $class = $this->getClass();
        $contentType = new $class();

        $schema = $this->schemaManager->create();
        $schema->setObjectClass($this->contentManager->getClass());

        $contentType->setSchema($schema);

        return $contentType;
    }
601064
public function getHtml(): string
  {
    $this->attributes['type'] = 'file';
    $this->attributes['name'] = $this->submitName;

    $ret = $this->prefix;
    $ret .= $this->getHtmlPrefixLabel();
    $ret .= Html::generateVoidElement('input', $this->attributes);
    $ret .= $this->getHtmlPostfixLabel();
    $ret .= $this->postfix;

    return $ret;
  }
90052
public function outerHtml()
    {
        $document = new DOMDocument();

        $importedNode = $document->importNode($this->node);

        return $document->saveHTML($importedNode);
    }
749538
private function build() {

        $this -> fill();

        $html = '<input type="'. $this -> type .'"';
        
        foreach($this -> attributes as $attribute => $value) {
            $html .= ' ' . $attribute . '="'. Escape :: attr($value) .'"';
        }

        $html .= '>';

        return $html;
    }
782193
protected function renderDoctype()
    {
        $doctype = $this->def->doctype;
        $ret = '';
        $ret .= $this->start('table');
        $ret .= $this->element('caption', 'Doctype');
        $ret .= $this->row('Name', $doctype->name);
        $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No');
        $ret .= $this->row('Default Modules', implode($doctype->modules, ', '));
        $ret .= $this->row('Default Tidy Modules', implode($doctype->tidyModules, ', '));
        $ret .= $this->end('table');
        return $ret;
    }
209427
public function outerHtml() {
		$doc = new \DOMDocument();
		$doc->appendChild($doc->importNode($this->node, TRUE));
		return $doc->saveHTML($doc);
	}
978422
public function getDocumentType()
    {
        // if the type is defined use it else return the table name
        if (isset($this->documentType) and !empty($this->documentType)) {
            return $this->documentType;
        }

        return $this->getTable();
    }
504915
public function html() {
    if (($el = $this->getElement()) === NULL) return NULL;
    
    return implode('',xml::export($el->childNodes));
  }
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);
			}
		}
	}
278863
public function buildFileContainerTemplate() {
		$tr = Html::el("tr");
		
		$preview = Html::el("td")->addAttributes([
			"style" => "width: 15%"
		]);
		$preview->addHtml($this->elements["imagePreview"]->setAttribute("width", "100%"));
		$preview->addHtml($this->elements["filePreview"]);
		$tr->addHtml($preview);
		
		$name = Html::el("td");
		$name->addHtml($this->elements["filename"]);
		$tr->addHtml($name);
		
		$progress = Html::el("td");
		$progress->addHtml($this->elements["fileProgress"])->addAttributes([
			"style" => "width: 20%"
		]);
		$tr->addHtml($progress);
		
		$delete = Html::el("td")->addAttributes([
			"style" => "width: 50px; text-align: center",
		]);
		$delete->addHtml($this->elements["delete"]);
		$tr->addHtml($delete);
		
		return $tr;
	}
105447
protected function generateClass()
    {
        if ($this->class != null) {
            throw new Exception("The class has already been generated");
        }

        $classBaseType = $this->getBaseTypeClass();

        $this->class = new PhpClass(
            $this->phpIdentifier,
            false,
            $classBaseType,
            null,
            false,
            $this->abstract
        );

        $constructorComment = new PhpDocComment();
        $constructorSource = '';
        $constructorParameters = array();
        $accessors = array();

        // Add base type members to constructor parameter list first and call base class constructor
        $parentMembers = $this->getBaseTypeMembers($this);
        if (!empty($parentMembers)) {
            foreach ($parentMembers as $member) {
                $type = Validator::validateType($member->getType());
                $name = Validator::validateAttribute($member->getName());

                if (!$member->getNullable()) {
                    $constructorComment->addParam(PhpDocElementFactory::getParam($type, $name, ''));
                    $constructorParameters[$name] = Validator::validateTypeHint($type);
                }
            }
            $constructorSource .= '  parent::__construct(' . $this->buildParametersString($constructorParameters, false) . ');' . PHP_EOL;
        }

        // Add member variables
        foreach ($this->members as $member) {
            $type = Validator::validateType($member->getType());
            $name = Validator::validateAttribute($member->getName());
            $typeHint = Validator::validateTypeHint($type);

            $comment = new PhpDocComment();
            $comment->setVar(PhpDocElementFactory::getVar($type, $name, ''));
            $var = new PhpVariable('protected', $name, 'null', $comment);
            $this->class->addVariable($var);

            if (!$member->getNullable()) {
                if ($type == '\DateTime') {
                    if ($this->config->get('constructorParamsDefaultToNull')) {
                        $constructorSource .= '  $this->' . $name . ' = $' . $name . ' ? $' . $name . '->format(\DateTime::ATOM) : null;' . PHP_EOL;
                    } else {
                        $constructorSource .= '  $this->' . $name . ' = $' . $name . '->format(\DateTime::ATOM);' . PHP_EOL;
                    }
                } else {
                    $constructorSource .= '  $this->' . $name . ' = $' . $name . ';' . PHP_EOL;
                }
                $constructorComment->addParam(PhpDocElementFactory::getParam($type, $name, ''));
                $constructorParameters[$name] = $typeHint;
            }

            $getterComment = new PhpDocComment();
            $getterComment->setReturn(PhpDocElementFactory::getReturn($type, ''));
            if ($type == '\DateTime') {
                $getterCode = '  if ($this->' . $name . ' == null) {' . PHP_EOL
                    . '    return null;' . PHP_EOL
                    . '  } else {' . PHP_EOL
                    . '    try {' . PHP_EOL
                    . '      return new \DateTime($this->' . $name . ');' . PHP_EOL
                    . '    } catch (\Exception $e) {' . PHP_EOL
                    . '      return false;' . PHP_EOL
                    . '    }' . PHP_EOL
                    . '  }' . PHP_EOL;
            } else {
                $getterCode = '  return $this->' . $name . ';' . PHP_EOL;
            }
            $getter = new PhpFunction('public', 'get' . ucfirst($name), '', $getterCode, $getterComment);
            $accessors[] = $getter;

            $setterComment = new PhpDocComment();
            $setterComment->addParam(PhpDocElementFactory::getParam($type, $name, ''));
            $setterComment->setReturn(PhpDocElementFactory::getReturn($this->phpNamespacedIdentifier, ''));
            if ($type == '\DateTime') {
                if ($member->getNullable()) {
                    $setterCode = '  if ($' . $name . ' == null) {' . PHP_EOL
                        . '   $this->' . $name . ' = null;' . PHP_EOL
                        . '  } else {' . PHP_EOL
                        . '    $this->' . $name . ' = $' . $name . '->format(\DateTime::ATOM);' . PHP_EOL
                        . '  }' . PHP_EOL;
                } else {
                    $setterCode = '  $this->' . $name . ' = $' . $name . '->format(\DateTime::ATOM);' . PHP_EOL;
                }
            } else {
                $setterCode = '  $this->' . $name . ' = $' . $name . ';' . PHP_EOL;
            }
            $setterCode .= '  return $this;' . PHP_EOL;
            $setter = new PhpFunction(
                'public',
                'set' . ucfirst($name),
                $this->buildParametersString(
                    array($name => $typeHint),
                    true,
                    // If the type of a member is nullable we should allow passing null to the setter. If the type
                    // of the member is a class and not a primitive this is only possible if setter parameter has
                    // a default null value. We can detect whether the type is a class by checking the type hint.
                    $member->getNullable() && !empty($typeHint)
                ),
                $setterCode,
                $setterComment
            );
            $accessors[] = $setter;
        }

        $constructor = new PhpFunction(
            'public',
            '__construct',
            $this->buildParametersString(
                $constructorParameters,
                true,
                $this->config->get('constructorParamsDefaultToNull')
            ),
            $constructorSource,
            $constructorComment
        );
        $this->class->addFunction($constructor);

        foreach ($accessors as $accessor) {
            $this->class->addFunction($accessor);
        }
    }
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;
    }
46942
public function doctype() {
        if ($this->page->theme->doctype === 'html5') {
            $this->contenttype = 'text/html; charset=utf-8';
            return "<!DOCTYPE html>\n";

        } else if ($this->page->theme->doctype === 'xhtml5') {
            $this->contenttype = 'application/xhtml+xml; charset=utf-8';
            return "<!DOCTYPE html>\n";

        } else {
            // legacy xhtml 1.0
            $this->contenttype = 'text/html; charset=utf-8';
            return ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n");
        }
    }
677403
public function getFormatter()
    {
        $fmt = $this->settings->format;
        $formatter = null;
        if (!is_string($fmt) && is_subclass_of($fmt, 'Luminous\\Formatters\\Formatter')) {
            $formatter = clone $fmt;
        } elseif ($fmt === 'html') {
            $formatter = new HtmlFormatter();
        } elseif ($fmt ===  'html-inline') {
            $formatter = new InlineHtmlFormatter();
        } elseif ($fmt ===  'html-full') {
            $formatter = new FullPageHtmlFormatter();
        } elseif ($fmt === 'latex') {
            $formatter = new LatexFormatter();
        } elseif ($fmt === 'ansi') {
            $formatter = new AnsiFormatter();
        } elseif ($fmt ===  null || $fmt === 'none') {
            $formatter = new IdentityFormatter();
        }

        if ($formatter === null) {
            throw new Exception('Unknown formatter: ' . $this->settings->format);
            return null;
        }
        $this->setFormatterOptions($formatter);
        return $formatter;
    }
34935
public function CreateHtml()
	{
		$className = $this->ClassName ;
		if ( !empty( $className ) )
			$className = ' class="' . $className . '"' ;

		$id = $this->Id ;
		if ( !empty( $id ) )
			$id = ' id="' . $id . '"' ;

		return '<iframe src="' . $this->_BuildUrl() . '" width="' . $this->Width . '" ' .
			'height="' . $this->Height . '"' . $className . $id . ' frameborder="0" scrolling="no"></iframe>' ;
	}
1266890
public function generate() {
		$output_path = $this->timestampedFileName( 'pdf' );
		$success = $this->generateWithPrince( $this->pdfProfile, $this->pdfOutputIntent, $this->generateHtml(), $output_path );
		if ( true !== $success ) {
			throw new \Exception( 'Failed to create PDF file' );
		}
		delete_transient( 'dirsize_cache' ); /** @see get_dirsize() */
		return $output_path;
	}