NewRecordController

Script class for 'db_new' and 'db_new_pages'

Internal

This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.

Attributes
#[AsController]

Table of Contents

Properties

$id  : int
$allowedNewTables  : array<string|int, mixed>
$deniedNewTables  : array<string|int, mixed>
$iconFactory  : IconFactory
$moduleTemplateFactory  : ModuleTemplateFactory
$newContentInto  : bool
$newPagesAfter  : bool
$newPagesInto  : bool
$newPagesSelectPosition  : bool
Determines, whether "Select Position" for new page should be shown
$newRecordSortList  : array<string|int, mixed>
$pageinfo  : array<string|int, mixed>
$pageRenderer  : PageRenderer
$perms_clause  : string
$pidInfo  : array<string|int, mixed>
$returnUrl  : string
$tRows  : array<string|int, mixed>
$uriBuilder  : UriBuilder
$view  : ModuleTemplate

Methods

__construct()  : mixed
mainAction()  : ResponseInterface
Injects the request object for the current request or subrequest As this controller goes only through the main() method, it is rather simple for now
newPageAction()  : ResponseInterface
Pages only wizard
doPageRecordsExistInSystem()  : bool
getBackendUserAuthentication()  : BackendUserAuthentication
getButtons()  : void
Create the panel of buttons for submitting the form or otherwise perform operations.
getLanguageService()  : LanguageService
init()  : void
Constructor function for the class
isRecordCreationAllowedForTable()  : bool
Returns whether the record link should be shown for a table
isTableAllowedOnPage()  : bool
Returns TRUE if the tablename $checkTable is allowed to be created on the page with record $pid_row
renderLink()  : string
Links the string $code to a create-new form for a record in $table created on page $pid
renderNewRecordControls()  : void
Render controls for creating a regular new element (pages or records)
renderPageSelectPositionLink()  : string
Generate link to the page position selection "view"
sortTableRows()  : int
User array sort function used by renderNewRecordControls

Properties

$allowedNewTables

protected array<string|int, mixed> $allowedNewTables

$deniedNewTables

protected array<string|int, mixed> $deniedNewTables

$newContentInto

protected bool $newContentInto = false

$newPagesAfter

protected bool $newPagesAfter = false

$newPagesInto

protected bool $newPagesInto = false

$newPagesSelectPosition

Determines, whether "Select Position" for new page should be shown

protected bool $newPagesSelectPosition = true

$newRecordSortList

protected array<string|int, mixed> $newRecordSortList

$pageinfo

protected array<string|int, mixed> $pageinfo = []

$perms_clause

protected string $perms_clause

$pidInfo

protected array<string|int, mixed> $pidInfo = []

$tRows

protected array<string|int, mixed> $tRows = []

Methods

mainAction()

Injects the request object for the current request or subrequest 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

newPageAction()

Pages only wizard

public newPageAction(ServerRequestInterface $request) : ResponseInterface
Parameters
$request : ServerRequestInterface
Return values
ResponseInterface

doPageRecordsExistInSystem()

protected doPageRecordsExistInSystem() : bool
Return values
bool

getButtons()

Create the panel of buttons for submitting the form or otherwise perform operations.

protected getButtons([bool $createPage = false ]) : void
Parameters
$createPage : bool = false

init()

Constructor function for the class

protected init(ServerRequestInterface $request) : void
Parameters
$request : ServerRequestInterface

isRecordCreationAllowedForTable()

Returns whether the record link should be shown for a table

protected isRecordCreationAllowedForTable(string $table[, array<string|int, mixed> $allowedNewTables = [] ][, array<string|int, mixed> $deniedNewTables = [] ]) : bool

Returns TRUE if:

  • $allowedNewTables and $deniedNewTables are empty
  • the table is not found in $deniedNewTables and $allowedNewTables is not set or the $table tablename is found in $allowedNewTables

If $table tablename is found in $allowedNewTables and $deniedNewTables, $deniedNewTables has priority over $allowedNewTables.

Parameters
$table : string

Table name to test if in allowedTables

$allowedNewTables : array<string|int, mixed> = []

Array of new tables that are allowed.

$deniedNewTables : array<string|int, mixed> = []

Array of new tables that are not allowed.

Return values
bool

Returns TRUE if a link for creating new records should be displayed for $table

isTableAllowedOnPage()

Returns TRUE if the tablename $checkTable is allowed to be created on the page with record $pid_row

protected isTableAllowedOnPage(string $table, array<string|int, mixed> $page) : bool
Parameters
$table : string

Table name to check

$page : array<string|int, mixed>

Potential parent page

Return values
bool

Returns TRUE if the tablename $table is allowed to be created on the $page

Links the string $code to a create-new form for a record in $table created on page $pid

protected renderLink(string $linkText, string $table, int $pid) : string
Parameters
$linkText : string

Link text

$table : string

Table name (in which to create new record)

$pid : int

PID value for the "&edit['.$table.']['.$pid.']=new" command (positive/negative)

Return values
string

The link.

renderNewRecordControls()

Render controls for creating a regular new element (pages or records)

protected renderNewRecordControls() : void

Generate link to the page position selection "view"

protected renderPageSelectPositionLink() : string
Return values
string

sortTableRows()

User array sort function used by renderNewRecordControls

protected sortTableRows(string $a, string $b) : int
Parameters
$a : string

First array element for compare

$b : string

First array element for compare

Return values
int

-1 for lower, 0 for equal, 1 for greater


        
On this page

Search results