Generate the pattern preview

@return string HTML code
192652
public function preview()
	{
		$strPreview = '<div class="widget" style="padding-top:10px;"><h3 style="margin: 0;"><label>' . $this->label . '</label></h3><div class="selector_container"><ul>';

		if ($this->multiPage)
		{
			$strPreview .= '<li><img src="system/themes/flexible/icons/regular.svg" width="18" height="18" alt=""> Articletitle1</li><li><img src="system/themes/flexible/icons/regular.svg" width="18" height="18" alt=""> Articletitle2</li><li><img src="system/themes/flexible/icons/regular.svg" width="18" height="18" alt=""> Articletitle3</li>';				
		}
		else
		{
			$strPreview .= '<li><img src="system/themes/flexible/icons/regular.svg" width="18" height="18" alt=""> Articletitle</li>';				
		}

		$strPreview .= '</ul><p><a href="javascript:void(0);" class="tl_submit">Change selection</a></p></div><p title="" class="tl_help tl_tip">' . $this->description . '</p></div>';

		return $strPreview;
	}
1098976
public function getPattern()
    {
        $pattern = null;

        if ($patternNodes = $this->element->getElementsByTagName('pattern')) {
            if ($patternNodes->length > 0) {
                $pattern = $patternNodes->item(0)->getAttribute('value');
            }
        }

        return $pattern;
    }
948645
protected function _toHtml()
    {
        $html = false;

        if ($this->canRenderFilter()) {
            $html = $this->getLayout()
                ->createBlock($this->block)
                ->setSwatchFilter($this->getFilter())
                ->toHtml();
        }

        return $html;
    }
564539
public function previewHTML($html)
    {
        $html = $this->parsingHtml->prepareHtml($html);

        $html = preg_replace('/<page([^>]*)>/isU', '<hr>Page : $1<hr><div$1>', $html);
        $html = preg_replace('/<page_header([^>]*)>/isU', '<hr>Page Header : $1<hr><div$1>', $html);
        $html = preg_replace('/<page_footer([^>]*)>/isU', '<hr>Page Footer : $1<hr><div$1>', $html);
        $html = preg_replace('/<\/page([^>]*)>/isU', '</div><hr>', $html);
        $html = preg_replace('/<\/page_header([^>]*)>/isU', '</div><hr>', $html);
        $html = preg_replace('/<\/page_footer([^>]*)>/isU', '</div><hr>', $html);

        $html = preg_replace('/<bookmark([^>]*)>/isU', '<hr>bookmark : $1<hr>', $html);
        $html = preg_replace('/<\/bookmark([^>]*)>/isU', '', $html);

        $html = preg_replace('/<barcode([^>]*)>/isU', '<hr>barcode : $1<hr>', $html);
        $html = preg_replace('/<\/barcode([^>]*)>/isU', '', $html);

        $html = preg_replace('/<qrcode([^>]*)>/isU', '<hr>qrcode : $1<hr>', $html);
        $html = preg_replace('/<\/qrcode([^>]*)>/isU', '', $html);

        echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>HTML View</title>
        <meta http-equiv="Content-Type" content="text/html; charset='.$this->_encoding.'" >
    </head>
    <body style="padding: 10px; font-size: 10pt;font-family:    Verdana;">
    '.$html.'
    </body>
</html>';
    }
1013206
public function getAsPreviewHTML()
    {
        $html = "";
        foreach ($this->getChildren() as $child) {
            $html .= $child->getAsPreviewHTML();
        }

        return $html;
    }
752569
public function preview()
	{
		$selector = 'ctrl_textarea' . $this->id;

		$strPreview = '<div class="widget" style="padding-top:10px;"><h3 style="margin: 0;"><label>' . $this->label . '</label></h3>';
		$strPreview .= '<textarea id="' . $selector . '" aria-hidden="true" class="tl_textarea noresize" rows="12" cols="80"></textarea>';
		
		// Register all tinyMCE template files
		if (!array_key_exists($this->rteTemplate, TemplateLoader::getFiles()))
		{
			$objFilesystem = new Filesystem();
			
			$arrTemplateFiles = glob(TL_ROOT . '/templates/*/be_tinyMCE*');

			foreach ($arrTemplateFiles as $strFile)
			{
				$arrTemplates[basename($strFile, '.html5')] = rtrim($objFilesystem->makePathRelative(dirname($strFile), TL_ROOT), '/');
			}
			
			if ($arrTemplates !== null)
			{
				TemplateLoader::addFiles($arrTemplates);
			}
		}

		if (array_key_exists($this->rteTemplate, TemplateLoader::getFiles()))
		{
			$objTemplate = new \BackendTemplate($this->rteTemplate);
			$objTemplate->selector = $selector;

			$strPreview .= $objTemplate->parse();
		}
			
		$strPreview .= '<p title="" class="tl_help tl_tip">' . $this->description . '</p></div>';	

		return $strPreview;
	}
