‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Controller\NewRecordController Class Reference

Public Member Functions

 __construct (protected readonly IconFactory $iconFactory, protected readonly PageRenderer $pageRenderer, protected readonly UriBuilder $uriBuilder, protected readonly ModuleTemplateFactory $moduleTemplateFactory)
 
 mainAction (ServerRequestInterface $request)
 
 newPageAction (ServerRequestInterface $request)
 

Public Attributes

int $id
 

Protected Member Functions

 init (ServerRequestInterface $request)
 
 getButtons (bool $createPage=false)
 
 doPageRecordsExistInSystem ()
 
 renderNewRecordControls ()
 
int sortTableRows (string $a, string $b)
 
string renderLink (string $linkText, string $table, int $pid)
 
 renderPageSelectPositionLink ()
 
bool isTableAllowedOnPage (string $table, array $page)
 
bool isRecordCreationAllowedForTable (string $table, array $allowedNewTables=[], array $deniedNewTables=[])
 
 getLanguageService ()
 
 getBackendUserAuthentication ()
 

Protected Attributes

array $pageinfo = array( )
 
array $pidInfo = array( )
 
array $newRecordSortList
 
bool $newPagesInto = false
 
bool $newContentInto = false
 
bool $newPagesAfter = false
 
bool $newPagesSelectPosition = true
 
array $allowedNewTables
 
array $deniedNewTables
 
string $returnUrl
 
string $perms_clause
 
array $tRows = array( )
 
ModuleTemplate $view
 

Detailed Description

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.

Definition at line 52 of file NewRecordController.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Controller\NewRecordController::__construct ( protected readonly IconFactory  $iconFactory,
protected readonly PageRenderer  $pageRenderer,
protected readonly UriBuilder  $uriBuilder,
protected readonly ModuleTemplateFactory  $moduleTemplateFactory 
)

Definition at line 105 of file NewRecordController.php.

Member Function Documentation

◆ doPageRecordsExistInSystem()

TYPO3\CMS\Backend\Controller\NewRecordController::doPageRecordsExistInSystem ( )
protected

◆ getBackendUserAuthentication()

◆ getButtons()

◆ getLanguageService()

◆ init()

◆ isRecordCreationAllowedForTable()

bool TYPO3\CMS\Backend\Controller\NewRecordController::isRecordCreationAllowedForTable ( string  $table,
array  $allowedNewTables = [],
array  $deniedNewTables = [] 
)
protected

Returns whether the record link should be shown for a table

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
string$table‪Table name to test if in allowedTables
array$allowedNewTables‪Array of new tables that are allowed.
array$deniedNewTables‪Array of new tables that are not allowed.
Returns
‪bool Returns TRUE if a link for creating new records should be displayed for $table

Definition at line 583 of file NewRecordController.php.

References TYPO3\CMS\Backend\Controller\NewRecordController\$allowedNewTables, TYPO3\CMS\Backend\Controller\NewRecordController\$deniedNewTables, $GLOBALS, and TYPO3\CMS\Backend\Controller\NewRecordController\getBackendUserAuthentication().

Referenced by TYPO3\CMS\Backend\Controller\NewRecordController\getButtons(), TYPO3\CMS\Backend\Controller\NewRecordController\init(), TYPO3\CMS\Backend\Controller\NewRecordController\newPageAction(), and TYPO3\CMS\Backend\Controller\NewRecordController\renderNewRecordControls().

◆ isTableAllowedOnPage()

bool TYPO3\CMS\Backend\Controller\NewRecordController::isTableAllowedOnPage ( string  $table,
array  $page 
)
protected

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

Parameters
string$table‪Table name to check
array$page‪Potential parent page
Returns
‪bool Returns TRUE if the tablename $table is allowed to be created on the $page

Definition at line 552 of file NewRecordController.php.

References $GLOBALS, and TYPO3\CMS\Backend\Controller\NewRecordController\getBackendUserAuthentication().

Referenced by TYPO3\CMS\Backend\Controller\NewRecordController\renderNewRecordControls().

◆ mainAction()

