protected function generateMarkup(Icon $icon, array $options)
    {

        $previewIconAvailable = $this->isPreviewIconAvailable($options['contentElementKey']);
        $fontAwesomeKeyAvailable = $this->isFontAwesomeKeyAvailable($this->contentElement);


        // decide what kind of icon to render
        if ($fontAwesomeKeyAvailable) {

            $color = $this->getColor($this->contentElement);
            if ($color) {
                $styles[] = "color: #" . $color;
            }
            if (count($styles)) {
                $markup = '<span class="icon-unify" style="' . implode("; ",
                        $styles) . '"><i class="fa fa-' . htmlspecialchars($this->getFontAwesomeKey($this->contentElement)) . '"></i></span>';
            } else {
                $markup = '<span class="icon-unify" ><i class="fa fa-' . htmlspecialchars($this->getFontAwesomeKey($this->contentElement)) . '"></i></span>';
            }
        } else {
            if ($previewIconAvailable) {
                $markup = '<img src="' . PathUtility::getAbsoluteWebPath(PATH_site . ltrim($this->getPreviewIconPath($options['contentElementKey']),
                            '/')) . '" alt="' . $this->contentElement["label"] . '" title="' . $this->contentElement["label"] . '"/>';
            } else {
                $color = $this->getColor($this->contentElement);
                if ($color) {
                    $styles[] = "background-color: #" . $color;
                }
                $styles[] = "color: #fff";
                $markup = '<span class="icon-unify mask-default-icon" style="' . implode("; ",
                        $styles) . '">' . mb_substr($this->contentElement["label"], 0, 1) . '</span>';
            }
        }

        return $markup;
    }
protected function generateMarkup(Icon $icon, array $options)
    {

        $previewIconAvailable = $this->isPreviewIconAvailable($options['contentElementKey']);
        $fontAwesomeKeyAvailable = $this->isFontAwesomeKeyAvailable($this->contentElement);


        // decide what kind of icon to render
        if ($fontAwesomeKeyAvailable) {

            $color = $this->getColor($this->contentElement);
            if ($color) {
                $styles[] = "color: #" . $color;
            }
            if (count($styles)) {
                $markup = '<span class="icon-unify" style="' . implode("; ",
                        $styles) . '"><i class="fa fa-' . htmlspecialchars($this->getFontAwesomeKey($this->contentElement)) . '"></i></span>';
            } else {
                $markup = '<span class="icon-unify" ><i class="fa fa-' . htmlspecialchars($this->getFontAwesomeKey($this->contentElement)) . '"></i></span>';
            }
        } else {
            if ($previewIconAvailable) {
                $markup = '<img src="' . PathUtility::getAbsoluteWebPath(PATH_site . ltrim($this->getPreviewIconPath($options['contentElementKey']),
                            '/')) . '" alt="' . $this->contentElement["label"] . '" title="' . $this->contentElement["label"] . '"/>';
            } else {
                $color = $this->getColor($this->contentElement);
                if ($color) {
                    $styles[] = "background-color: #" . $color;
                }
                $styles[] = "color: #fff";
                $markup = '<span class="icon-unify mask-default-icon" style="' . implode("; ",
                        $styles) . '">' . mb_substr($this->contentElement["label"], 0, 1) . '</span>';
            }
        }

        return $markup;
    }
protected function generateMarkup ( Icon $ icon , array $ options ) { $ previewIconAvailable = $ this -> isPreviewIconAvailable ( $ options [ 'contentElementKey' ] ) ; $ fontAwesomeKeyAvailable = $ this -> isFontAwesomeKeyAvailable ( $ this -> contentElement ) ; // decide what kind of icon to render if ( $ fontAwesomeKeyAvailable ) { $ color = $ this -> getColor ( $ this -> contentElement ) ; if ( $ color ) { $ styles [ ] = "color: #" . $ color ; } if ( count ( $ styles ) ) { $ markup = '<span class="icon-unify" style="' . implode ( "; " , $ styles ) . '"><i class="fa fa-' . htmlspecialchars ( $ this -> getFontAwesomeKey ( $ this -> contentElement ) ) . '"></i></span>' ; } else { $ markup = '<span class="icon-unify" ><i class="fa fa-' . htmlspecialchars ( $ this -> getFontAwesomeKey ( $ this -> contentElement ) ) . '"></i></span>' ; } } else { if ( $ previewIconAvailable ) { $ markup = '<img src="' . PathUtility :: getAbsoluteWebPath ( PATH_site . ltrim ( $ this -> getPreviewIconPath ( $ options [ 'contentElementKey' ] ) , '/' ) ) . '" alt="' . $ this -> contentElement [ "label" ] . '" title="' . $ this -> contentElement [ "label" ] . '"/>' ; } else { $ color = $ this -> getColor ( $ this -> contentElement ) ; if ( $ color ) { $ styles [ ] = "background-color: #" . $ color ; } $ styles [ ] = "color: #fff" ; $ markup = '<span class="icon-unify mask-default-icon" style="' . implode ( "; " , $ styles ) . '">' . mb_substr ( $ this -> contentElement [ "label" ] , 0 , 1 ) . '</span>' ; } } return $ markup ; }
Renders the actual icon
@param Icon $icon
@param array $options
@return string
@throws \InvalidArgumentException
@author Benjamin Butschell <bb@webprofil.at>
Renders the actual icon