[TASK] Re-work/simplify copyright header in PHP files - Part 9
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / ViewHelpers / ShowExtensionVersionsViewHelper.php
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 /**
17 * Display a link to show all versions of an extension
18 *
19 * @author Susanne Moog <susanne.moog@typo3.org>
20 */
21 class ShowExtensionVersionsViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper {
22
23 /**
24 * @var string
25 */
26 protected $tagName = 'a';
27
28 /**
29 * Renders an install link
30 *
31 * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
32 * @return string the rendered a tag
33 */
34 public function render($extension) {
35 $uriBuilder = $this->controllerContext->getUriBuilder();
36 $action = 'showAllVersions';
37 $uri = $uriBuilder->reset()->uriFor($action, array(
38 'extensionKey' => $extension->getExtensionKey(),
39 ), 'List');
40 $this->tag->addAttribute('href', $uri);
41
42 // Set class
43 $this->tag->addAttribute('class', 'versions-all ui-icon ui-icon-triangle-1-s');
44
45 $label = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('extensionList.showAllVersions.label', 'extensionmanager');
46 $this->tag->addAttribute('title', $label);
47 $this->tag->setContent($label);
48 return $this->tag->render();
49 }
50
51 }