Get the optional html elments.

@throws \ArjanSchouten\HtmlMinifier\Exception\FileNotFoundException

@return mixed
197239
public function getElements()
    {
        if (self::$elements === null) {
            self::$elements = $this->loadJson($this->resource('OptionalElements.json'))->elements;
        }

        return self::$elements;
    }
102580
protected function buildView()
    {
        if (isset($this->html)) {
            return array_filter([
                'html' => new HtmlString($this->html),
                'text' => $this->textView ?? null,
            ]);
        }

        if (isset($this->markdown)) {
            return $this->buildMarkdownView();
        }

        if (isset($this->view, $this->textView)) {
            return [$this->view, $this->textView];
        } elseif (isset($this->textView)) {
            return ['text' => $this->textView];
        }

        return $this->view;
    }
206545
public function getHtmlContent()
    {
        if ($this->htmlContent === null) {
            try {
                if (empty($content = $this->content)) {
                    return $this->htmlContent = false;
                }

                $errors = libxml_use_internal_errors(true);
                $entities = libxml_disable_entity_loader(true);

                $this->htmlContent = new DOMDocument();

                if (mb_detect_encoding($content, 'UTF-8', true) === 'UTF-8') {
                    $content = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');
                    $content = preg_replace(
                        '/<head[^>]*>/',
                        '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">',
                        $content
                    );
                } elseif (mb_detect_encoding($content, 'SJIS', true) === 'SJIS') {
                    $content = mb_convert_encoding($content, 'HTML-ENTITIES', 'SJIS');
                    $content = preg_replace('/<head[^>]*>/', '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=shift_jis">', $content);
                } elseif (mb_detect_encoding($content, 'ISO-8859-1', true) === 'ISO-8859-1') {
                    $content = mb_convert_encoding($content, 'HTML-ENTITIES', 'ISO-8859-1');
                    $content = preg_replace('/<head[^>]*>/', '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">', $content);
                }

                $this->htmlContent->loadHTML(trim($content));

                libxml_use_internal_errors($errors);
                libxml_disable_entity_loader($entities);
            } catch (Exception $exception) {
                return $this->htmlContent = false;
            }
        }

        return $this->htmlContent;
    }
870756
public function getHTML()
    {
        $details = $this->getHTMLDetails();
        extract($details);

        $type = "type='checkbox'";
        $name = " name='{$this['name']}[]'";
        $ret = null;
        $checkedValues = is_array($this['checked']) ? $this['checked'] : [];

        foreach ($this['values'] as $val) {
            $id .= $val;
            $item = $onlyValue  = htmlentities($val, ENT_QUOTES, $this->characterEncoding);
            $value = " value='{$onlyValue}'";
            $checked = in_array($val, $checkedValues)
                ? " checked='checked'"
                : null;

            $ret .= <<<EOD
<p>
<input id='$id'{$type}{$class}{$name}{$value}{$autofocus}{$readonly}{$checked}{$title} />
<label for='$id'>$item</label>
{$messages}
</p>
EOD;
        }
        return <<<EOD
<div>
<p>{$label}</p>
{$ret}
<p class='cf-desc'>{$description}</p>
</div>
EOD;
    }
1026679
public function getFileContents()
    {
        $result = null;
        $fsl = $this->getFile()->getFileStorageLocationObject();
        if ($fsl !== null) {
            $app = Application::getFacadeApplication();
            $cf = $app->make('helper/concrete/file');
            try {
                $result = $fsl->getFileSystemObject()->read($cf->prefix($this->fvPrefix, $this->fvFilename));
                if ($result === false) {
                    $result = null;
                }
            } catch (FileNotFoundException $x) {
            }
        }

        return $result;
    }
723886
public function getHtml()
    {
        if (!$this->exists()) {
            return '';
        }
        switch ($this->type) {
            case 'datetime':
                $html = '<abbr title="'.$this->content->format('c').'">'
                    .(class_exists('WebSyndication\Helper') ?
                        \WebSyndication\Helper::getLocalizedDateString($this->content) : $this->content->format('D j m Y H:i:s')
                    ).'</abbr>';
                break;
            case 'time':
                $html = $this->content->format('H:i:s');
                break;
            case 'email':
                $html = '<a href="mailto:'.$this->content.'" title="Contact this email">'.$this->content.'</a>';
                break;
            case 'url':
                $html = '<a href="'.$this->content.'" title="See online">'.$this->content.'</a>';
                break;
            case 'text':
                $html = $this->xml_value;
                break;
            case 'lang':
                $html = '<abbr title="ISO : '.$this->xml_value.'">'.$this->content.'</abbr>';
                break;
            case 'list':
                $html = '';
                foreach ($this->content as $_ctt) {
                    $html .= (strlen($html) ? ', ' : '').$_ctt->content;
                }
                break;
            default:
                $html = $this->content;
                break;
        }
        return $html;
    }
