TYPO3 CMS  TYPO3_6-2
HistoryEntryViewHelper.php
Go to the documentation of this file.
1 <?php
3 
17 
24 
30 
37  public function render($uid) {
39  $historyEntry = $this->historyEntryRepository->findOneBySysLogUid($uid);
40  if (!$historyEntry instanceof \TYPO3\CMS\Belog\Domain\Model\HistoryEntry) {
41  return '';
42  }
44  'changesInFields',
45  $this->controllerContext->getRequest()->getControllerExtensionName(),
46  array($historyEntry->getFieldlist())
47  );
48  $historyIcon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-history-open', array(
49  'title' => \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('showHistory', $this->controllerContext->getRequest()->getControllerExtensionName())
50  ));
51  $historyHref = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'typo3/' .
53  'record_history',
54  array(
55  'sh_uid' => $historyEntry->getUid(),
56  'returnUrl' => \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI'),
57  )
58  );
59  $historyLink = '<a href="' . htmlspecialchars($historyHref) . '">' . $historyIcon . '</a>';
60  return $historyLabel . '&nbsp;' . $historyLink;
61  }
62 
63 }
$uid
Definition: server.php:36
$historyEntryRepository
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
static translate($key, $extensionName, $arguments=NULL)