2 declare(strict_types = 1);
18 use Psr\Http\Message\ResponseInterface;
19 use Psr\Http\Message\ServerRequestInterface;
47 $this->iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
48 $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
57 return new HtmlResponse($this->iconRegistry->getCacheIdentifier());
65 public function getIconAction(ServerRequestInterface $request): ResponseInterface
67 $parsedBody = $request->getParsedBody();
68 $queryParams = $request->getQueryParams();
69 $requestedIcon = json_decode($parsedBody[
'icon'] ?? $queryParams[
'icon'],
true);
71 list($identifier, $size, $overlayIdentifier, $iconState, $alternativeMarkupIdentifier) = $requestedIcon;
73 if (empty($overlayIdentifier)) {
74 $overlayIdentifier =
null;
78 $icon = $this->iconFactory->getIcon($identifier, $size, $overlayIdentifier, $iconState);
80 return new HtmlResponse($icon->render($alternativeMarkupIdentifier));