1190931
public function actionPattern()
	{
		$this->pageTitle = Yii::t('phrase', 'Pattern Template | Dora. - Coming Soon Page Template');
		$this->pageDescription = '';
		$this->pageMeta = '';
		$this->render('/dora/template/front_pattern');
	}
1218612
private function getHtmlBeginning()
	{
		$html = '<' . $this->tagName;

		foreach ($this->attributes as $name => $value) {
			$html .= ' ' . $name . '="' . htmlspecialchars($value) . '"';
		}

		return $html;
	}
859713
public function preview()
	{
		$strPreview = '<div class="' . (($this->classLong) ? 'long' : 'w50') . ((in_array($this->picker, array('datetime', 'color', 'link'))) ? ' wizard' : '') . ' widget" style="padding-top:10px;"><h3><label>' . $this->label . '</label></h3>';

		if ($this->picker == 'unit')
		{
			$strPreview .= '<input class="tl_text_unit" value="' . $this->defaultValue . '" type="text">';
			$strPreview .= ' <select class="tl_select_unit">';

			$units = StringUtil::deserialize($this->units);
			foreach ($units as $unit)
			{
				$strPreview .= '<option value="' . $unit['value'] . '">' . $unit['label'] . '</option>';
			}

			$strPreview .= '</select>';
		}
		
		elseif ($this->multiple)
		{
			$strPreview .= '<div>';
			
			for ($i = 0; $i < $this->multiple; $i++)
			{
				$strPreview .= '<input class="tl_text_' . $this->multiple . '" value="' . $this->defaultValue . '" type="text"> ';
			}

			$strPreview .= '</div>';
		}
		
		else
		{
			$strPreview .= '<input class="tl_text" value="' . $this->defaultValue . '" type="text">';
		}
		
		switch ($this->picker)
		{
			case 'datetime':
				$strPreview .=  ' <img src="assets/datepicker/images/icon.svg" height="20" width="20">';
				break;

			case 'color':
				$strPreview .=  ' <img src="system/themes/flexible/icons/pickcolor.svg" height="16" width="16">';
				break;
			
			case 'link':
				$strPreview .=  ' <img src="system/themes/flexible/icons/pickpage.svg" height="16" width="16">';
				break;
		}
		
		$strPreview .= '<p title="" class="tl_help tl_tip">' . $this->description . '</p></div>';	

		return $strPreview;
	}
795317
public function generate()
    {
        $code = array();

        if ($this->namespace !== null) {
            $code[] = $this->getIndentation() . 'namespace ' . $this->namespace;
            $code[] = '{';
            $code[] = null;

            // Temporarily add one more level of indentation.
            $this->addIndentationLevel(1);
        }

        $code = array_merge($code, $this->renderUsesLines());

        $indentation = $this->getIndentation();

        $doc = $this->generateDocumentation();
        if ($doc !== null) {
            $code[] = $doc;
        }

        $code[] = $indentation . 'trait ' . $this->name;
        $code[] = $indentation . '{';

        // Class uses.
        $traitElements = $this->generateTraitUsesLines();

        // Class properties.
        $traitElements = array_merge($traitElements, $this->generatePropertiesLines());

        // Class methods.
        $traitElements = array_merge($traitElements, $this->generateMethodsLines());

        if (count($traitElements) > 0) {
            $code[] = null;
            $code = array_merge($code, $traitElements);
            // Remove last empty line.
            array_pop($code);
        }

        $code[] = $indentation . '}';

        if ($this->namespace !== null) {
            // Set back the indentation.
            $this->addIndentationLevel(-1);

            $code[] = $this->getIndentation() . '}';
        }

        return implode($this->getLineFeed(), $code);
    }
876895
public function generate()
    {
        // Add empty option (XHTML) if there are none
        if (empty($this->arrOptions)) {
            $this->arrOptions = array(
                array(
                    'value' => '',
                    'label' => '-'
                )
            );
        }

        $strClass = ('' !== $this->strClass ? ' class="' . $this->strClass . '"' : '');
        $strStyle = ('' !== $this->arrAttributes['style'] ? ' style="' . $this->arrAttributes['style'] . '"' : '');

        return $this->checkOptGroup($this->arrOptions, $strClass, $strStyle);
    }
