ElementHistoryController

class \TYPO3\CMS\Backend\Controller\ContentElement\ElementHistoryController

Controller for showing the history module of TYPO3s backend.

Attributes

#[AsController]

Table of Contents

Properties

$historyObject  : RecordHistory
$iconFactory  : IconFactory
$moduleTemplateFactory  : ModuleTemplateFactory
$recordCache  : array
$returnUrl  : string
$showDiff  : bool
Display inline differences or not
$uriBuilder  : UriBuilder
$view  : ModuleTemplate

Methods

__construct()  : mixed
mainAction()  : ResponseInterface
Injects the request object for the current request or sub request As this controller goes only through the main() method, it is rather simple for now
addLanguageSwitcher()  : void
Add a translation selection dropdown if the record is language aware.
buildUrl()  : string
Generates the URL for a link to the current page
displayHistory()  : void
Shows the full change log
displayMultipleDiff()  : void
Displays a diff over multiple fields including rollback links
generatePageTitle()  : string
Renders a page reference of a move as title plus uid, so a page that has been deleted in the meantime is still identifiable.
generateTitle()  : string
Generates the title and puts the record title behind
getBackendUser()  : BackendUserAuthentication
getButtons()  : void
getEditLockFromElement()  : bool
Get the editlock value from page of a history element
getLanguageService()  : LanguageService
getRecord()  : array|null
Gets a database record (cached).
processSettings()  : array
renderDiff()  : array
Renders HTML table-rows with the comparison information of a sys_history entry record
setPagePath()  : void
Creates the correct path to the current record

Properties

$recordCache

protected array $recordCache = []

$returnUrl

protected string $returnUrl = ''

$showDiff

Display inline differences or not

protected bool $showDiff = true

Methods

__construct()

public __construct(IconFactory $iconFactory, UriBuilder $uriBuilder, ModuleTemplateFactory $moduleTemplateFactory, DiffUtility $diffUtility, FlexFormValueFormatter $flexFormValueFormatter, TcaSchemaFactory $tcaSchemaFactory, ComponentFactory $componentFactory, SiteFinder $siteFinder) : mixed

Parameters

$iconFactory : IconFactory
$uriBuilder : UriBuilder
$moduleTemplateFactory : ModuleTemplateFactory
$diffUtility : DiffUtility
$flexFormValueFormatter : FlexFormValueFormatter
$tcaSchemaFactory : TcaSchemaFactory
$componentFactory : ComponentFactory
$siteFinder : SiteFinder

mainAction()

Injects the request object for the current request or sub request As this controller goes only through the main() method, it is rather simple for now

public mainAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

addLanguageSwitcher()

Add a translation selection dropdown if the record is language aware.

protected addLanguageSwitcher(ServerRequestInterface $request, BackendUserAuthentication $backendUser, string $element) : void

Parameters

$request : ServerRequestInterface
$backendUser : BackendUserAuthentication
$element : string

buildUrl()

Generates the URL for a link to the current page

protected buildUrl([array $overrideParameters = [] ]) : string

Parameters

$overrideParameters : array = []

Return values

string

displayHistory()

Shows the full change log

protected displayHistory(array $historyEntries) : void

Parameters

$historyEntries : array

displayMultipleDiff()

Displays a diff over multiple fields including rollback links

protected displayMultipleDiff(array $diff) : void

Parameters

$diff : array

Difference array

generatePageTitle()

Renders a page reference of a move as title plus uid, so a page that has been deleted in the meantime is still identifiable.

protected generatePageTitle(int $pageId) : string

Parameters

$pageId : int

Return values

string

generateTitle()

Generates the title and puts the record title behind

protected generateTitle(string $table, string $uid) : string

Parameters

$table : string
$uid : string

Return values

string

getEditLockFromElement()

Get the editlock value from page of a history element

protected getEditLockFromElement(string $tableName, int $elementUid) : bool

Parameters

$tableName : string
$elementUid : int

Return values

bool

getRecord()

Gets a database record (cached).

protected getRecord(string $table, int $uid) : array|null

Parameters

$table : string
$uid : int

Return values

array|null

processSettings()

protected processSettings(ServerRequestInterface $request) : array

Parameters

$request : ServerRequestInterface

Return values

array

renderDiff()

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

protected renderDiff(array $entry, string $table, int $rollbackUid[, bool $showRollbackLink = false ]) : array

Parameters

$entry : array

sys_history entry record.

$table : string

The table name

$rollbackUid : int

The UID of the record

$showRollbackLink : bool = false

Whether a rollback link should be shown for each changed field

Return values

array —

array of records

setPagePath()

Creates the correct path to the current record

protected setPagePath(string $table, int $uid) : void

Parameters

$table : string
$uid : int
On this page