Renders Font Awesome icon.
@param string $icon Name of the Font Awesome icon.
@param array $arguments Optional arguments for the icon (see https://fontawesome.com/how-to-use/on-the-web/styling).
@return Html HTML element with icon and its arguments.
428801
public static function createIcon(string $icon, array $arguments = null) {
		$element = Html::el("i");
		
		if($icon == "b" or $icon == "l" or $icon == "s" or $icon == "r") {
			// Markup of icon which use Font Awesome 5.
			$class = ["fa".$icon];
		} else {
			// Markup of icon which use Font Awesome 4.
			$class = ["fa fa-".$icon];
		}
		
		if(isset($arguments)) {
			foreach($arguments as $argument) {
				$class[] = "fa-".$argument;
			}
		}
		
		$element->addAttributes(["class" => $class, "aria-hidden" => "true"]);
		return $element;
	}
709309
public function setNoText($icon = null)
    {
        $this->options['text'] = false;
        if ($icon !== null) {
            $this->setIcon($icon);
        }

        return $this;
    }
714957
public function iconFunction($icon, $iconSet = 'icon')
    {
        if ($iconSet == 'icon') {
            $iconSet = $this->iconPrefix;
        }
        $icon = str_replace('+', ' '.$iconSet.'-', $icon);

        return sprintf('<%1$s class="%2$s %2$s-%3$s"></%1$s>', $this->iconTag, $iconSet, $icon);
    }
146238
public function addIcon($row, $label, DataContainer $dc, $args)
  {
    $image = 'file_type_sets';
    
    if (!$row['published'])
    {
      $image .= '_';
    }
    
    $args[0] = sprintf('<div class="list_icon_new" style="background-image:url(\'system/modules/DocumentManagementSystemFileTypeSets/assets/%s.png\'); height: 16px;" data-icon="system/modules/DocumentManagementSystemFileTypeSets/assets/%s.png" data-icon-disabled="system/modules/DocumentManagementSystemFileTypeSets/assets/%s.png">&nbsp;</div>', $image, rtrim($image, '_'), rtrim($image, '_') . '_');
    
    $args[2] = \ContaoDMS\DmsUtils::getCuttedAllowedFileTypes($row['file_types']);
    
    return $args;
  }
1006003
public static function icon($icon, $type = self::FONT_AWESOME)
    {
        $class = null;

        if ($type === self::FONT_AWESOME) {
            $class = 'fa fa-' . $icon;

        }
        else if ($type === self::FONT_BOOTSTRAP) {
            $class = 'glyphicon glyphicon-' . $icon;
        }
        else {
            $class = $icon;
        }

        return self::tag('i', '', $class, '');
    }
86230
public static function icon($icon, $htmlOptions = array(), $tagName = 'span')
    {
        if (is_string($icon)) {
            if (strpos($icon, 'glyphicon-') === false) {
                $icon = 'glyphicon-' . implode(' glyphicon-', explode(' ', $icon));
            }
            self::addCssClass(array('glyphicon', $icon), $htmlOptions);
            $color = TbArray::popValue('color', $htmlOptions);
            if (!empty($color) && $color === self::ICON_COLOR_WHITE) {
                self::addCssClass("glyphicon-white", $htmlOptions);
            }
            return self::openTag($tagName, $htmlOptions) . parent::closeTag($tagName); // tag won't work in this case
        }
        return '';
    }
890055
public function addToIcon($icon) {
		$this->addToProperty("class", $icon);
		return $this->addToMember($this->_icon, $icon);
	}
1331491
protected function materialDesignIconicFontList($items) {

        $innerHTML = true === is_array($items) ? implode("\n", $items) : $items;

        return static::coreHTMLElement("ul", $innerHTML, ["class" => "zmdi-hc-ul"]);
    }
447808
protected function createIcon($iconName)
	{
		if (is_callable($this->createIconCallback)) {
			return call_user_func($this->createIconCallback, $iconName);
		} else {
			return Icon::create($iconName);
		}
	}
569195
public function getLinkFontIconTag($icon = null)
    {
        if ($icon) {
            $self = clone $this;
            $self->FontIcon = $icon;
            return $self->getFontIconTag();
        }
        
        return $this->getFontIconTag();
    }
1305798
public function render(array $arguments = [], $renderer = null) {
        $this->runDynamicCallbacks($arguments);

        return $this->baseRender($arguments, $renderer);
    }
154283
public function addIcon($icon,$before=true,$labeled=false){
		$iconO=$icon;
		if(\is_string($icon)){
			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
		}
		if($labeled!==false){
			$direction=($before===true)?Direction::LEFT:Direction::RIGHT;
			$this->addToProperty("class", $direction." labeled icon");
			$this->tagName="div";
		}
		$this->addContent($iconO,$before);
		return $iconO;
	}
822190
public static function parseMaterialDesignIconicFontIcon(array $args) {

        $icon = static::newMaterialDesignIconicFontIcon();

        $icon->setName(ArrayHelper::get($args, "name", "home"));
        $icon->setStyle(ArrayHelper::get($args, "style"));

        $icon->setBorder(ArrayHelper::get($args, "border", false));
        $icon->setFixedWidth(ArrayHelper::get($args, "fixedWidth", false));
        $icon->setFlip(ArrayHelper::get($args, "flip"));
        $icon->setPull(ArrayHelper::get($args, "pull"));
        $icon->setRotate(ArrayHelper::get($args, "rotate"));
        $icon->setSize(ArrayHelper::get($args, "size"));
        $icon->setSpin(ArrayHelper::get($args, "spin"));

        return $icon;
    }
1135238
public function render(array $arguments = [], $renderer = null) {
        if(empty($this->itemsToDisplay)) {
            return $this->button->render($arguments);
        }

        return $this->baseRender($arguments, $renderer);
    }
370487
protected function render_help_icon(help_icon $helpicon) {
        $context = $helpicon->export_for_template($this);
        return $this->render_from_template('core/help_icon', $context);
    }
1361094
public static function icon($icon, $size = 0, $tag = 'i')
    {
        $icon = preg_replace('/(")(.*?)(")/', '$2', $icon);

        $icon_array = explode(',', $icon, 2);
        $icon = array_get($icon_array, 0);
        if (array_has($icon_array, 1)) {
            $attributes = explode(',', array_get($icon_array, 1, ''));
        }

        if (substr($icon, 1, 1) == ' ') {
            $type = substr($icon, 0, 1);
            $icon = substr($icon, 2);
        } else {
            $type = config('html.icon.default.type', 'l');
        }
        $icon = ($icon[0] === '-') ? substr($icon, 1) : 'fa-'.$icon;
        $size = ($size > 0) ? ' fa-'.$size : '';
        $fa = self::$tag()->addClass('fa'.$type.' fa-fw '.$icon.$size)->aria('hidden', 'true');

        if (isset($attributes) && is_array($attributes)) {
            foreach ($attributes as $attr) {
                list($attr_name, $attr_value) = explode('=', $attr);
                switch ($attr_name) {
                    case 'transform':
                        $fa->data('fa-'.$attr_name, $attr_value);
                        break;
                    default:
                        $fa->attr($attr_name, $attr_value);
                        break;
                }
            }
        }

        return $fa;
    }
944012
public function setIcon($icon)
    {
        switch ($icon) {
            case 'info':
            case 'error':
            case 'warning':
                $this->icon = $icon;
                break;
            default:
                if (file_exists($icon) && is_file($icon)) {
                    $this->icon = $icon;
                } else {
                    if (isset($this->log)) {
                        $this->log(
                            sprintf(
                                "%s is not a file. Using default icon instead.",
                                $icon
                            ),
                            Project::MSG_WARN
                        );
                    }
                }
        }
    }