1127841
private function getPatternId() : string
    {
        return sprintf(
            '%s::u%d::c%d::d%s::p%s',
            $this->patternId['division'],
            $this->patternId['useragent'],
            $this->patternId['child'],
            $this->patternId['device'],
            $this->patternId['platform']
        );
    }
1201789
public function preview()
    {
        if (($pos = strrpos($this->path, '.')) !== false) {
            $type = substr($this->path, $pos + 1);
        } else {
            $type = 'unknown';
        }

        if ($type === 'php') {
            return highlight_string($this->content, true);
        } elseif (!in_array($type, ['jpg', 'gif', 'png', 'exe'])) {
            return nl2br(Html::encode($this->content));
        }

        return false;
    }
564847
protected function getScanExcludePattern()
    {
        $pattern = implode('|', array_keys(array_filter((array)$this->settings['scan']['excludePatterns'])));
        if ($pattern !== '') {
            $pattern = '#' . str_replace('#', '\#', $pattern) . '#';
        }
        return $pattern;
    }
248878
public function preview()
	{
		$strPreview = '<div class="clr widget" style="padding-top:10px;"><h3 style="margin: 0;"><label>' . $this->label . '</label></h3><div><div class="selector_container"><ul class="' . (($this->source == 'image') ? 'sgallery' : '') . '">';

		switch ($this->source)
		{
			case 'image':
				if ($this->multiSource)
				{
					$strPreview .= '<li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mPY/B8AAmgBsyYNIzsAAAAASUVORK5CYII=" width="80" height="60" alt="" class="gimage"></li><li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mPY/B8AAmgBsyYNIzsAAAAASUVORK5CYII=" width="80" height="60" alt="" class="gimage"></li><li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mPY/B8AAmgBsyYNIzsAAAAASUVORK5CYII=" width="80" height="60" alt="" class="gimage"></li>';				
				}
				else
				{
					$strPreview .= '<li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mPY/B8AAmgBsyYNIzsAAAAASUVORK5CYII=" width="80" height="60" alt="" class="gimage"></li>';
				}
				break;
				
			case 'video':
				$strPreview .= '<li><img src="assets/contao/images/iconVIDEO.svg" width="18" height="18" alt=""> <span class="dirname">files/folder/</span>videofile.mp4 <span class="tl_gray">(5.0 MiB)</span></li><li><img src="assets/contao/images/iconVIDEO.svg" width="18" height="18" alt=""> <span class="dirname">files/folder/</span>videofile.webm <span class="tl_gray">(4.9 MiB)</span></li><li><img src="assets/contao/images/iconVIDEO.svg" width="18" height="18" alt=""> <span class="dirname">files/folder/</span>videofile.ogv <span class="tl_gray">(5.4 MiB)</span></li>';				
				break;
				
			case 'audio':
				$strPreview .= '<li><img src="assets/contao/images/iconAUDIO.svg" width="18" height="18" alt=""> <span class="dirname">files/folder/</span>audiofile.mp3 <span class="tl_gray">(2.5 MiB)</span></li><li><img src="assets/contao/images/iconAUDIO.svg" width="18" height="18" alt=""> <span class="dirname">files/folder/</span>audiofile.wma <span class="tl_gray">(3.4 MiB)</span></li>';				
				break;
				
			case 'custom':
			default:
				if ($this->multiSource)
				{
					$strPreview .= '<li><img src="assets/contao/images/iconPLAIN.svg" width="18" height="18" alt=""> <span class="dirname">files/folder/</span>selectedfile1.ext <span class="tl_gray">(128.0 KiB)</span></li><li><img src="assets/contao/images/iconPLAIN.svg" width="18" height="18" alt=""> <span class="dirname">files/folder/</span>selectedfile2.ext <span class="tl_gray">(2.0 MiB)</span></li><li><img src="assets/contao/images/iconPLAIN.svg" width="18" height="18" alt=""> <span class="dirname">files/folder/</span>selectedfile3.ext <span class="tl_gray">(512.0 KiB)</span></li>';				
				}
				else
				{
					$strPreview .= '<li><img src="assets/contao/images/iconPLAIN.svg" width="18" height="18" alt=""> files/folder/selectedfile1.ext <span class="tl_gray">(2.5 MiB)</span></li>';				
				}
				break;				
		}
	
		$strPreview .= '</ul><p><a href="javascript:void(0);" class="tl_submit">Change selection</a></p></div></div><p title="" class="tl_help tl_tip">' . $this->description . '</p></div>';

		if ($this->source == 'image' && $this->canChangeSize)
		{
			$strPreview .= '<div class="w50 clr widget"><h3 style="margin: 0; padding-top: 14px;"><label>' . $GLOBALS['TL_LANG']['tl_content_pattern']['size'][0] . '</label></h3><div class="tl_image_size"><select class="tl_select_interval">';
	
			$imgSizes = $this->getImageSizeList();
			$size = \StringUtil::deserialize($this->size);

			foreach ($imgSizes as $k=>$v)
			{
				if (!is_array($v))
				{
					$selected = ((is_numeric($size[2])) ? $kk == $size[2] : $vv == $size[2]) ? ' selected' : '';
					$label = ($GLOBALS['TL_LANG']['MSC'][$v]) ? (is_array($GLOBALS['TL_LANG']['MSC'][$v])) ? $GLOBALS['TL_LANG']['MSC'][$v][0] : $GLOBALS['TL_LANG']['MSC'][$v] : $v;
					$strPreview .= '<option value="' . \StringUtil::specialchars($v) . '"' . $selected . '>' . $label . '</option>';
				}
				else
				{
					$label = ($GLOBALS['TL_LANG']['MSC'][$k]) ? (is_array($GLOBALS['TL_LANG']['MSC'][$k])) ? $GLOBALS['TL_LANG']['MSC'][$k][0] : $GLOBALS['TL_LANG']['MSC'][$k] : $k;
					$strPreview .= '<optgroup label="&nbsp;' . \StringUtil::specialchars($label) . '">';
					
					$bolAssoc = array_is_assoc($v);
					foreach ($v as $kk=>$vv)
					{
						$selected = ((is_numeric($size[2]) && $bolAssoc) ? $kk == $size[2] : $vv == $size[2]) ? ' selected' : '';
						$strPreview .= '<option value="' . \StringUtil::specialchars($vv) . '"' . $selected . '>' . (($GLOBALS['TL_LANG']['MSC'][$vv]) ? $GLOBALS['TL_LANG']['MSC'][$vv][0] : $vv) . '</option>';
					}

					$strPreview .= '</optgroup>';
				}
			}
		
			$strPreview .= '</select> <input class="tl_text_4 tl_imageSize_0" value="" type="text"> <input class="tl_text_4 tl_imageSize_1" value="" type="text"></div><p title="" class="tl_help tl_tip">' . $GLOBALS['TL_LANG']['tl_content_pattern']['size'][1] . '</p></div>';
		}

		return $strPreview;
	}
