TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Backend\History\RecordHistory Class Reference
Inheritance diagram for TYPO3\CMS\Backend\History\RecordHistory:
recordHistory

Public Member Functions

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

Public Attributes

 $maxSteps = 20
 
 $showDiff = 1
 
 $showSubElements = 1
 
 $showInsertDelete = 1
 
 $element
 
 $lastSyslogId
 
 $returnUrl
 
 $changeLog = array()
 
 $showMarked = FALSE
 

Protected Member Functions

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

Protected Attributes

 $recordCache = array()
 
 $pageAccessCache = array()
 

Detailed Description

Class for the record history display script (show_rechis.php)

XHTML Compliant

Author
Sebastian Kurfürst sebas.nosp@m.tian.nosp@m.@garb.nosp@m.age-.nosp@m.group.nosp@m..de Class for the record history display script (show_rechis.php)
Sebastian Kurfürst sebas.nosp@m.tian.nosp@m.@garb.nosp@m.age-.nosp@m.group.nosp@m..de

Definition at line 33 of file RecordHistory.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor for the class

Todo:
Define visibility

Definition at line 104 of file RecordHistory.php.

References TYPO3\CMS\Backend\History\RecordHistory\getArgument(), and TYPO3\CMS\Backend\History\RecordHistory\resolveShUid().

Member Function Documentation

◆ createChangeLog()

TYPO3\CMS\Backend\History\RecordHistory::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
Todo:
Define visibility

Definition at line 569 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
integer$typeOptional, type of rollback: 0 - ALL; 1 - element; 2 - field
Returns
string HTML output
Todo:
Define visibility

Definition at line 768 of file RecordHistory.php.

References TYPO3\CMS\Backend\History\RecordHistory\linkPage(), and TYPO3\CMS\Backend\Utility\IconUtility\skinImg().

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

◆ displayHistory()

◆ 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
Todo:
Define visibility

Definition at line 483 of file RecordHistory.php.

References $GLOBALS, TYPO3\CMS\Backend\History\RecordHistory\createRollbackLink(), TYPO3\CMS\Backend\History\RecordHistory\generateTitle(), 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
Todo:
Define visibility

Definition at line 750 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\displayHistory(), and TYPO3\CMS\Backend\History\RecordHistory\displayMultipleDiff().

◆ 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|integer

Definition at line 915 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

Gets the current backend user.

Returns

Definition at line 903 of file RecordHistory.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\History\RecordHistory\hasPageAccess(), and TYPO3\CMS\Backend\History\RecordHistory\hasTableAccess().

◆ 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
integer$uidUID of record
Returns
array history data of the record
Todo:
Define visibility

Definition at line 670 of file RecordHistory.php.

References TYPO3\CMS\Backend\History\RecordHistory\$changeLog, $GLOBALS, $uid, debug(), 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().

◆ getRecord()

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

Gets a database record.

Parameters
string$table
integer$uid
Returns
array|NULL

Definition at line 891 of file RecordHistory.php.

References $uid.

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

◆ hasPageAccess()

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

◆ hasTableAccess()

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

Determines whether user has access to a table.

Parameters
string$table
Returns
boolean

Definition at line 880 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 = array(),
  $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
Todo:
Define visibility

Definition at line 783 of file RecordHistory.php.

References TYPO3\CMS\Backend\History\RecordHistory\$element, TYPO3\CMS\Backend\History\RecordHistory\$lastSyslogId, TYPO3\CMS\Backend\History\RecordHistory\$returnUrl, and TYPO3\CMS\Backend\Utility\BackendUtility\getModuleUrl().

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

◆ main()

◆ performRollback()

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

perform rollback

Parameters
array$diffDiff array to rollback
Returns
void private
Todo:
Define visibility

Definition at line 185 of file RecordHistory.php.

References TYPO3\CMS\Backend\History\RecordHistory\createChangeLog(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), and TYPO3\CMS\Backend\History\RecordHistory\removeFilefields().

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

◆ 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
Todo:
Define visibility

Definition at line 804 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
integer$rollbackUidIf set to UID of record, display rollback links
Returns
string HTML table private
Todo:
Define visibility

Definition at line 530 of file RecordHistory.php.

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

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

◆ resolveElement()

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

Convert input element reference to workspace version if any.

Parameters
string$tableTable of input element
integer$uidUID of record
Returns
integer converted UID of record
Todo:
Define visibility

Definition at line 823 of file RecordHistory.php.

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

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

◆ resolveShUid()

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

Resolve sh_uid (used from log)

Returns
void
Todo:
Define visibility

Definition at line 838 of file RecordHistory.php.

References $GLOBALS, and TYPO3\CMS\Backend\History\RecordHistory\getArgument().

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

◆ toggleHighlight()

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

Toggles highlight state of record

Parameters
integer$uidUid of sys_history entry
Returns
void
Todo:
Define visibility

Definition at line 170 of file RecordHistory.php.

References $GLOBALS, and $uid.

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

Member Data Documentation

◆ $changeLog

TYPO3\CMS\Backend\History\RecordHistory::$changeLog = array()

◆ $element

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

◆ $lastSyslogId

TYPO3\CMS\Backend\History\RecordHistory::$lastSyslogId
Todo:
Define visibility

Definition at line 71 of file RecordHistory.php.

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

◆ $maxSteps

TYPO3\CMS\Backend\History\RecordHistory::$maxSteps = 20
Todo:
Define visibility

Definition at line 40 of file RecordHistory.php.

◆ $pageAccessCache

TYPO3\CMS\Backend\History\RecordHistory::$pageAccessCache = array()
protected

Definition at line 97 of file RecordHistory.php.

◆ $recordCache

TYPO3\CMS\Backend\History\RecordHistory::$recordCache = array()
protected

Definition at line 92 of file RecordHistory.php.

◆ $returnUrl

TYPO3\CMS\Backend\History\RecordHistory::$returnUrl
Todo:
Define visibility

Definition at line 76 of file RecordHistory.php.

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

◆ $showDiff

TYPO3\CMS\Backend\History\RecordHistory::$showDiff = 1
Todo:
Define visibility

Definition at line 46 of file RecordHistory.php.

◆ $showInsertDelete

TYPO3\CMS\Backend\History\RecordHistory::$showInsertDelete = 1
Todo:
Define visibility

Definition at line 58 of file RecordHistory.php.

◆ $showMarked

TYPO3\CMS\Backend\History\RecordHistory::$showMarked = FALSE
Todo:
Define visibility

Definition at line 87 of file RecordHistory.php.

◆ $showSubElements

TYPO3\CMS\Backend\History\RecordHistory::$showSubElements = 1
Todo:
Define visibility

Definition at line 52 of file RecordHistory.php.