TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Backend\History\RecordHistory Class Reference

Public Member Functions

 __construct ()
 
 main ()
 
 toggleHighlight ($uid)
 
 performRollback ($diff)
 
 displaySettings ()
 
 displayMultipleDiff ($diff)
 
 renderDiff ($entry, $table, $rollbackUid=0)
 
 createMultipleDiff ()
 
 createChangeLog ()
 
 getHistoryData ($table, $uid)
 
 generateTitle ($table, $uid)
 
 createRollbackLink ($key, $alt='', $type=0)
 
 linkPage ($str, $inparams=[], $anchor='', $title='')
 
 removeFilefields ($table, $dataArray)
 
 resolveElement ($table, $uid)
 
 resolveShUid ()
 

Public Attributes

 $maxSteps = 20
 
 $showDiff = 1
 
 $showSubElements = 1
 
 $showInsertDelete = 1
 
 $element
 
 $lastSyslogId
 
 $returnUrl
 
 $changeLog = []
 
 $showMarked = false
 

Protected Member Functions

 hasPageAccess ($table, $uid)
 
 hasTableAccess ($table)
 
 getRecord ($table, $uid)
 
 getBackendUser ()
 
 getArgument ($name)
 
 getLanguageService ()
 
 getDatabaseConnection ()
 

Protected Attributes

 $recordCache = []
 
 $pageAccessCache = []
 
 $iconFactory
 

Detailed Description

Class for the record history display module show_rechis

Definition at line 30 of file RecordHistory.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\History\RecordHistory::__construct ( )

Member Function Documentation

◆ createChangeLog()

◆ createMultipleDiff()

TYPO3\CMS\Backend\History\RecordHistory::createMultipleDiff ( )

Creates a diff between the current version of the records and the selected version

Returns
array Diff for many elements, 0 if no changelog is found

Definition at line 658 of file RecordHistory.php.

Referenced by TYPO3\CMS\Backend\History\RecordHistory\main().

◆ createRollbackLink()

TYPO3\CMS\Backend\History\RecordHistory::createRollbackLink (   $key,
  $alt = '',
  $type = 0 
)

Creates a link for the rollback

Parameters
string$keyParameter which is set to rollbackFields
string$altOptional, alternative label and title tag of image
int$typeOptional, type of rollback: 0 - ALL; 1 - element; 2 - field
Returns
string HTML output

Definition at line 872 of file RecordHistory.php.

References TYPO3\CMS\Backend\History\RecordHistory\linkPage().

Referenced by TYPO3\CMS\Backend\History\RecordHistory\displayMultipleDiff(), and TYPO3\CMS\Backend\History\RecordHistory\renderDiff().

◆ displayMultipleDiff()

TYPO3\CMS\Backend\History\RecordHistory::displayMultipleDiff (   $diff)

Displays a diff over multiple fields including rollback links

Parameters
array$diffDifference array
Returns
string HTML output

Definition at line 562 of file RecordHistory.php.

References TYPO3\CMS\Backend\History\RecordHistory\createRollbackLink(), TYPO3\CMS\Backend\History\RecordHistory\generateTitle(), TYPO3\CMS\Backend\History\RecordHistory\getLanguageService(), and TYPO3\CMS\Backend\History\RecordHistory\renderDiff().

Referenced by TYPO3\CMS\Backend\History\RecordHistory\main().

◆ displaySettings()

◆ generateTitle()

TYPO3\CMS\Backend\History\RecordHistory::generateTitle (   $table,
  $uid 
)

Generates the title and puts the record title behind

Parameters
string$table
string$uid
Returns
string

Definition at line 854 of file RecordHistory.php.

References $GLOBALS, $uid, TYPO3\CMS\Backend\History\RecordHistory\getRecord(), and TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitle().

Referenced by TYPO3\CMS\Backend\History\RecordHistory\displayMultipleDiff(), and TYPO3\CMS\Backend\History\RecordHistory\displaySettings().

◆ getArgument()

