NewRecordController
Script class for 'db_new' and 'db_new_pages'
This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.
Table of Contents
Properties
- $id : int
- $allowedNewTables : array<string|int, mixed>
- $content : string
- Accumulated HTML output
- $deniedNewTables : array<string|int, mixed>
- $iconFactory : IconFactory
- $moduleTemplate : ModuleTemplate
- ModuleTemplate object
- $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 : StandaloneView
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
- initializeView() : void
- Initializes the view by setting the templateName
- 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
- renderNewContentElementWizardLink() : string
- Generate link to the new content element wizard
- 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
$id
public
int
$id
Tags
$allowedNewTables
protected
array<string|int, mixed>
$allowedNewTables
$content
Accumulated HTML output
protected
string
$content
$deniedNewTables
protected
array<string|int, mixed>
$deniedNewTables
$iconFactory
protected
IconFactory
$iconFactory
$moduleTemplate
ModuleTemplate object
protected
ModuleTemplate
$moduleTemplate
$moduleTemplateFactory
protected
ModuleTemplateFactory
$moduleTemplateFactory
$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
= []
$pageRenderer
protected
PageRenderer
$pageRenderer
$perms_clause
protected
string
$perms_clause
$pidInfo
protected
array<string|int, mixed>
$pidInfo
= []
$returnUrl
protected
string
$returnUrl
$tRows
protected
array<string|int, mixed>
$tRows
= []
$uriBuilder
protected
UriBuilder
$uriBuilder
$view
protected
StandaloneView
$view
Methods
__construct()
public
__construct(IconFactory $iconFactory, PageRenderer $pageRenderer, UriBuilder $uriBuilder, ModuleTemplateFactory $moduleTemplateFactory) : mixed
Parameters
- $iconFactory : IconFactory
- $pageRenderer : PageRenderer
- $uriBuilder : UriBuilder
- $moduleTemplateFactory : ModuleTemplateFactory
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
-
the current request
Return values
ResponseInterface —the response with the content
newPageAction()
Pages only wizard
public
newPageAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfacedoPageRecordsExistInSystem()
protected
doPageRecordsExistInSystem() : bool
Return values
boolgetBackendUserAuthentication()
protected
getBackendUserAuthentication() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetButtons()
Create the panel of buttons for submitting the form or otherwise perform operations.
protected
getButtons([bool $createPage = false ]) : void
Parameters
- $createPage : bool = false
getLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServiceinit()
Constructor function for the class
protected
init(ServerRequestInterface $request) : void
Parameters
- $request : ServerRequestInterface
initializeView()
Initializes the view by setting the templateName
protected
initializeView(string $templateName) : void
Parameters
- $templateName : string
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
renderLink()
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.
renderNewContentElementWizardLink()
Generate link to the new content element wizard
protected
renderNewContentElementWizardLink() : string
Return values
stringrenderNewRecordControls()
Render controls for creating a regular new element (pages or records)
protected
renderNewRecordControls() : void
renderPageSelectPositionLink()
Generate link to the page position selection "view"
protected
renderPageSelectPositionLink() : string
Return values
stringsortTableRows()
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