TYPO3 CMS  TYPO3_6-2
UpdateScriptViewHelper.php
Go to the documentation of this file.
1 <?php
3 
23 
28  protected $objectManager;
29 
33  protected $tagName = 'a';
34 
41  public function render($extensionKey) {
42  $tag = '';
43 
44  // If the "class.ext_update.php" file exists, build link to the update script screen
46  $updateScriptUtility = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\UpdateScriptUtility');
47  if ($updateScriptUtility->checkUpdateScriptExists($extensionKey)) {
48  $uriBuilder = $this->controllerContext->getUriBuilder();
49  $action = 'show';
50  $uri = $uriBuilder->reset()->uriFor(
51  $action,
52  array('extensionKey' => $extensionKey),
53  'UpdateScript'
54  );
55  $this->tag->addAttribute('href', $uri);
56  $this->tag->addAttribute('title', \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('extensionList.update.script', 'extensionmanager'));
57  $this->tag->setContent(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('extensions-extensionmanager-update-script'));
58  $tag = $this->tag->render();
59  }
60  return $tag;
61  }
62 
63 }