Add the type of content pattern

@param array $arrRow

@return string
773657
public function previewElementPattern($arrRow)
	{
		$key = $arrRow['invisible'] ? 'unpublished' : 'published';
		$type = $GLOBALS['TL_LANG']['CTP'][$arrRow['type']][0] ?: '&nbsp;';

		// Prepare option string (alias / replicable)
		switch ($arrRow['type'])
		{
			case 'section':
			case 'explanation':
			case 'protection':
			case 'visibility':
				break;
			
			default:
				$options = '<span style="color: #b3b3b3 ;padding-left: 3px"> (Template alias: $this->' . $arrRow['alias'] . ')</span>';
				break;
		}
		
		// Get pattern model and call view method
		$objPattern = new \PatternModel();
		$objPattern->setRow($arrRow);
		
		$strClass = Agoat\CustomContentElementsBundle\Contao\Pattern::findClass($objPattern->type);
				
		if (!class_exists($strClass))
		{
			static::log('Pattern element class "'.$strClass.'" (pattern element "'.$objPattern->type.'") does not exist', __METHOD__, TL_ERROR);
		}
		else
		{
			$objPatternClass = new $strClass($objPattern);	
			$strPatternView = $objPatternClass->preview();
		}
		
		return '<div class="cte_type ' . $key . '">' . $type . $options . '</div><div style="padding: 5px 0 10px;">' . $strPatternView . '</div>';
	}
237599
public function append($arr)
    {
        
        if (is_a($arr, DictionaryInterface::class)) {
            $arr = $arr->getDictionary();
        }
        elseif (false === is_array($arr)){
            throw new \Exception("Not an array", 5);
        }
        
        foreach ($arr as $key => $val) {
            if (is_numeric($key)) {
                $this->setString($key, $key);
            } else {
                $this->setString($key, $val);
            }
        }
        
        return $this;
    }
756652
protected function parseInternal(array $arr): array {
        if (empty($arr)) {
            // An empty schema validates to anything.
            return [];
        } elseif (isset($arr['type'])) {
            // This is a long form schema and can be parsed as the root.
            return $this->parseNode($arr);
        } else {
            // Check for a root schema.
            $value = reset($arr);
            $key = key($arr);
            if (is_int($key)) {
                $key = $value;
                $value = null;
            }
            list ($name, $param) = $this->parseShortParam($key, $value);
            if (empty($name)) {
                return $this->parseNode($param, $value);
            }
        }

        // If we are here then this is n object schema.
        list($properties, $required) = $this->parseProperties($arr);

        $result = [
            'type' => 'object',
            'properties' => $properties,
            'required' => $required
        ];

        return array_filter($result);
    }
415141
public static function generateQueryString($arr = null)
    {
        if (null === $arr && isset($_GET)) {
            $arr = $_GET;
        }
        if (count($arr)) {
            return '?' . http_build_query($arr);
        } else {
            return '';
        }
    }
39912
public static function __($text,$arr = array(),$language='',$file=''){
		if(!$file){
			$file = 'companie';
		}
		if(!$language){
			$language = self::getCurrentLanguage();
		}
		Yii::$app->language = $language;
		$gText = Yii::t($file, $text);
		if(!empty($arr)){
			foreach($arr as $a){
				$gText = preg_replace('/%s/',$a,$gText,1);
			}
		}
		return $gText;
		
	}
1321476
public function getArcroleTypes( $href = null )
	{
		if ( $href === null )
			return $this->arcroleTypes;
		else
		{
			$taxonomy = $this->getTaxonomyForXSD( $href );
			return ( $taxonomy === false )
				? false
				: $taxonomy->getArcroleTypes();
		}
	}
1013038
public function contentType() {
        $headers = array('CONTENT_TYPE', 'HTTP_CONTENT_TYPE');

        foreach ($headers as $header) {
            if (!empty($this->serverVariables[$header])) {
                return $this->serverVariables[$header];
            }
        }

        return '';
    }
