<?php

namespace Internetgalerie\IgDatapoolFe\Services;

//implements \TYPO3\CMS\Core\SingletonInterface {
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class IconService
{
    /**
     * Initialize the arguments.
     *
     * @param string $identifier
     *
     * @return string
     **/
    public static function getIcon($identifier, $class='', $style='')
    {
        $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
        return '<div class="dp-sprite'.($class ? ' '.$class : '').'"'.($style ? ' style="'.$style.'"' : '').'>'. $iconFactory->getIcon($identifier, Icon::SIZE_SMALL)->render('inline').'</div>';
    }
}
