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.
Attributes
- #[AsController]
 
Table of Contents
Properties
- $id : int
 - $allowedNewTables : array<string|int, mixed>
 - $deniedNewTables : array<string|int, mixed>
 - $eventDispatcher : EventDispatcherInterface
 - $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>
 - $recordFactory : RecordFactory
 - $request : ServerRequestInterface
 - $resourcePublisher : SystemResourcePublisherInterface
 - $returnUrl : string
 - $tcaSchemaFactory : TcaSchemaFactory
 - $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
 - getAllowedTables() : array<int, string>
 - getBackendUserAuthentication() : BackendUserAuthentication
 - getButtons() : void
 - Create the panel of buttons for submitting the form or otherwise perform operations.
 - getLanguageService() : LanguageService
 - getNewRecordControls() : array<string|int, mixed>
 - Render controls for creating a regular new element (pages or records)
 - getRecordTypesForDirectCreation() : array<string|int, mixed>
 - hasRecordTypesForDirectCreation() : bool
 - 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
 - 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
     = []
    
    
    
    
    
$deniedNewTables
        protected
            array<string|int, mixed>
    $deniedNewTables
     = []
    
    
    
    
    
$eventDispatcher read-only
        protected
            EventDispatcherInterface
    $eventDispatcher
    
    
    
    
    
    
$iconFactory read-only
        protected
            IconFactory
    $iconFactory
    
    
    
    
    
    
$moduleTemplateFactory read-only
        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 read-only
        protected
            PageRenderer
    $pageRenderer
    
    
    
    
    
    
$perms_clause
        protected
            string
    $perms_clause
     = ''
    
    
    
    
    
$pidInfo
        protected
            array<string|int, mixed>
    $pidInfo
     = []
    
    
    
    
    
$recordFactory read-only
        protected
            RecordFactory
    $recordFactory
    
    
    
    
    
    
$request
        protected
            ServerRequestInterface
    $request
    
    
    
    
    
    
$resourcePublisher read-only
        protected
            SystemResourcePublisherInterface
    $resourcePublisher
    
    
    
    
    
    
$returnUrl
        protected
            string
    $returnUrl
     = ''
    
    
    
    
    
$tcaSchemaFactory read-only
        protected
            TcaSchemaFactory
    $tcaSchemaFactory
    
    
    
    
    
    
$tRows
        protected
            array<string|int, mixed>
    $tRows
     = []
    
    
    
    
    
$uriBuilder read-only
        protected
            UriBuilder
    $uriBuilder
    
    
    
    
    
    
$view
        protected
            ModuleTemplate
    $view
    
    
    
    
    
    
Methods
__construct()
    public
                    __construct(ComponentFactory $componentFactory, IconFactory $iconFactory, PageRenderer $pageRenderer, UriBuilder $uriBuilder, RecordFactory $recordFactory, ModuleTemplateFactory $moduleTemplateFactory, TcaSchemaFactory $tcaSchemaFactory, EventDispatcherInterface $eventDispatcher, SystemResourcePublisherInterface $resourcePublisher) : mixed
    Parameters
- $componentFactory : ComponentFactory
 - $iconFactory : IconFactory
 - $pageRenderer : PageRenderer
 - $uriBuilder : UriBuilder
 - $recordFactory : RecordFactory
 - $moduleTemplateFactory : ModuleTemplateFactory
 - $tcaSchemaFactory : TcaSchemaFactory
 - $eventDispatcher : EventDispatcherInterface
 - $resourcePublisher : SystemResourcePublisherInterface
 
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
ResponseInterfacenewPageAction()
Pages only wizard
    public
                    newPageAction(ServerRequestInterface $request) : ResponseInterface
    Parameters
- $request : ServerRequestInterface
 
Return values
ResponseInterfacedoPageRecordsExistInSystem()
    protected
                    doPageRecordsExistInSystem() : bool
    Return values
boolgetAllowedTables()
    protected
                    getAllowedTables() : array<int, string>
    Return values
array<int, string>getBackendUserAuthentication()
    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
LanguageServicegetNewRecordControls()
Render controls for creating a regular new element (pages or records)
    protected
                    getNewRecordControls() : array<string|int, mixed>
    Return values
array<string|int, mixed>getRecordTypesForDirectCreation()
    protected
                    getRecordTypesForDirectCreation(TcaSchema $schema, int $positionId) : array<string|int, mixed>
    Parameters
- $schema : TcaSchema
 - $positionId : int
 
Return values
array<string|int, mixed>hasRecordTypesForDirectCreation()
    protected
                    hasRecordTypesForDirectCreation(TcaSchema $schema) : bool
    Parameters
- $schema : TcaSchema
 
Return values
boolinit()
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(TcaSchema $schema, array<string|int, mixed> $page) : bool
    Parameters
- $schema : TcaSchema
 - 
                    
Table schema
 - $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 $table, int $pid[, array<string|int, mixed> $additionalParams = [] ]) : string
    Parameters
- $table : string
 - 
                    
Table name (in which to create new record)
 - $pid : int
 - 
                    
PID value for the "&edit['.$table.']['.$pid.']=new" command (positive/negative)
 - $additionalParams : array<string|int, mixed> = []
 - 
                    
Additional params, such as "defVals" tp be added to the link
 
Return values
string —The link.
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