use wcf\system\Regex;
use wcf\system\request\LinkHandler;
use wcf\system\style\FontAwesomeIcon;
+use wcf\system\style\FontAwesomeIconBrand;
+use wcf\system\style\IFontAwesomeIcon;
use wcf\system\WCF;
/**
/**
* @since 6.0
*/
- public function getIcon(): ?FontAwesomeIcon
+ public function getIcon(): ?IFontAwesomeIcon
{
if ($this->iconClassName && !\str_starts_with($this->iconClassName, 'fa-')) {
- return FontAwesomeIcon::fromString($this->iconClassName);
+ if (\str_starts_with($this->iconClassName, '@brand:')) {
+ return FontAwesomeIconBrand::fromName(\substr($this->iconClassName, 7));
+ } else {
+ return FontAwesomeIcon::fromString($this->iconClassName);
+ }
}
return FontAwesomeIcon::fromValues('bars');
protected function getElement(\DOMXPath $xpath, array &$elements, \DOMElement $element)
{
if ($element->tagName === 'iconclassname') {
- $solid = $element->getAttribute('solid');
- $elements['iconClassName'] = \sprintf(
- "%s;%s",
- $element->nodeValue,
- $solid === 'true' ? 'true' : 'false'
- );
+ $isBrandIcon = $element->getAttribute('type') === 'brand';
+ if ($isBrandIcon) {
+ $elements['iconClassName'] = \sprintf(
+ "@brand:%s",
+ $element->nodeValue,
+ );
+ } else {
+ $solid = $element->getAttribute('solid');
+ $elements['iconClassName'] = \sprintf(
+ "%s;%s",
+ $element->nodeValue,
+ $solid === 'true' ? 'true' : 'false'
+ );
+ }
} else {
$elements[$element->tagName] = $element->nodeValue;
}