1164103
public function generate()
    {
        if (false === file_exists($this->filename) || false === is_file($this->filename)) {
            throw new FileNotFoundException(sprintf('The file "%s" does not exist.', $this->filename));
        }

        $json = Json::decode(file_get_contents($this->filename), true);

        for ($i = 0; $i < count($json); $i++) {
            $json[$i] = $this->filterByKey($json[$i], function ($key, $value) {
                return null === $this->parameters || true === in_array($key, $this->parameters);
            });
        }

        return array_filter($json, function ($value) {
            return count($value) > 0;
        });
    }
256008
protected function getAppend()
	{
		if ($this->hasAddOn())
		{
			$htmlOptions = $this->appendOptions;

			if (isset($htmlOptions['class']))
				$htmlOptions['class'] .= ' add-on';
			else
				$htmlOptions['class'] = 'add-on';

			ob_start();
			if (isset($this->appendText))
				echo CHtml::tag('span', $htmlOptions, $this->appendText);

			echo '</div>';
			return ob_get_clean();
		} else
			return '';
	}
910920
public function getRequiredJSFiles()
    {
        $files = [];
        
        foreach (ClassInfo::subclassesFor(ContentController::class) as $controller) {
            
            if ($required_js = Injector::inst()->get($controller)->getRequiredJS()) {
                
                foreach ($required_js as $file) {
                    
                    $file = ModuleResourceLoader::singleton()->resolvePath($file);
                    
                    if (!isset($files[$file])) {
                        $files[$file] = file_get_contents(Director::getAbsFile($file));
                    }
                    
                }
                
            }
            
        }
        
        return $files;
    }
1353265
public function get($html = null)
    {
        if (null === $html) {
            if (file_exists($this->_path)) {
                $html = file_get_contents($this->_path);
            }
        }

        $this->_path = null;

        return $this->parse($html);
    }
230132
public function getBufferedContents(): string {
		if (!$this->htmlView->isInitialized()) {
			$this->htmlView->initialize();
		}
		
		$data = array(self::HEAD_KEY => array(), self::BODY_START => array(),
				self::BODY_END => array(), self::ADDITIONAL_KEY => $this->additionalAttrs,
				self::CONTENT_KEY => $this->htmlView->build(new SimpleBuildContext()));
		
		foreach ($this->htmlView->getHtmlProperties()->fetchUiComponentHtmlSnipplets(HtmlBuilderMeta::getKeys()) 
				as $name => $htmlSnipplets) {
			switch ($name) {
				case HtmlBuilderMeta::TARGET_BODY_START:
					$data[self::BODY_START] = array_merge($data[self::BODY_START], $htmlSnipplets);
				case HtmlBuilderMeta::TARGET_BODY_END:
					$data[self::BODY_END] = array_merge($data[self::BODY_END], $htmlSnipplets);
				default:
					$data[self::HEAD_KEY] = array_merge($data[self::HEAD_KEY], $htmlSnipplets);
			}
		}
		
		return StringUtils::jsonEncode($data);
	}
571588
public function getHTMLFiles($directory)
    {
        try {
            $dir = new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS | RecursiveDirectoryIterator::NEW_CURRENT_AND_KEY);
            $files = new \RecursiveIteratorIterator($dir);

            $allowedExtensions = ['htm', 'html'];

            $list = [];
            foreach ($files as $file) {
                if (in_array($file->getExtension(), $allowedExtensions)) {
                    // HTML File found
                    $relativePath = str_replace($directory, '', $file->getPathname());
                    $list[] = ltrim($relativePath, '\\/');
                }
            }

            return $list;
        } catch (\Exception $e) {
            return [];
        }
    }
966582
public function getHTML()
    {
        $details = $this->getHTMLDetails();
        extract($details);
        
        $options = null;
        foreach ($this['options'] as $optValue => $optText) {
            $options .= "<option value='{$optValue}'"
                . (($this['value'] == $optValue)
                    ? " selected=\"selected\""
                    : null)
                . ">{$optText}</option>\n";
        }

        return <<<EOD
<p>
<label for='$id'>$label</label>$brAfterLabel
<select id='$id'{$class}{$name}{$autofocus}{$required}{$readonly}{$checked}{$title}>
{$options}
</select>
{$messages}
</p>
<p class='cf-desc'>{$description}</p>
EOD;
    }
