use wcf\data\user\UserProfile;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\html\output\AmpHtmlOutputProcessor;
+use wcf\system\style\FontAwesomeIcon;
use wcf\util\FileUtil;
use wcf\util\StringUtil;
}
$icon = FileUtil::getIconNameByFilename($this->filename);
+ if ($icon) {
+ $icon = "file-{$icon}";
+ } else {
+ $icon = 'file';
+ }
- return '<span class="icon icon' . $size . ' fa-file' . ($icon ? '-' . $icon : '') . '-o"></span>';
+ return FontAwesomeIcon::fromValues($icon, false)->toHtml($size);
}
/**
$items = \array_map(static function (ViewableModerationQueue $queue) {
return [
'content' => $queue->getAffectedObject()->getTitle(),
- 'image' => '<span class="icon icon48 ' . $queue->getIconName() . '"></span>',
+ 'image' => $queue->getIcon()->toHtml(48),
'isUnread' => $queue->isNew(),
'link' => $queue->getLink(),
'objectId' => $queue->queueID,
use wcf\system\bbcode\SimpleMessageParser;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\moderation\queue\ModerationQueueManager;
+use wcf\system\style\FontAwesomeIcon;
use wcf\system\visitTracker\VisitTracker;
use wcf\system\WCF;
}
/**
- * @since 5.5
+ * @since 6.0
*/
- public function getIconName(): string
+ public function getIcon(): FontAwesomeIcon
{
$definition = ObjectTypeCache::getInstance()->getDefinition(ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID)->definitionID);
if ($definition->definitionName === 'com.woltlab.wcf.moderation.activation') {
if ($this->getAffectedObject()->enableTime) {
- return 'fa-clock-o';
+ return FontAwesomeIcon::fromValues('clock');
} else {
- return 'fa-check-square-o';
+ return FontAwesomeIcon::fromValues('square-check');
}
}
- return 'fa-exclamation-triangle';
+ return FontAwesomeIcon::fromValues('triangle-exclamation');
}
}
use wcf\system\language\LanguageFactory;
use wcf\system\request\RequestHandler;
use wcf\system\session\SessionHandler;
+use wcf\system\style\FontAwesomeIcon;
use wcf\system\user\group\assignment\UserGroupAssignmentHandler;
use wcf\system\WCF;
use wcf\util\UserRegistrationUtil;
$pos = \mb_strripos($groupName, $searchString);
if ($pos !== false && $pos == 0) {
$list[] = [
- 'icon' => '<span class="icon icon16 fa-users"></span>',
+ 'icon' => FontAwesomeIcon::fromValues('users')->toHtml(16),
'label' => $groupName,
'objectID' => $group->groupID,
'type' => 'group',
return FontAwesomeIcon::fromString($this->iconClassName);
}
- return FontAwesomeIcon::fromValues('bars', false);
+ return FontAwesomeIcon::fromValues('bars');
}
}
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\request\LinkHandler;
+use wcf\system\style\FontAwesomeIcon;
use wcf\system\user\notification\event\IUserNotificationEvent;
use wcf\system\user\notification\UserNotificationHandler;
use wcf\system\user\storage\UserStorageHandler;
if ($notificationData['authors'] === 1) {
$image = $event->getAuthor()->getAvatar()->getImageTag(48);
} else {
- $image = '<span class="icon icon48 fa-users"></span>';
+ $image = FontAwesomeIcon::fromValues('users')->toHtml(48);
}
if ($event->isConfirmed()) {
return new FontAwesomeIcon($name, $forceSolid);
}
- public static function fromValues(string $name, bool $forceSolid): self
+ public static function fromValues(string $name, bool $forceSolid = false): self
{
self::validateName($name);
namespace wcf\system\template\plugin;
+use wcf\system\style\FontAwesomeIcon;
use wcf\system\template\TemplateEngine;
use wcf\util\JSON;
HTML;
}
- $modifier = '';
- if ($type === 'solid') {
- $modifier = ' solid';
- }
-
- return <<<HTML
- <fa-icon size="{$size}" name="{$name}"{$modifier}></fa-icon>
- HTML;
+ $forceSolid = $type === 'solid';
+ return FontAwesomeIcon::fromValues($name, $forceSolid)->toHtml($size);
}
}
return '<li class="skip"><a href="' . self::insertPageNumber(
$link,
$pageNo - 1
- ) . '" title="' . WCF::getLanguage()->getDynamicVariable('wcf.global.page.previous') . '" class="icon icon24 fa-chevron-left jsTooltip" rel="prev"></a></li>' . "\n";
+ ) . '" title="' . WCF::getLanguage()->getDynamicVariable('wcf.global.page.previous') . '" class="jsTooltip" rel="prev">
+ <fa-icon size="24" name="chevron-left"></fa-icon>
+ </a></li>' . "\n";
} else {
- return '<li class="skip disabled"><span class="icon icon24 fa-chevron-left"></span></li>' . "\n";
+ return '<li class="skip disabled"><fa-icon size="24" name="chevron-left"></fa-icon></li>' . "\n";
}
}
return '<li class="skip"><a href="' . self::insertPageNumber(
$link,
$pageNo + 1
- ) . '" title="' . WCF::getLanguage()->getDynamicVariable('wcf.global.page.next') . '" class="icon icon24 fa-chevron-right jsTooltip" rel="next"></a></li>' . "\n";
+ ) . '" title="' . WCF::getLanguage()->getDynamicVariable('wcf.global.page.next') . '" class="jsTooltip" rel="next">
+ <fa-icon size="24" name="chevron-right"></fa-icon>
+ </a></li>' . "\n";
} else {
- return '<li class="skip disabled"><span class="icon icon24 fa-chevron-right"></span></li>' . "\n";
+ return '<li class="skip disabled"><fa-icon size="24" name="chevron-right"></fa-icon></li>' . "\n";
}
}