TYPO3\CMS\Backend\Controller\NewRecordController::mainAction ( ServerRequestInterface  $request)

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

Definition at line 116 of file NewRecordController.php.

References TYPO3\CMS\Backend\Controller\NewRecordController\getBackendUserAuthentication(), TYPO3\CMS\Backend\Controller\NewRecordController\getButtons(), TYPO3\CMS\Backend\Controller\NewRecordController\init(), and TYPO3\CMS\Backend\Controller\NewRecordController\renderNewRecordControls().

◆ newPageAction()

◆ renderLink()

string TYPO3\CMS\Backend\Controller\NewRecordController::renderLink ( string  $linkText,
string  $table,
int  $pid 
)
protected

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

Parameters
string$linkText‪Link text
string$table‪Table name (in which to create new record)
int$pid‪PID value for the "&edit['.$table.']['.$pid.']=new" command (positive/negative)
Returns
‪string The link.

Definition at line 506 of file NewRecordController.php.

Referenced by TYPO3\CMS\Backend\Controller\NewRecordController\renderNewRecordControls().

◆ renderNewRecordControls()

◆ renderPageSelectPositionLink()

TYPO3\CMS\Backend\Controller\NewRecordController::renderPageSelectPositionLink ( )
protected

◆ sortTableRows()

int TYPO3\CMS\Backend\Controller\NewRecordController::sortTableRows ( string  $a,
string  $b 
)
protected

User array sort function used by renderNewRecordControls

Parameters
string$a‪First array element for compare
string$b‪First array element for compare
Returns
‪int -1 for lower, 0 for equal, 1 for greater

Definition at line 475 of file NewRecordController.php.

Referenced by TYPO3\CMS\Backend\Controller\NewRecordController\renderNewRecordControls().

Member Data Documentation

◆ $allowedNewTables

array TYPO3\CMS\Backend\Controller\NewRecordController::$allowedNewTables
protected

◆ $deniedNewTables

array TYPO3\CMS\Backend\Controller\NewRecordController::$deniedNewTables
protected

◆ $id

int TYPO3\CMS\Backend\Controller\NewRecordController::$id
See also
NewRecordPageTreeView::expandNext()

Definition at line 89 of file NewRecordController.php.

◆ $newContentInto

bool TYPO3\CMS\Backend\Controller\NewRecordController::$newContentInto = false
protected

Definition at line 67 of file NewRecordController.php.

◆ $newPagesAfter

bool TYPO3\CMS\Backend\Controller\NewRecordController::$newPagesAfter = false
protected

Definition at line 68 of file NewRecordController.php.

◆ $newPagesInto

bool TYPO3\CMS\Backend\Controller\NewRecordController::$newPagesInto = false
protected

Definition at line 66 of file NewRecordController.php.

◆ $newPagesSelectPosition

bool TYPO3\CMS\Backend\Controller\NewRecordController::$newPagesSelectPosition = true
protected

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

Definition at line 74 of file NewRecordController.php.

◆ $newRecordSortList

array TYPO3\CMS\Backend\Controller\NewRecordController::$newRecordSortList
protected

Definition at line 64 of file NewRecordController.php.

◆ $pageinfo

array TYPO3\CMS\Backend\Controller\NewRecordController::$pageinfo = array( )
protected

Definition at line 56 of file NewRecordController.php.

◆ $perms_clause

string TYPO3\CMS\Backend\Controller\NewRecordController::$perms_clause
protected

Definition at line 97 of file NewRecordController.php.

◆ $pidInfo

array TYPO3\CMS\Backend\Controller\NewRecordController::$pidInfo = array( )
protected

Definition at line 60 of file NewRecordController.php.

◆ $returnUrl

string TYPO3\CMS\Backend\Controller\NewRecordController::$returnUrl
protected

Definition at line 93 of file NewRecordController.php.

◆ $tRows

array TYPO3\CMS\Backend\Controller\NewRecordController::$tRows = array( )
protected

Definition at line 101 of file NewRecordController.php.

◆ $view

ModuleTemplate TYPO3\CMS\Backend\Controller\NewRecordController::$view
protected

Definition at line 103 of file NewRecordController.php.