TYPO3\CMS\Backend\History\RecordHistory::getArgument (   $name)
protected

Fetches GET/POST arguments and sanitizes the values for the expected disposal. Invalid values will be converted to an empty string.

Parameters
string$nameName of the argument
Returns
array|string|int

Definition at line 1046 of file RecordHistory.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\_GP(), and TYPO3\CMS\Core\Utility\GeneralUtility\sanitizeLocalUrl().

Referenced by TYPO3\CMS\Backend\History\RecordHistory\__construct(), TYPO3\CMS\Backend\History\RecordHistory\displaySettings(), TYPO3\CMS\Backend\History\RecordHistory\main(), and TYPO3\CMS\Backend\History\RecordHistory\resolveShUid().

◆ getBackendUser()

TYPO3\CMS\Backend\History\RecordHistory::getBackendUser ( )
protected

◆ getDatabaseConnection()

◆ getHistoryData()

TYPO3\CMS\Backend\History\RecordHistory::getHistoryData (   $table,
  $uid 
)

Gets history and delete/insert data from sys_log and sys_history

Parameters
string$tableDB table name
int$uidUID of record
Returns
array|int Array of history data of the record or 0 if no history could be fetched

Definition at line 763 of file RecordHistory.php.

References TYPO3\CMS\Backend\History\RecordHistory\$changeLog, $GLOBALS, $uid, debug(), TYPO3\CMS\Backend\History\RecordHistory\getDatabaseConnection(), TYPO3\CMS\Backend\History\RecordHistory\hasPageAccess(), TYPO3\CMS\Backend\History\RecordHistory\hasTableAccess(), and TYPO3\CMS\Backend\History\RecordHistory\resolveElement().

Referenced by TYPO3\CMS\Backend\History\RecordHistory\createChangeLog().

◆ getLanguageService()

TYPO3\CMS\Backend\History\RecordHistory::getLanguageService ( )
protected

◆ getRecord()

TYPO3\CMS\Backend\History\RecordHistory::getRecord (   $table,
  $uid 
)
protected

◆ hasPageAccess()

◆ hasTableAccess()

TYPO3\CMS\Backend\History\RecordHistory::hasTableAccess (   $table)
protected

Determines whether user has access to a table.

Parameters
string$table
Returns
bool

Definition at line 1008 of file RecordHistory.php.

References TYPO3\CMS\Backend\History\RecordHistory\getBackendUser().

Referenced by TYPO3\CMS\Backend\History\RecordHistory\getHistoryData().

◆ linkPage()

TYPO3\CMS\Backend\History\RecordHistory::linkPage (   $str,
  $inparams = [],
  $anchor = '',
  $title = '' 
)

Creates a link to the same page.

