TYPO3 CMS  TYPO3_6-2
ElementHistoryController.php
Go to the documentation of this file.
1 <?php
3 
18 
26 
30  public $content;
31 
38  public $doc;
39 
43  public function __construct() {
44  $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_show_rechis.xlf');
45  $GLOBALS['SOBE'] = $this;
46 
47  $this->init();
48  }
49 
55  protected function init() {
56  // Create internal template object
57  $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
58  $this->doc->backPath = $GLOBALS['BACK_PATH'];
59  $this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/show_rechis.html');
60  // Start the page header
61  $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
62  }
63 
69  public function main() {
70  // Start history object
71  $historyObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\History\\RecordHistory');
72  // Get content:
73  $this->content .= $historyObj->main();
74  // Setting up the buttons and markers for docheader
75  $docHeaderButtons = $this->getButtons();
76  $markers['CONTENT'] = $this->content;
77  $markers['CSH'] = $docHeaderButtons['csh'];
78  // Build the <body> for the module
79  $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
80  $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
81  }
82 
88  public function printContent() {
89  $this->content .= $this->doc->endPage();
90  $this->content = $this->doc->insertStylesAndJS($this->content);
91  echo $this->content;
92  }
93 
99  protected function getButtons() {
100  $buttons = array(
101  'csh' => '',
102  'back' => ''
103  );
104  // CSH
105  $buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'history_log', $GLOBALS['BACK_PATH'], '', TRUE);
106  // Start history object
107  $historyObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\History\\RecordHistory');
108  if ($historyObj->returnUrl) {
109  $buttons['back'] = '<a href="' . htmlspecialchars($historyObj->returnUrl) . '" class="typo3-goBack">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
110  }
111  return $buttons;
112  }
113 
114 }
static cshItem($table, $field, $BACK_PATH, $wrap='', $onlyIconMode=FALSE, $styleAttrib='')
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]