TYPO3 CMS  TYPO3_6-2
FormatDetailsViewHelper.php
Go to the documentation of this file.
1 <?php
3 
23 
36  public function render(\TYPO3\CMS\Belog\Domain\Model\LogEntry $logEntry) {
37  $detailString = $logEntry->getDetails();
38  $substitutes = $logEntry->getLogData();
39  // Strip pathes from file names if the log was a file action
40  if ($logEntry->getType() === 2) {
41  $substitutes = $this->stripPathFromFilenames($substitutes);
42  }
43  // Substitute
44  $detailString = vsprintf($detailString, $substitutes);
45  // Remove possible pending other %s
46  $detailString = str_replace('%s', '', $detailString);
47  return htmlspecialchars($detailString);
48  }
49 
56  protected function stripPathFromFilenames(array $files = array()) {
57  foreach ($files as $key => $file) {
58  $files[$key] = basename($file);
59  }
60  return $files;
61  }
62 
63 }
render(\TYPO3\CMS\Belog\Domain\Model\LogEntry $logEntry)