TYPO3 CMS  TYPO3_6-2
DownloadExtensionDataViewHelper.php
Go to the documentation of this file.
1 <?php
3 
22 
26  protected $tagName = 'a';
27 
34  public function render($extension) {
35  $filePrefix = PATH_site . $extension['siteRelPath'];
36  if (!file_exists(($filePrefix . 'ext_tables.sql')) && !file_exists(($filePrefix . 'ext_tables_static+adt.sql'))) {
37  return '';
38  }
39  $uriBuilder = $this->controllerContext->getUriBuilder();
40  $uriBuilder->reset();
41  $uri = $uriBuilder->uriFor('downloadExtensionData', array(
42  'extension' => $extension['key']
43  ), 'Action');
44  $this->tag->addAttribute('href', $uri);
45  $cssClass = 'downloadExtensionData';
46  $this->tag->addAttribute('class', $cssClass);
47  $this->tag->addAttribute('title', \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('extensionList.downloadsql', 'extensionmanager'));
48  $this->tag->setContent(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-extension-sqldump'));
49  return $this->tag->render();
50  }
51 
52 }