objectManager = $objectManager; } /** * initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('extensionKey', 'string', 'Extension key', true); } /** * Renders a link to the update script screen if the extension has one * * @return string The rendered a tag */ public function render() { $extensionKey = $this->arguments['extensionKey']; // If the "class.ext_update.php" file exists, build link to the update script screen /** @var \TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility $updateScriptUtility */ $updateScriptUtility = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility::class); /** @var IconFactory $iconFactory */ $iconFactory = GeneralUtility::makeInstance(IconFactory::class); if ($updateScriptUtility->checkUpdateScriptExists($extensionKey)) { $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder(); $action = 'show'; $uri = $uriBuilder->reset()->uriFor( $action, ['extensionKey' => $extensionKey], 'UpdateScript' ); $this->tag->addAttribute('href', $uri); $this->tag->addAttribute('title', \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('extensionList.update.script', 'extensionmanager')); $this->tag->setContent($iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL)->render()); $tag = $this->tag->render(); } else { return '' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . ''; } return $tag; } }