Parameters
string$strString to wrap in tags (must be htmlspecialchars()'ed prior to calling function)
array$inparamsArray of key/value pairs to override the default values with.
string$anchorPossible anchor value.
string$titlePossible title.
Returns
string Link. private

Definition at line 887 of file RecordHistory.php.

References TYPO3\CMS\Backend\History\RecordHistory\$element, TYPO3\CMS\Backend\History\RecordHistory\$lastSyslogId, $params, and TYPO3\CMS\Backend\History\RecordHistory\$returnUrl.

Referenced by TYPO3\CMS\Backend\History\RecordHistory\createRollbackLink(), and TYPO3\CMS\Backend\History\RecordHistory\displaySettings().

◆ main()

◆ performRollback()

TYPO3\CMS\Backend\History\RecordHistory::performRollback (   $diff)

◆ removeFilefields()

TYPO3\CMS\Backend\History\RecordHistory::removeFilefields (   $table,
  $dataArray 
)

Will traverse the field names in $dataArray and look in $GLOBALS['TCA'] if the fields are of types which cannot be handled by the sys_history (that is currently group types with internal_type set to "file")

Parameters
string$tableTable name
array$dataArrayThe data array
Returns
array The modified data array private

Definition at line 909 of file RecordHistory.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\History\RecordHistory\performRollback().

◆ renderDiff()

TYPO3\CMS\Backend\History\RecordHistory::renderDiff (   $entry,
  $table,
  $rollbackUid = 0 
)

Renders HTML table-rows with the comparison information of an sys_history entry record

Parameters
array$entrysys_history entry record.
string$tableThe table name
int$rollbackUidIf set to UID of record, display rollback links
Returns
string|NULL HTML table private

Definition at line 615 of file RecordHistory.php.

References $GLOBALS, TYPO3\CMS\Backend\History\RecordHistory\createRollbackLink(), TYPO3\CMS\Backend\Utility\BackendUtility\getItemLabel(), TYPO3\CMS\Backend\History\RecordHistory\getLanguageService(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Backend\History\RecordHistory\displayMultipleDiff(), and TYPO3\CMS\Backend\History\RecordHistory\displaySettings().

◆ resolveElement()

TYPO3\CMS\Backend\History\RecordHistory::resolveElement (   $table,
  $uid 
)

Convert input element reference to workspace version if any.

Parameters
string$tableTable of input element
int$uidUID of record
Returns
int converted UID of record

Definition at line 928 of file RecordHistory.php.

References $GLOBALS, $uid, TYPO3\CMS\Backend\History\RecordHistory\getBackendUser(), and TYPO3\CMS\Backend\Utility\BackendUtility\getWorkspaceVersionOfRecord().

Referenced by TYPO3\CMS\Backend\History\RecordHistory\getHistoryData().

◆ resolveShUid()

TYPO3\CMS\Backend\History\RecordHistory::resolveShUid ( )

◆ toggleHighlight()

TYPO3\CMS\Backend\History\RecordHistory::toggleHighlight (   $uid)

Toggles highlight state of record

Parameters
int$uidUid of sys_history entry
Returns
void

Definition at line 181 of file RecordHistory.php.

References $uid, and TYPO3\CMS\Backend\History\RecordHistory\getDatabaseConnection().

Referenced by TYPO3\CMS\Backend\History\RecordHistory\main().

Member Data Documentation

◆ $changeLog

TYPO3\CMS\Backend\History\RecordHistory::$changeLog = []

◆ $element

TYPO3\CMS\Backend\History\RecordHistory::$element

◆ $iconFactory

TYPO3\CMS\Backend\History\RecordHistory::$iconFactory
protected

Definition at line 102 of file RecordHistory.php.

◆ $lastSyslogId

TYPO3\CMS\Backend\History\RecordHistory::$lastSyslogId

Definition at line 72 of file RecordHistory.php.

Referenced by TYPO3\CMS\Backend\History\RecordHistory\linkPage().

◆ $maxSteps

TYPO3\CMS\Backend\History\RecordHistory::$maxSteps = 20

Definition at line 37 of file RecordHistory.php.

◆ $pageAccessCache

TYPO3\CMS\Backend\History\RecordHistory::$pageAccessCache = []
protected

Definition at line 97 of file RecordHistory.php.

◆ $recordCache

TYPO3\CMS\Backend\History\RecordHistory::$recordCache = []
protected

Definition at line 92 of file RecordHistory.php.

◆ $returnUrl

TYPO3\CMS\Backend\History\RecordHistory::$returnUrl

Definition at line 77 of file RecordHistory.php.

Referenced by TYPO3\CMS\Backend\History\RecordHistory\linkPage().

◆ $showDiff

TYPO3\CMS\Backend\History\RecordHistory::$showDiff = 1

Definition at line 44 of file RecordHistory.php.

◆ $showInsertDelete

TYPO3\CMS\Backend\History\RecordHistory::$showInsertDelete = 1

Definition at line 58 of file RecordHistory.php.

◆ $showMarked

TYPO3\CMS\Backend\History\RecordHistory::$showMarked = false

Definition at line 87 of file RecordHistory.php.

◆ $showSubElements

TYPO3\CMS\Backend\History\RecordHistory::$showSubElements = 1

Definition at line 51 of file RecordHistory.php.