TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
ShowExtensionVersionsViewHelper.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
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 
18 
24 {
28  protected $tagName = 'a';
29 
33  public function initializeArguments()
34  {
35  parent::initializeArguments();
36  $this->registerArgument('extension', Extension::class, '', true);
37  }
38 
44  public function render()
45  {
47  $extension = $this->arguments['extension'];
48 
49  $uriBuilder = $this->controllerContext->getUriBuilder();
50  $action = 'showAllVersions';
51  $uri = $uriBuilder->reset()->uriFor($action, [
52  'extensionKey' => $extension->getExtensionKey(),
53  ], 'List');
54  $this->tag->addAttribute('href', $uri);
55 
56  // Set class
57  $this->tag->addAttribute('class', 'versions-all ui-icon ui-icon-triangle-1-s');
58 
59  $label = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('extensionList.showAllVersions.label', 'extensionmanager');
60  $this->tag->addAttribute('title', $label);
61  $this->tag->setContent($label);
62  return $this->tag->render();
63  }
64 }
static translate($key, $extensionName, $arguments=null)