PageLayoutView implements LoggerAwareInterface uses LoggerAwareTrait
Child class for the Web > Page module
Will be removed in TYPO3 11
This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.
Table of Contents
Interfaces
- LoggerAwareInterface
Properties
- $CType_labels : array<string|int, mixed>
- Used to store labels for CTypes for tt_content elements
- $defLangBinding : bool
- If set TRUE, the language mode of tt_content elements will be rendered with hard binding between default language content elements and their translations!
- $doEdit : bool
- If TRUE, elements will have edit icons (probably this is whether the user has permission to edit the page content). Set externally.
- $id : int
- Page id
- $itemLabels : array<string|int, mixed>
- Used to store labels for the various fields in tt_content elements
- $option_newWizard : bool
- If TRUE, new-wizards are linked to rather than the regular new-element list.
- $pageRecord : array<string|int, string>
- Loaded with page record with version overlay if any.
- $tt_contentConfig : array<string|int, mixed>
- External, static: Configuration of tt_content element display:
- $tt_contentData : array<string|int, mixed>
- Used to move content up / down
- $contentElementCache : array<string|int, mixed>
- Caches the amount of content elements as a matrix
- $iconFactory : IconFactory
- $languageHasTranslationsCache : array<string|int, mixed>
- Stores whether a certain language has translations in it
- $localizationController : LocalizationController
- $pageinfo : array<string|int, mixed>
- Current ids page record
- $referenceCount : array<string|int, mixed>
- Cache the number of references to a record
- $siteLanguages : array<string|int, SiteLanguage>
- Contains site languages for this page ID
- $uriBuilder : UriBuilder
Methods
- __construct() : mixed
- createFromPageLayoutContext() : PageLayoutView
- getIcon() : string
- Creates the icon image tag for record from table and wraps it in a link which will trigger the click menu.
- getNonTranslatedTTcontentUids() : array<string|int, mixed>
- Filters out all tt_content uids which are already translated so only non-translated uids is left.
- getProcessedValue() : mixed
- Creates processed values for all field names in $fieldList based on values from $row array.
- getQueryBuilder() : QueryBuilder
- Returns a QueryBuilder configured to select $fields from $table where the pid is restricted.
- getResult() : array<string|int, mixed>
- Traverse the result pointer given, adding each record to array and setting some internal values at the same time.
- getTable_tt_content() : string
- Renders Content Elements from the tt_content table from page id
- getThumbCodeUnlinked() : string
- Create thumbnail code for record/field but not linked
- isDisabled() : bool
- Returns TRUE, if the record given as parameters is NOT visible based on hidden/starttime/endtime (if available)
- languageSelector() : string
- Make selector box for creating new translation in a language Displays only languages which are not yet present for the current page and that are not disabled with page TS.
- linkEditContent() : string
- Will create a link on the input string and possibly a big button after the string which links to editing in the RTE.
- newLanguageButton() : string
- Creates button which is used to create copies of records.
- renderContentElementHeader() : string
- renderContentElementPreview() : string
- Renders the preview part of a content element
- renderContentElementPreviewFromFluidTemplate() : string|null
- renderText() : string
- Processing of larger amounts of text (usually from RTE/bodytext fields) with word wrapping etc.
- thumbCode() : string
- Create thumbnail code for record/field
- tt_content_drawColHeader() : string
- Draw header for a content element column:
- tt_content_drawHeader() : string
- Draw the header for a single tt_content element
- tt_content_drawItem() : string
- Draws the preview content for a content element
- checkIfTranslationsExistInLanguage() : bool
- Checks whether translated Content Elements exist in the desired language If so, deny creating new ones via the UI
- generateLanguageView() : string
- Shows the content elements of the selected languages in each column.
- generateTtContentDataArray() : mixed
- Generates the data for previous and next elements which is needed for movements.
- getBackendLayoutView() : BackendLayoutView
- getBackendUser() : BackendUserAuthentication
- getContentRecordsPerColumn() : array<string|int, mixed>
- Gets content records per column.
- getLanguageService() : LanguageService
- Returns the language service
- getLocalizedPageTitle() : string
- getReferenceCount() : int
- Gets the number of records referencing the record with the UID $uid in the table $tableName.
- getSelectedLanguages() : array<string|int, int>
- Build a list of language IDs that should be rendered in this view
- hasContentModificationAndAccessPermissions() : bool
- Check if current user has modification and access permissions for content set
- initialize() : mixed
- isContentEditable() : bool
- Check if content can be edited by current user
- isDragAndDropAllowed() : bool
- Determine whether Drag & Drop should be allowed
- isPageEditable() : bool
- Check if page can be edited by current user
- prepareQueryBuilder() : QueryBuilder
- Return the modified QueryBuilder object ($queryBuilder) which will be used to select the records from a table $table with pid = $this->pidList
- renderLanguageFlag() : string
- Renders the language flag and language title, but only if an icon is given, otherwise just the language
- resolveSiteLanguages() : mixed
- Fetch the site language objects for the given $pageId and store it in $this->siteLanguages
- tt_content_drawFooter() : string
- Draw the footer for a single tt_content element
Properties
$CType_labels
Used to store labels for CTypes for tt_content elements
public
array<string|int, mixed>
$CType_labels
= []
$defLangBinding
If set TRUE, the language mode of tt_content elements will be rendered with hard binding between default language content elements and their translations!
public
bool
$defLangBinding
= false
$doEdit
If TRUE, elements will have edit icons (probably this is whether the user has permission to edit the page content). Set externally.
public
bool
$doEdit
= true
$id
Page id
public
int
$id
$itemLabels
Used to store labels for the various fields in tt_content elements
public
array<string|int, mixed>
$itemLabels
= []
$option_newWizard
If TRUE, new-wizards are linked to rather than the regular new-element list.
public
bool
$option_newWizard
= true
$pageRecord
Loaded with page record with version overlay if any.
public
array<string|int, string>
$pageRecord
= []
$tt_contentConfig
External, static: Configuration of tt_content element display:
public
array<string|int, mixed>
$tt_contentConfig
= [
'languageCols' => 0,
'languageMode' => 0,
'languageColsPointer' => 0,
// Displays hidden records as well
'showHidden' => 1,
// Which language
'sys_language_uid' => 0,
'cols' => '1,0,2,3',
// Which columns can be accessed by current BE user
'activeCols' => '1,0,2,3',
]
$tt_contentData
Used to move content up / down
public
array<string|int, mixed>
$tt_contentData
= ['prev' => [], 'next' => []]
$contentElementCache
Caches the amount of content elements as a matrix
protected
array<string|int, mixed>
$contentElementCache
= []
$iconFactory
protected
IconFactory
$iconFactory
$languageHasTranslationsCache
Stores whether a certain language has translations in it
protected
array<string|int, mixed>
$languageHasTranslationsCache
= []
$localizationController
protected
LocalizationController
$localizationController
$pageinfo
Current ids page record
protected
array<string|int, mixed>
$pageinfo
$referenceCount
Cache the number of references to a record
protected
array<string|int, mixed>
$referenceCount
= []
$siteLanguages
Contains site languages for this page ID
protected
array<string|int, SiteLanguage>
$siteLanguages
= []
$uriBuilder
protected
UriBuilder
$uriBuilder
Methods
__construct()
public
__construct() : mixed
createFromPageLayoutContext()
public
static createFromPageLayoutContext(PageLayoutContext $context) : PageLayoutView
Parameters
- $context : PageLayoutContext
Return values
PageLayoutViewgetIcon()
Creates the icon image tag for record from table and wraps it in a link which will trigger the click menu.
public
getIcon(string $table, array<string|int, mixed> $row) : string
Parameters
- $table : string
-
Table name
- $row : array<string|int, mixed>
-
Record array
Return values
string —HTML for the icon
getNonTranslatedTTcontentUids()
Filters out all tt_content uids which are already translated so only non-translated uids is left.
public
getNonTranslatedTTcontentUids(array<string|int, mixed> $defaultLanguageUids, int $id, int $lP) : array<string|int, mixed>
Selects across columns, but within in the same PID. Columns are expect to be the same for translations and original but this may be a conceptual error (?)
Parameters
- $defaultLanguageUids : array<string|int, mixed>
-
Numeric array with uids of tt_content elements in the default language
- $id : int
-
The page UID from which to fetch untranslated records (unused, remains in place for compatibility)
- $lP : int
-
Sys language UID
Return values
array<string|int, mixed> —Modified $defLanguageCount
getProcessedValue()
Creates processed values for all field names in $fieldList based on values from $row array.
public
getProcessedValue(string $table, string $fieldList, array<string|int, mixed> $row, array<string|int, mixed> &$info) : mixed
The result is 'returned' through $info which is passed as a reference
Parameters
- $table : string
-
Table name
- $fieldList : string
-
Comma separated list of fields.
- $row : array<string|int, mixed>
-
Record from which to take values for processing.
- $info : array<string|int, mixed>
-
Array to which the processed values are added.
getQueryBuilder()
Returns a QueryBuilder configured to select $fields from $table where the pid is restricted.
public
getQueryBuilder(string $table, int $pageId[, array<string|int, string> $additionalConstraints = [] ][, array<string|int, string> $fields = ['*'] ]) : QueryBuilder
Parameters
- $table : string
-
Table name
- $pageId : int
-
Page id Only used to build the search constraints, getPageIdConstraint() used for restrictions
- $additionalConstraints : array<string|int, string> = []
-
Additional part for where clause
- $fields : array<string|int, string> = ['*']
-
Field list to select, * for all
Return values
QueryBuildergetResult()
Traverse the result pointer given, adding each record to array and setting some internal values at the same time.
public
getResult(Result $result) : array<string|int, mixed>
Parameters
- $result : Result
-
DBAL Result
Return values
array<string|int, mixed> —The selected rows returned in this array.
getTable_tt_content()
Renders Content Elements from the tt_content table from page id
public
getTable_tt_content(int $id) : string
Parameters
- $id : int
-
Page id
Return values
string —HTML for the listing
getThumbCodeUnlinked()
Create thumbnail code for record/field but not linked
public
getThumbCodeUnlinked(array<string|int, mixed> $row, string $table, string $field) : string
Parameters
- $row : array<string|int, mixed>
-
Record array
- $table : string
-
Table (record is from)
- $field : string
-
Field name for which thumbnail are to be rendered.
Return values
string —HTML for thumbnails, if any.
isDisabled()
Returns TRUE, if the record given as parameters is NOT visible based on hidden/starttime/endtime (if available)
public
isDisabled(string $table, array<string|int, mixed> $row) : bool
Parameters
- $table : string
-
Tablename of table to test
- $row : array<string|int, mixed>
-
Record row.
Return values
bool —Returns TRUE, if disabled.
languageSelector()
Make selector box for creating new translation in a language Displays only languages which are not yet present for the current page and that are not disabled with page TS.
public
languageSelector(int $id) : string
Parameters
- $id : int
-
Page id for which to create a new translation record of pages
Tags
Return values
string —HTML
linkEditContent()
Will create a link on the input string and possibly a big button after the string which links to editing in the RTE.
public
linkEditContent(string $str, array<string|int, mixed> $row) : string
Used for content element content displayed so the user can click the content / "Edit in Rich Text Editor" button
Parameters
- $str : string
-
String to link. Must be prepared for HTML output.
- $row : array<string|int, mixed>
-
The row.
Tags
Return values
string —If the whole thing was editable ($this->doEdit) $str is return with link around. Otherwise just $str.
newLanguageButton()
Creates button which is used to create copies of records.
public
newLanguageButton(array<string|int, mixed> $defaultLanguageUids, int $lP) : string
.
Parameters
- $defaultLanguageUids : array<string|int, mixed>
-
Numeric array with uids of tt_content elements in the default language
- $lP : int
-
Sys language UID
Return values
string —"Copy languages" button, if available.
renderContentElementHeader()
public
renderContentElementHeader(array<string|int, mixed> $row) : string
Parameters
- $row : array<string|int, mixed>
Return values
stringrenderContentElementPreview()
Renders the preview part of a content element
public
renderContentElementPreview(array<string|int, mixed> $row) : string
Parameters
- $row : array<string|int, mixed>
-
given tt_content database record
Return values
stringrenderContentElementPreviewFromFluidTemplate()
public
renderContentElementPreviewFromFluidTemplate(array<string|int, mixed> $row) : string|null
Parameters
- $row : array<string|int, mixed>
Return values
string|nullrenderText()
Processing of larger amounts of text (usually from RTE/bodytext fields) with word wrapping etc.
public
renderText(string $input) : string
Parameters
- $input : string
-
Input string
Return values
string —Output string
thumbCode()
Create thumbnail code for record/field
public
thumbCode(array<string|int, mixed> $row, string $table, string $field) : string
Parameters
- $row : array<string|int, mixed>
-
Record array
- $table : string
-
Table (record is from)
- $field : string
-
Field name for which thumbnail are to be rendered.
Return values
string —HTML for thumbnails, if any.
tt_content_drawColHeader()
Draw header for a content element column:
public
tt_content_drawColHeader(string $colName[, string $editParams = '' ]) : string
Parameters
- $colName : string
-
Column name
- $editParams : string = ''
-
Edit params (Syntax: &edit[...] for FormEngine)
Return values
string —HTML table
tt_content_drawHeader()
Draw the header for a single tt_content element
public
tt_content_drawHeader(array<string|int, mixed> $row[, int $space = 0 ][, bool $disableMoveAndNewButtons = false ][, bool $langMode = false ][, bool $dragDropEnabled = false ]) : string
Parameters
- $row : array<string|int, mixed>
-
Record array
- $space : int = 0
-
Amount of pixel space above the header. UNUSED
- $disableMoveAndNewButtons : bool = false
-
If set the buttons for creating new elements and moving up and down are not shown.
- $langMode : bool = false
-
If set, we are in language mode and flags will be shown for languages
- $dragDropEnabled : bool = false
-
If set the move button must be hidden
Return values
string —HTML table with the record header.
tt_content_drawItem()
Draws the preview content for a content element
public
tt_content_drawItem(array<string|int, mixed> $row) : string
Parameters
- $row : array<string|int, mixed>
-
Content element
Tags
Return values
string —HTML
checkIfTranslationsExistInLanguage()
Checks whether translated Content Elements exist in the desired language If so, deny creating new ones via the UI
protected
checkIfTranslationsExistInLanguage(array<string|int, mixed> $contentElements, int $language) : bool
Parameters
- $contentElements : array<string|int, mixed>
- $language : int
Return values
boolgenerateLanguageView()
Shows the content elements of the selected languages in each column.
protected
generateLanguageView(array<string|int, mixed> $languageIds, array<string|int, mixed> $defaultLanguageElementsByColumn, array<string|int, mixed> $languageColumn, array<string|int, mixed> $defLangBinding) : string
Parameters
- $languageIds : array<string|int, mixed>
-
languages to render
- $defaultLanguageElementsByColumn : array<string|int, mixed>
- $languageColumn : array<string|int, mixed>
- $defLangBinding : array<string|int, mixed>
Return values
string —the compiled content
generateTtContentDataArray()
Generates the data for previous and next elements which is needed for movements.
protected
generateTtContentDataArray(array<string|int, mixed> $rowArray) : mixed
Parameters
- $rowArray : array<string|int, mixed>
getBackendLayoutView()
protected
getBackendLayoutView() : BackendLayoutView
Return values
BackendLayoutViewgetBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetContentRecordsPerColumn()
Gets content records per column.
protected
getContentRecordsPerColumn(string $table, int $id, array<string|int, mixed> $columns[, string $additionalWhereClause = '' ]) : array<string|int, mixed>
This is required for correct workspace overlays.
Parameters
- $table : string
-
Name of table storing content records, by default tt_content
- $id : int
-
Page Id to be used (not used at all, but part of the API, see $this->pidSelect)
- $columns : array<string|int, mixed>
-
colPos values to be considered to be shown
- $additionalWhereClause : string = ''
-
Additional where clause for database select
Return values
array<string|int, mixed> —Associative array for each column (colPos)
getLanguageService()
Returns the language service
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetLocalizedPageTitle()
protected
getLocalizedPageTitle() : string
Return values
string —$title
getReferenceCount()
Gets the number of records referencing the record with the UID $uid in the table $tableName.
protected
getReferenceCount(string $tableName, int $uid) : int
Parameters
- $tableName : string
- $uid : int
Return values
int —The number of references to record $uid in table
getSelectedLanguages()
Build a list of language IDs that should be rendered in this view
protected
getSelectedLanguages() : array<string|int, int>
Return values
array<string|int, int>hasContentModificationAndAccessPermissions()
Check if current user has modification and access permissions for content set
protected
hasContentModificationAndAccessPermissions() : bool
Return values
boolinitialize()
protected
initialize() : mixed
isContentEditable()
Check if content can be edited by current user
protected
isContentEditable([int|null $languageId = null ]) : bool
Parameters
- $languageId : int|null = null
Return values
boolisDragAndDropAllowed()
Determine whether Drag & Drop should be allowed
protected
isDragAndDropAllowed(array<string|int, mixed> $row) : bool
Parameters
- $row : array<string|int, mixed>
Return values
boolisPageEditable()
Check if page can be edited by current user
protected
isPageEditable() : bool
Return values
boolprepareQueryBuilder()
Return the modified QueryBuilder object ($queryBuilder) which will be used to select the records from a table $table with pid = $this->pidList
protected
prepareQueryBuilder(string $table, int $pageId, array<string|int, string> $fieldList, array<string|int, string> $additionalConstraints, QueryBuilder $queryBuilder) : QueryBuilder
Parameters
- $table : string
-
Table name
- $pageId : int
-
Page id Only used to build the search constraints, $this->pidList is used for restrictions
- $fieldList : array<string|int, string>
-
List of fields to select from the table
- $additionalConstraints : array<string|int, string>
-
Additional part for where clause
- $queryBuilder : QueryBuilder
Return values
QueryBuilderrenderLanguageFlag()
Renders the language flag and language title, but only if an icon is given, otherwise just the language
protected
renderLanguageFlag(SiteLanguage $language) : string
Parameters
- $language : SiteLanguage
Return values
stringresolveSiteLanguages()
Fetch the site language objects for the given $pageId and store it in $this->siteLanguages
protected
resolveSiteLanguages(int $pageId) : mixed
Parameters
- $pageId : int
Tags
tt_content_drawFooter()
Draw the footer for a single tt_content element
protected
tt_content_drawFooter(array<string|int, mixed> $row) : string
Parameters
- $row : array<string|int, mixed>
-
Record array
Tags
Return values
string —HTML of the footer