TYPO3 CMS  TYPO3_6-2
RemoveExtensionViewHelper.php
Go to the documentation of this file.
1 <?php
3 
22 
26  protected $tagName = 'a';
27 
34  public function render($extension) {
35  if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extension['key'])) {
36  return '';
37  }
38  if (
39  !in_array($extension['type'], \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::returnAllowedInstallTypes()) ||
40  $extension['type'] === 'System'
41  ) {
42  return '';
43  }
44  $uriBuilder = $this->controllerContext->getUriBuilder();
45  $action = 'removeExtension';
46  $uriBuilder->reset();
47  $uriBuilder->setFormat('json');
48  $uri = $uriBuilder->uriFor($action, array(
49  'extension' => $extension['key']
50  ), 'Action');
51  $this->tag->addAttribute('href', $uri);
52  $cssClass = 'removeExtension';
53  $this->tag->addAttribute('class', $cssClass);
54  $this->tag->addAttribute('title', \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('extensionList.remove', 'extensionmanager'));
55  $this->tag->setContent(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-delete'));
56  return $this->tag->render();
57  }
58 
59 }