registerArgument('extension', 'array', '', true); } /** * Renders an install link * * @return string the rendered a tag */ public function render() { $extension = $this->arguments['extension']; $iconFactory = GeneralUtility::makeInstance(IconFactory::class); if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extension['key'])) { return '' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . ''; } if ( !in_array($extension['type'], \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::returnAllowedInstallTypes()) || $extension['type'] === 'System' ) { return '' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . ''; } $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder(); $action = 'removeExtension'; $uriBuilder->reset(); $uriBuilder->setFormat('json'); $uri = $uriBuilder->uriFor($action, [ 'extension' => $extension['key'] ], 'Action'); $this->tag->addAttribute('href', $uri); $cssClass = 'removeExtension btn btn-default'; $this->tag->addAttribute('class', $cssClass); $this->tag->addAttribute('title', \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('extensionList.remove', 'extensionmanager')); $this->tag->setContent($iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render()); return $this->tag->render(); } }