206236
public function pageTitlePattern(
        $pattern,
        $language = null,
        TreeNodeInterface $treeNode = null,
        Siteroot $siteroot = null
    ) {
        $request = $this->requestStack->getCurrentRequest();

        if ($siteroot === null) {
            $siteroot = $request->attributes->get('siterootUrl')->getSiteroot();
        }

        if ($treeNode === null) {
            $treeNode = $request->get('contentDocument');
        }

        if ($language === null) {
            $language = $request->getLocale();
        }

        $title = $this->patternResolver->replacePattern(
            $pattern,
            $siteroot,
            $treeNode->getTree()->getContent($treeNode),
            $language
        );

        return $title;
    }
316893
public function toAttr($prefix='', $suffix='') {
        $attrs = array();
        if ($this->width !== FALSE) {
            $attrs[] = 'width="'.addslashes($this->width).'"';
        }
        if ($this->height !== FALSE) {
            $attrs[] = 'height="'.addslashes($this->height).'"';
        }
        return $prefix.implode(' ', $attrs).$suffix;
    }
809049
protected function addRequest(array $log)
    {
        if (isset($_SERVER['HTTP_HOST'])) {
            $log['request']['host'] = $_SERVER['HTTP_HOST'];
        }
        if (isset($_SERVER['REQUEST_URI'])) {
            $log['request']['uri'] = $_SERVER['REQUEST_URI'];
        }
        if (isset($_SERVER['REQUEST_METHOD'])) {
            $log['request']['method'] = $_SERVER['REQUEST_METHOD'];
        }
        if (isset($_POST) && ! empty($_POST)) {
            $log['request']['body'] = $_POST;

            return $log;
        }

        return $log;
    }
1312382
public static function buildPatternLine($pattern, $length)
    {
        $result = '';
        for ($i = 0; $i < $length; $i++) {
            $result .= $pattern;
        }

        return $result;
    }
1109972
public static function addSectionLinkElement($linkSrc) {
		$rID = self::countSectionMediaElements() + 7;
		
		$link = array();
		$link['target'] = $linkSrc;
		$link['rID'] = $rID;
		$link['type'] = 'hyperlink';
		
		self::$_sectionMedia['links'][] = $link;
		
		return $rID;
	}
104385
static public function suffixToContentType($suffix)
    {
        $types = self::bySuffix();
        return isset($types[$suffix]) ? $types[$suffix]['content-type'] : null;
    }
589068
public function getBreadcrumbs(array $attrs = null, array $liAttrs = null, array $aAttrs = null, $divider = null) {
		$navBranches = $this->meta->getBreadcrumbNavBranches();
		if (empty($navBranches)) return null;
		
		$html = $this->view->getHtmlBuilder();
		
		$lis = array();
		$lastNavBranch = array_pop($navBranches);
		foreach ($navBranches as $navBranch) {
			$lis[] = $li = new HtmlElement('li', $liAttrs, $html->getLink(MurlPage::obj($navBranch), null, $aAttrs));
			if ($divider !== null) {
				$li->appendContent(new HtmlElement('span', array('class' => 'divider'), $divider));
			}
		}
		
		$lis[] = new HtmlElement('li', HtmlUtils::mergeAttrs(array('class' => 'active'), $liAttrs), 
				$html->getLink(MurlPage::obj($lastNavBranch), null, $aAttrs));
		
		return new HtmlElement('ul', $attrs, $lis);		
	}
752820
protected function getExpression($property, $argn = 0) {
		$type = $this->entity->getProperty($property)->getType();
		return isset($type) ? ('%{' . "$argn:$type" . '}') : ('%{' . $argn . '}') ;
	}
1051613
public static function toAttributeString(array $arr = null): string
    {
        $ret = "";
        if ($arr !== null) {
            foreach ($arr as $k => $v) {
                $ret .= " $k=\"$v\"";
            }
        }
        return $ret;
    }
567664
public function variantContentType($variant)
    {
        $variants = $this->variantsAttribute();

        if ( ! empty($variants)) {
            return Arr::get($variants, "{$variant}.type") ?: false;
        }

        if (false !== ($type = $this->config->variantMimeType($variant))) {
            return $type;
        }

        return $this->contentType();
    }