‪TYPO3CMS  9.5
ShowExtensionVersionsViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
19 
25 {
29  protected ‪$tagName = 'a';
30 
34  public function ‪initializeArguments()
35  {
36  parent::initializeArguments();
37  $this->registerArgument('extension', Extension::class, '', true);
38  }
39 
45  public function ‪render()
46  {
48  $extension = $this->arguments['extension'];
49 
50  $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
51  $action = 'showAllVersions';
52  $uri = $uriBuilder->reset()->uriFor($action, [
53  'extensionKey' => $extension->getExtensionKey(),
54  ], 'List');
55  $this->tag->addAttribute('href', $uri);
56 
57  // Set class
58  $this->tag->addAttribute('class', 'versions-all ui-icon ui-icon-triangle-1-s');
59 
60  $label = ‪\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('extensionList.showAllVersions.label', 'extensionmanager');
61  $this->tag->addAttribute('title', $label);
62  $this->tag->setContent($label);
63  return $this->tag->render();
64  }
65 }
‪TYPO3\CMS\Extensionmanager\Domain\Model\Extension
Definition: Extension.php:24
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ShowExtensionVersionsViewHelper\$tagName
‪string $tagName
Definition: ShowExtensionVersionsViewHelper.php:28
‪TYPO3\CMS\Extensionmanager\ViewHelpers
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ShowExtensionVersionsViewHelper
Definition: ShowExtensionVersionsViewHelper.php:25
‪TYPO3\CMS\Extbase\Utility\LocalizationUtility\translate
‪static string null translate($key, $extensionName=null, $arguments=null, string $languageKey=null, array $alternativeLanguageKeys=null)
Definition: LocalizationUtility.php:63
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ShowExtensionVersionsViewHelper\render
‪string render()
Definition: ShowExtensionVersionsViewHelper.php:44
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ShowExtensionVersionsViewHelper\initializeArguments
‪initializeArguments()
Definition: ShowExtensionVersionsViewHelper.php:33