9444
public function getHTML() {
        $tag = '<form';
        $q = $this->quoteType;

        //build attribute strings
        foreach( $this->attrs as $name=>$value ) {
            //if true, such as CHECKED, we just add the name
            if( $value === true )
                    $tag .= " $name";
            elseif( is_string( $value ) ) //if it's a string, we add attr="value"
                    $tag .= " {$name}={$q}{$value}{$q}";
        }

        //not a short tag, close it
        $tag .= '>';

        //add the children if they exist
        if( $this->hasChildren() ) {
            for( $i = 0; $i < count( $this->children ); $i++ ) {
                //datalists are hidden and should not be decorated
                if( $this->children[$i] instanceof Element\Datalist ) {
                    $tag .= $this->children[$i]->getHTML();
                } else {
                    $tag .= $this->decorator->element( $this->children[$i]->getHTML(), $this->titles[$i] );
                }
            }
        }

        //closing tag
        $tag .= "</form>";

        return $this->decorator->form( $tag );
    }
932848
public function GetHtmlHeadIncludes()
    {
        $aIncludes = parent::GetHtmlHeadIncludes();

        if (isset($this->oActiveShippingGroup)) {
            $oPaymentMethodList = TShopBasket::GetInstance()->GetAvailablePaymentMethods();
            if ($oPaymentMethodList) {
                while ($oPaymentMethod = $oPaymentMethodList->Next()) {
                    $oPaymentHandler = $oPaymentMethod->GetFieldShopPaymentHandler();

                    if (method_exists($oPaymentHandler, 'GetHtmlHeadIncludes')) {
                        $aAdditionalIncludes = $oPaymentHandler->GetHtmlHeadIncludes();
                        if (count($aAdditionalIncludes) > 0) {
                            $aIncludes = array_merge($aIncludes, $aAdditionalIncludes);
                        }
                    }
                }
            }
        }

        return $aIncludes;
    }
5641
public function getHTML()
    {
        $details = $this->getHTMLDetails();
        extract($details);

        $ret = null;
        foreach ($this['values'] as $val) {
            $id .= $val;
            $item = $onlyValue  = htmlentities($val, ENT_QUOTES, $this->characterEncoding);
            $value = " value='{$onlyValue}'";
            $checked = isset($this['checked']) && $val === $this['checked']
                ? " checked='checked'"
                : null;

            $ret .= <<<EOD
<{$wrapperElement}{$wrapperClass}>
    <input id='$id'{$type}{$class}{$name}{$value}{$autofocus}{$readonly}{$checked}{$title} />
    <label for='$id'>$item</label>
    {$messages}
</{$wrapperElement}>
EOD;
        }

        return <<<EOD
<{$wrapperElement}{$wrapperClass}>
<p class='cf-label'>{$label}</p>
{$ret}
<p class='cf-desc'>{$description}</p>
</{$wrapperElement}>
EOD;
    }
1323341
protected function getOptions()
	{
		// Initialize variables.
		$options = array();

		// Initialize some field attributes.
		$filter = (string) $this->element['filter'];
		$exclude = (string) $this->element['exclude'];
		$hideNone = (string) $this->element['hide_none'];
		$hideDefault = (string) $this->element['hide_default'];

		// Get the path in which to search for file options.
		$path = (string) $this->element['directory'];
		if (!is_dir($path))
		{
			$path = PATH_ROOT . '/' . $path;
		}

		// Prepend some default options based on field attributes.
		if (!$hideNone)
		{
			$options[] = Dropdown::option( '-1', App::get('language')->alt('JOPTION_DO_NOT_USE', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)));
		}
		if (!$hideDefault)
		{
			$options[] = Dropdown::option('', App::get('language')->alt('JOPTION_USE_DEFAULT', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)));
		}

		// Get a list of folders in the search path with the given filter.
		$folders = App::get('filesystem')->directories($path, $filter);

		// Build the options list from the list of folders.
		if (is_array($folders))
		{
			foreach ($folders as $folder)
			{

				// Check to see if the file is in the exclude mask.
				if ($exclude)
				{
					if (preg_match(chr(1) . $exclude . chr(1), $folder))
					{
						continue;
					}
				}

				$options[] = Dropdown::option($folder, $folder);
			}
		}

		// Merge any additional options in the XML definition.
		$options = array_merge(parent::getOptions(), $options);

		return $options;
	}