1320802
public function preview()
    {
        $inputs  = Input::all();
        $content = str_replace("&#39;", '"', $inputs['content']);
        $content = $this->variablesAdapter->get($content);

        if( isset($inputs['subject']) ) {
            $subject = str_replace("&#39;", '"', $inputs['subject']);
            $subject = $this->variablesAdapter->get($subject);

            array_set($inputs, 'subject', $subject);
        }

        preg_match_all('/\[\[(.*?)\]\]/', $content, $matches);
        $view = str_replace($matches[0], $matches[1], $content);

        if (array_get($inputs, 'type') === 'email') {
            event('antares.notifier.before_send_email', [&$view]);
        }

        $brandTemplate = BrandOptions::query()->where('brand_id', brand_id())->first();
        $header        = str_replace('</head>', '<style>' . $brandTemplate->styles . '</style></head>', $brandTemplate->header);
        $html          = preg_replace("/<body[^>]*>(.*?)<\/body>/is", '<body>' . $view . '</body>', $header . $brandTemplate->footer);

        array_set($inputs, 'content', $html);

        return $this->presenter->preview($inputs);
    }
1190819
public function colors_preview_css() {

		?>
		<script type="text/html" id="tmpl-rock-colors-css">
			<?php

			foreach ( $this->colors as $name => $args ) {

				if ( empty( $name ) || empty( $args['css'] ) || ! is_array( $args['css'] ) ) {

					continue;

				}

				printf(
					Rock_Customizer::parse_css_rules( $args['css'] ),
					sprintf( '{{ data.%s }}', $name )
				);

			}

			?>
		</script>
		<?php

		$rgba_colors = $this->get_rgba_css();

		if ( ! $rgba_colors ) {

			// Required for themes without rgba css rules
			echo '<script type="text/html" id="tmpl-rock-colors-css-rgba"></script>';

		}

		?>
		<script type="text/html" id="tmpl-rock-colors-css-rgba">
			<?php

			foreach ( $rgba_colors as $name => $css ) {

				printf(
					Rock_Customizer::parse_css_rules( $css ),
					sprintf( '{{ data.%s }}', $name )
				);

			}

			?>
		</script>
		<?php

	}