‪TYPO3CMS  ‪main
NewRecordController.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Http\Message\ResponseInterface;
21 use Psr\Http\Message\ServerRequestInterface;
30 use TYPO3\CMS\Backend\Utility\BackendUtility;
38 use TYPO3\CMS\Core\Imaging\IconSize;
40 use TYPO3\CMS\Core\Package\PackageManager;
46 
51 #[AsController]
53 {
57  protected ‪$pageinfo = [];
58 
62  protected ‪$pidInfo = [];
63 
68 
69  protected bool ‪$newPagesInto = false;
70  protected bool ‪$newContentInto = false;
71  protected bool ‪$newPagesAfter = false;
72 
78  protected ‪$newPagesSelectPosition = true;
79 
83  protected ‪$allowedNewTables;
84 
88  protected ‪$deniedNewTables;
89 
96  public ‪$id;
97 
101  protected ‪$returnUrl;
102 
106  protected ‪$perms_clause;
107 
111  protected ‪$tRows = [];
112 
113  protected ‪ModuleTemplate ‪$view;
114 
115  public function ‪__construct(
116  protected readonly ‪IconFactory $iconFactory,
117  protected readonly ‪PageRenderer $pageRenderer,
118  protected readonly ‪UriBuilder $uriBuilder,
119  protected readonly ‪ModuleTemplateFactory $moduleTemplateFactory
120  ) {}
121 
126  public function ‪mainAction(ServerRequestInterface $request): ResponseInterface
127  {
128  // Redirect if there is still a link with ?pagesOnly=1
129  if ($request->getQueryParams()['pagesOnly'] ?? null) {
130  $uri = $this->uriBuilder->buildUriFromRoute('db_new_pages', ['id' => (int)($request->getQueryParams()['id'] ?? 0), 'returnUrl' => $request->getQueryParams()['returnUrl'] ?? null]);
131  return new ‪RedirectResponse($uri, 301);
132  }
133 
134  $this->‪init($request);
135 
136  // If there was a page - or if the user is admin (admins has access to the root) we proceed, otherwise just output the header
137  if (empty($this->pageinfo['uid']) && !$this->‪getBackendUserAuthentication()->isAdmin()) {
138  return $this->view->renderResponse('NewRecord/NewRecord');
139  }
140 
142 
143  // Setting up the buttons and markers for docheader (done after permissions are checked)
144  $this->‪getButtons();
145  return $this->view->renderResponse('NewRecord/NewRecord');
146  }
147 
151  public function ‪newPageAction(ServerRequestInterface $request): ResponseInterface
152  {
153  $this->‪init($request);
154 
155  // If there was a page - or if the user is admin (admins has access to the root) we proceed, otherwise just output the header
156  if ((empty($this->pageinfo['uid']) && !$this->‪getBackendUserAuthentication()->isAdmin()) || !$this->‪isRecordCreationAllowedForTable('pages')) {
157  return $this->view->renderResponse('NewRecord/NewPagePosition');
158  }
159  if (!$this->‪doPageRecordsExistInSystem()) {
160  // No pages yet, no need to prompt for position, redirect to page creation.
161  $urlParameters = [
162  'edit' => [
163  'pages' => [
164  0 => 'new',
165  ],
166  ],
167  'returnNewPageId' => 1,
168  'returnUrl' => (string)$this->uriBuilder->buildUriFromRoute('db_new_pages', ['id' => $this->id]),
169  ];
170  ‪$url = (string)$this->uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
171  return new RedirectResponse(‪$url);
172  }
173  $positionMap = GeneralUtility::makeInstance(PagePositionMap::class, NewRecordPageTreeView::class);
174  $content = $positionMap->positionTree(
175  $this->id,
176  $this->pageinfo,
177  $this->perms_clause,
178  $this->returnUrl,
179  $request
180  );
181  $this->view->assign('pagePositionMapForPagesOnly', $content);
182  // Setting up the buttons and markers for docheader (done after permissions are checked)
183  $this->‪getButtons(true);
184  return $this->view->renderResponse('NewRecord/NewPagePosition');
185  }
186 
190  protected function ‪init(ServerRequestInterface $request): void
191  {
192  $this->view = $this->moduleTemplateFactory->create($request);
193  $beUser = $this->‪getBackendUserAuthentication();
194  // Page-selection permission clause (reading)
195  $this->perms_clause = $beUser->getPagePermsClause(‪Permission::PAGE_SHOW);
196  // This will hide records from display - it has nothing to do with user rights!!
197  $pidList = (string)($beUser->getTSConfig()['options.']['hideRecords.']['pages'] ?? '');
198  if (!empty($pidList)) {
199  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
200  ->getQueryBuilderForTable('pages');
201  $this->perms_clause .= ' AND ' . $queryBuilder->expr()->notIn(
202  'pages.uid',
203  ‪GeneralUtility::intExplode(',', $pidList)
204  );
205  }
206  // Setting GPvars:
207  $parsedBody = $request->getParsedBody();
208  $queryParams = $request->getQueryParams();
209  // The page id to operate from
210  $this->id = (int)($parsedBody['id'] ?? $queryParams['id'] ?? 0);
211  $this->returnUrl = GeneralUtility::sanitizeLocalUrl($parsedBody['returnUrl'] ?? $queryParams['returnUrl'] ?? '');
212  // Setting up the context sensitive menu:
213  $this->pageRenderer->loadJavaScriptModule('@typo3/backend/context-menu.js');
214  $this->pageRenderer->loadJavaScriptModule('@typo3/backend/new-content-element-wizard-button.js');
215  // Id a positive id is supplied, ask for the page record with permission information contained:
216  if ($this->id > 0) {
217  $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause) ?: [];
218  }
219  // If a page-record was returned, the user had read-access to the page.
220  if ($this->pageinfo['uid'] ?? false) {
221  // Get record of parent page
222  $this->pidInfo = BackendUtility::getRecord('pages', ($this->pageinfo['pid'] ?? 0)) ?? [];
223  // Checking the permissions for the user with regard to the parent page: Can he create new pages, new
224  // content record, new page after?
225  if ($beUser->doesUserHaveAccess($this->pageinfo, ‪Permission::PAGE_NEW)) {
226  $this->newPagesInto = true;
227  }
228  if ($beUser->doesUserHaveAccess($this->pageinfo, ‪Permission::CONTENT_EDIT)) {
229  $this->newContentInto = true;
230  }
231  if (($beUser->isAdmin() || !empty($this->pidInfo)) && $beUser->doesUserHaveAccess($this->pidInfo, ‪Permission::PAGE_NEW)) {
232  $this->newPagesAfter = true;
233  }
234  $this->view->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
235  } elseif ($beUser->isAdmin()) {
236  // Admins can do it all
237  $this->newPagesInto = true;
238  $this->newContentInto = true;
239  $this->newPagesAfter = false;
240  } else {
241  // People with no permission can do nothing
242  $this->newPagesInto = false;
243  $this->newContentInto = false;
244  $this->newPagesAfter = false;
245  }
246  if ($this->pageinfo['uid'] ?? false) {
247  $title = strip_tags($this->pageinfo[‪$GLOBALS['TCA']['pages']['ctrl']['label']]);
248  } else {
249  $title = ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
250  }
251  $this->view->setTitle($title);
252  // Acquiring TSconfig for this module/current page:
253  $web_list_modTSconfig = BackendUtility::getPagesTSconfig($this->pageinfo['uid'] ?? 0)['mod.']['web_list.'] ?? [];
254  $this->allowedNewTables = ‪GeneralUtility::trimExplode(',', $web_list_modTSconfig['allowedNewTables'] ?? '', true);
255  $this->deniedNewTables = ‪GeneralUtility::trimExplode(',', $web_list_modTSconfig['deniedNewTables'] ?? '', true);
256  // Acquiring TSconfig for this module/parent page
257  $web_list_modTSconfig_pid = BackendUtility::getPagesTSconfig($this->pageinfo['pid'] ?? 0)['mod.']['web_list.'] ?? [];
258  $allowedNewTables_pid = ‪GeneralUtility::trimExplode(',', $web_list_modTSconfig_pid['allowedNewTables'] ?? '', true);
259  $deniedNewTables_pid = ‪GeneralUtility::trimExplode(',', $web_list_modTSconfig_pid['deniedNewTables'] ?? '', true);
260  if (!$this->‪isRecordCreationAllowedForTable('pages')) {
261  $this->newPagesInto = false;
262  }
263  if (!$this->‪isRecordCreationAllowedForTable('pages', $allowedNewTables_pid, $deniedNewTables_pid)) {
264  $this->newPagesAfter = false;
265  }
266  }
267 
271  protected function ‪getButtons(bool $createPage = false): void
272  {
273  $lang = $this->‪getLanguageService();
274  $buttonBar = $this->view->getDocHeaderComponent()->getButtonBar();
275  // Regular new element:
276  if (!$createPage) {
277  // New page
278  if ($this->‪isRecordCreationAllowedForTable('pages')) {
279  $newPageButton = $buttonBar->makeLinkButton()
280  ->setHref((string)$this->uriBuilder->buildUriFromRoute('db_new_pages', ['id' => $this->id, 'returnUrl' => $this->returnUrl]))
281  ->setTitle($lang->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newPage'))
282  ->setShowLabelText(true)
283  ->setIcon($this->iconFactory->getIcon('actions-page-new', IconSize::SMALL));
284  $buttonBar->addButton($newPageButton, ‪ButtonBar::BUTTON_POSITION_LEFT, 20);
285  }
286  }
287  // Back
288  if ($this->returnUrl) {
289  $returnButton = $buttonBar->makeLinkButton()
290  ->setHref($this->returnUrl)
291  ->setTitle($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.goBack'))
292  ->setShowLabelText(true)
293  ->setIcon($this->iconFactory->getIcon('actions-view-go-back', IconSize::SMALL));
294  $buttonBar->addButton($returnButton, ‪ButtonBar::BUTTON_POSITION_LEFT, 10);
295  }
296 
297  if ($this->pageinfo['uid'] ?? false) {
298  // View
299  $pagesTSconfig = BackendUtility::getPagesTSconfig($this->pageinfo['uid']);
300  if (isset($pagesTSconfig['TCEMAIN.']['preview.']['disableButtonForDokType'])) {
301  $excludeDokTypes = ‪GeneralUtility::intExplode(
302  ',',
303  (string)$pagesTSconfig['TCEMAIN.']['preview.']['disableButtonForDokType'],
304  true
305  );
306  } else {
307  // exclude sysfolders and spacers by default
308  $excludeDokTypes = [
311  ];
312  }
313  if (!in_array((int)$this->pageinfo['doktype'], $excludeDokTypes, true)) {
314  $previewDataAttributes = ‪PreviewUriBuilder::create((int)$this->pageinfo['uid'])
315  ->withRootLine(BackendUtility::BEgetRootLine($this->pageinfo['uid']))
316  ->buildDispatcherDataAttributes();
317  $viewButton = $buttonBar->makeLinkButton()
318  ->setHref('#')
319  ->setDataAttributes($previewDataAttributes ?? [])
320  ->setDisabled(!$previewDataAttributes)
321  ->setTitle($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
322  ->setIcon($this->iconFactory->getIcon('actions-view-page', IconSize::SMALL))
323  ->setShowLabelText(true);
324  $buttonBar->addButton($viewButton, ‪ButtonBar::BUTTON_POSITION_LEFT, 30);
325  }
326  }
327  }
328 
329  protected function ‪doPageRecordsExistInSystem(): bool
330  {
331  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
332  ->getQueryBuilderForTable('pages');
333  $queryBuilder->getRestrictions()
334  ->removeAll()
335  ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
336  $numberOfPages = $queryBuilder
337  ->count('*')
338  ->from('pages')
339  ->executeQuery()
340  ->fetchOne();
341  return $numberOfPages > 0;
342  }
343 
347  protected function ‪renderNewRecordControls(): void
348  {
349  $lang = $this->‪getLanguageService();
350  // Get TSconfig for current page
351  $pageTS = BackendUtility::getPagesTSconfig($this->id);
352  // Finish initializing new pages options with TSconfig
353  // Each new page option may be hidden by TSconfig
354  // Enabled option for the position of a new page
355  $this->newPagesSelectPosition = !empty($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageSelectPosition']);
356  $displayNewPagesIntoLink = $this->newPagesInto && !empty($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageInside']);
357  $displayNewPagesAfterLink = $this->newPagesAfter && !empty($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageAfter']);
358  $iconFile = [
359  'backendaccess' => $this->iconFactory->getIcon('status-user-group-backend', IconSize::SMALL)->render(),
360  'content' => $this->iconFactory->getIcon('content-panel', IconSize::SMALL)->render(),
361  'frontendaccess' => $this->iconFactory->getIcon('status-user-group-frontend', IconSize::SMALL)->render(),
362  'system' => $this->iconFactory->getIcon('apps-pagetree-root', IconSize::SMALL)->render(),
363  ];
364  $groupTitles = [
365  'backendaccess' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:recordgroup.backendaccess'),
366  'content' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:recordgroup.content'),
367  'frontendaccess' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:recordgroup.frontendaccess'),
368  'system' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:system_records'),
369  ];
370  $groupedLinksOnTop = [];
371  foreach (‪$GLOBALS['TCA'] ?? [] as $table => $v) {
372  switch ($table) {
373  // New page
374  case 'pages':
375  if (!$this->‪isRecordCreationAllowedForTable('pages')) {
376  break;
377  }
378  // New pages INSIDE this pages
379  $newPageLinks = [];
380  if ($displayNewPagesIntoLink
381  && $this->‪isTableAllowedOnPage('pages', $this->pageinfo)
382  ) {
383  // Create link to new page inside
384  $newPageLinks[] = $this->‪renderLink(
385  htmlspecialchars($lang->sL($v['ctrl']['title'])) . ' (' . htmlspecialchars($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:db_new.php.inside')) . ')',
386  $table,
387  $this->id
388  );
389  }
390  // New pages AFTER this pages
391  if ($displayNewPagesAfterLink
392  && $this->‪isTableAllowedOnPage('pages', $this->pidInfo)
393  ) {
394  $newPageLinks[] = $this->‪renderLink(
395  htmlspecialchars($lang->sL($v['ctrl']['title'])) . ' (' . htmlspecialchars($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:db_new.php.after')) . ')',
396  'pages',
397  -$this->id
398  );
399  }
400  // New pages at selection position
401  if ($this->newPagesSelectPosition) {
402  // Link to page-wizard
403  $newPageLinks[] = $this->‪renderPageSelectPositionLink();
404  }
405  if (!empty($newPageLinks)) {
406  $groupedLinksOnTop['pages'] = [
407  'title' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:createNewPage'),
408  'icon' => 'actions-page-new',
409  'items' => $newPageLinks,
410  ];
411  }
412  break;
413  case 'tt_content':
414  // Skip, as inserting content elements is part of the page module
415  break;
416  default:
417  if (!$this->newContentInto || !$this->‪isRecordCreationAllowedForTable($table) || !$this->‪isTableAllowedOnPage($table, $this->pageinfo)) {
418  break;
419  }
420  $nameParts = explode('_', $table);
421  $groupName = $v['ctrl']['groupName'] ?? null;
422  $title = (string)($v['ctrl']['title'] ?? '');
423  if (!isset($iconFile[$groupName]) || $nameParts[0] === 'tx' || $nameParts[0] === 'tt') {
424  $groupName = $groupName ?? $nameParts[1] ?? null;
425  // Try to extract extension name
426  if ($groupName) {
427  $_EXTKEY = '';
428  $titleIsTranslatableLabel = str_starts_with($title, 'LLL:EXT:');
429  if ($titleIsTranslatableLabel) {
430  // In case the title is a locallang reference, we can simply
431  // extract the extension name from the given extension path.
432  $_EXTKEY = substr($title, 8);
433  $_EXTKEY = substr($_EXTKEY, 0, (int)strpos($_EXTKEY, '/'));
434  } elseif (‪ExtensionManagementUtility::isLoaded($groupName)) {
435  // In case $title is not a locallang reference, we check the groupName to
436  // be a valid extension key. This most probably work since by convention the
437  // first part after tx_ / tt_ is the extension key.
438  $_EXTKEY = $groupName;
439  }
440  // Fetch the group title from the extension name
441  if ($_EXTKEY !== '') {
442  // Try to get the extension title
443  $package = GeneralUtility::makeInstance(PackageManager::class)->getPackage($_EXTKEY);
444  $groupTitle = $lang->sL('LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xlf:extension.title');
445  // If no localisation available, read title from the Package MetaData
446  if (!$groupTitle) {
447  $groupTitle = $package->getPackageMetaData()->getTitle();
448  }
449  $extensionIcon = $package->getPackageIcon();
450  if (!empty($extensionIcon)) {
451  $iconFile[$groupName] = '<img src="' . ‪PathUtility::getAbsoluteWebPath($package->getPackagePath() . $extensionIcon) . '" width="16" height="16" alt="' . $groupTitle . '" />';
452  }
453  if (!empty($groupTitle)) {
454  $groupTitles[$groupName] = $groupTitle;
455  } else {
456  $groupTitles[$groupName] = ucwords($_EXTKEY);
457  }
458  }
459  } else {
460  // Fall back to "system" in case no $groupName could be found
461  $groupName = 'system';
462  }
463  }
464  $this->tRows[$groupName]['title'] = $this->tRows[$groupName]['title'] ?? $groupTitles[$groupName] ?? $nameParts[1] ?? $title;
465  $this->tRows[$groupName]['icon'] = $this->tRows[$groupName]['icon'] ?? $iconFile[$groupName] ?? $iconFile['system'] ?? '';
466  $this->tRows[$groupName]['html'][$table] = $this->‪renderLink(htmlspecialchars($lang->sL($v['ctrl']['title'])), $table, $this->id);
467  }
468  }
469  // User sort
470  if (isset($pageTS['mod.']['wizards.']['newRecord.']['order'])) {
471  $this->newRecordSortList = ‪GeneralUtility::trimExplode(',', $pageTS['mod.']['wizards.']['newRecord.']['order'], true);
472  }
473  uksort($this->tRows, $this->‪sortTableRows(...));
474  $this->view->assign('groupedLinksOnTop', $groupedLinksOnTop);
475  $this->view->assign('recordTypeGroups', $this->tRows);
476  }
477 
485  protected function ‪sortTableRows(string $a, string $b): int
486  {
487  if (!empty($this->newRecordSortList)) {
488  if (in_array($a, $this->newRecordSortList) && in_array($b, $this->newRecordSortList)) {
489  // Both are in the list, return relative to position in array
490  $sub = array_search($a, $this->newRecordSortList) - array_search($b, $this->newRecordSortList);
491  $ret = ($sub < 0 ? -1 : $sub == 0) ? 0 : 1;
492  } elseif (in_array($a, $this->newRecordSortList)) {
493  // First element is in array, put to top
494  $ret = -1;
495  } elseif (in_array($b, $this->newRecordSortList)) {
496  // Second element is in array, put first to bottom
497  $ret = 1;
498  } else {
499  // No element is in array, return alphabetic order
500  $ret = strnatcasecmp($this->tRows[$a]['title'] ?? '', $this->tRows[$b]['title'] ?? '');
501  }
502  return $ret;
503  }
504  // Return alphabetic order
505  return strnatcasecmp($this->tRows[$a]['title'] ?? '', $this->tRows[$b]['title'] ?? '');
506  }
507 
516  protected function ‪renderLink(string $linkText, string $table, int $pid): string
517  {
518  $recordLink = (string)$this->uriBuilder->buildUriFromRoute(
519  'record_edit',
520  [
521  'edit' => [
522  $table => [
523  $pid => 'new',
524  ],
525  ],
526  'returnUrl' => $this->returnUrl,
527  ]
528  );
529  return '
530  <a class="list-group-item list-group-item-action" href="' . htmlspecialchars($recordLink) . '">
531  ' . $this->iconFactory->getIconForRecord($table, [], IconSize::SMALL)->render() . '
532  ' . $linkText . '
533  </a>';
534  }
535 
539  protected function ‪renderPageSelectPositionLink(): string
540  {
541  ‪$url = (string)$this->uriBuilder->buildUriFromRoute(
542  'db_new_pages',
543  [
544  'id' => $this->id,
545  'returnUrl' => $this->returnUrl,
546  ]
547  );
548  return '
549  <a href="' . htmlspecialchars(‪$url) . '" class="list-group-item list-group-item-action">
550  ' . $this->iconFactory->getIconForRecord('pages', [], IconSize::SMALL)->render() . '
551  ' . htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:pageSelectPosition')) . '
552  </a>';
553  }
554 
562  protected function ‪isTableAllowedOnPage(string $table, array $page): bool
563  {
564  $rootLevelConfiguration = (int)(‪$GLOBALS['TCA'][$table]['ctrl']['rootLevel'] ?? 0);
565  $rootLevelConstraintMatches = $rootLevelConfiguration === -1 || ($this->id xor $rootLevelConfiguration);
566  if (empty($page)) {
567  return $rootLevelConstraintMatches && $this->‪getBackendUserAuthentication()->isAdmin();
568  }
569  if (!$this->‪getBackendUserAuthentication()->workspaceCanCreateNewRecord($table)) {
570  return false;
571  }
572  // Checking doktype
573  $isAllowed = GeneralUtility::makeInstance(PageDoktypeRegistry::class)->isRecordTypeAllowedForDoktype($table, $page['doktype']);
574  return $rootLevelConstraintMatches && $isAllowed;
575  }
576 
593  protected function ‪isRecordCreationAllowedForTable(string $table, array ‪$allowedNewTables = [], array ‪$deniedNewTables = []): bool
594  {
595  if (!$this->‪getBackendUserAuthentication()->check('tables_modify', $table)) {
596  return false;
597  }
598 
599  $ctrl = ‪$GLOBALS['TCA'][$table]['ctrl'];
600  if (($ctrl['readOnly'] ?? false)
601  || ($ctrl['hideTable'] ?? false)
602  || ($ctrl['is_static'] ?? false)
603  || (($ctrl['adminOnly'] ?? false) && !$this->‪getBackendUserAuthentication()->isAdmin())
604  ) {
605  return false;
606  }
607 
610  // No deny/allow tables are set:
611  if (empty(‪$allowedNewTables) && empty(‪$deniedNewTables)) {
612  return true;
613  }
614 
615  return !in_array($table, ‪$deniedNewTables) && (empty(‪$allowedNewTables) || in_array($table, ‪$allowedNewTables));
616  }
617 
618  protected function ‪getLanguageService(): LanguageService
619  {
620  return ‪$GLOBALS['LANG'];
621  }
622 
623  protected function ‪getBackendUserAuthentication(): BackendUserAuthentication
624  {
625  return ‪$GLOBALS['BE_USER'];
626  }
627 }
‪TYPO3\CMS\Backend\Controller\NewRecordController\$id
‪int $id
Definition: NewRecordController.php:89
‪TYPO3\CMS\Core\DataHandling\PageDoktypeRegistry
Definition: PageDoktypeRegistry.php:35
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:27
‪TYPO3\CMS\Backend\Template\Components\ButtonBar\BUTTON_POSITION_LEFT
‪const BUTTON_POSITION_LEFT
Definition: ButtonBar.php:37
‪TYPO3\CMS\Backend\Template\Components\ButtonBar
Definition: ButtonBar.php:33
‪TYPO3\CMS\Backend\Controller\NewRecordController\$newPagesAfter
‪bool $newPagesAfter
Definition: NewRecordController.php:68
‪TYPO3\CMS\Backend\Controller\NewRecordController\renderNewRecordControls
‪renderNewRecordControls()
Definition: NewRecordController.php:337
‪TYPO3\CMS\Backend\Controller\NewRecordController\renderLink
‪string renderLink(string $linkText, string $table, int $pid)
Definition: NewRecordController.php:506
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_NEW
‪const PAGE_NEW
Definition: Permission.php:50
‪TYPO3\CMS\Backend\Template\ModuleTemplateFactory
Definition: ModuleTemplateFactory.php:33
‪TYPO3\CMS\Backend\Controller\NewRecordController\$view
‪ModuleTemplate $view
Definition: NewRecordController.php:103
‪TYPO3\CMS\Backend\Controller\NewRecordController\newPageAction
‪newPageAction(ServerRequestInterface $request)
Definition: NewRecordController.php:141
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:34
‪TYPO3\CMS\Backend\Controller\NewRecordController\getButtons
‪getButtons(bool $createPage=false)
Definition: NewRecordController.php:261
‪TYPO3\CMS\Backend\Controller\NewRecordController\isTableAllowedOnPage
‪bool isTableAllowedOnPage(string $table, array $page)
Definition: NewRecordController.php:552
‪TYPO3\CMS\Backend\Controller\NewRecordController\$returnUrl
‪string $returnUrl
Definition: NewRecordController.php:93
‪TYPO3\CMS\Backend\Template\ModuleTemplate
Definition: ModuleTemplate.php:46
‪TYPO3\CMS\Core\Type\Bitmask\Permission
Definition: Permission.php:26
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded
‪static isLoaded(string $key)
Definition: ExtensionManagementUtility.php:55
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:32
‪TYPO3\CMS\Backend\Controller\NewRecordController
Definition: NewRecordController.php:53
‪TYPO3\CMS\Backend\Controller\NewRecordController\$deniedNewTables
‪array $deniedNewTables
Definition: NewRecordController.php:82
‪TYPO3\CMS\Core\Utility\PathUtility\getAbsoluteWebPath
‪static string getAbsoluteWebPath(string $targetPath, bool $prefixWithSitePath=true)
Definition: PathUtility.php:52
‪TYPO3\CMS\Backend\Controller\NewRecordController\$pageinfo
‪array $pageinfo
Definition: NewRecordController.php:56
‪TYPO3\CMS\Core\Page\PageRenderer
Definition: PageRenderer.php:44
‪TYPO3\CMS\Backend\Controller\NewRecordController\mainAction
‪mainAction(ServerRequestInterface $request)
Definition: NewRecordController.php:116
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:44
‪TYPO3\CMS\Backend\Tree\View\PagePositionMap
Definition: PagePositionMap.php:39
‪TYPO3\CMS\Backend\Controller\NewRecordController\renderPageSelectPositionLink
‪renderPageSelectPositionLink()
Definition: NewRecordController.php:529
‪TYPO3\CMS\Backend\Tree\View\NewRecordPageTreeView
Definition: NewRecordPageTreeView.php:27
‪TYPO3\CMS\Backend\Routing\PreviewUriBuilder\create
‪static static create(int $pageId)
Definition: PreviewUriBuilder.php:65
‪TYPO3\CMS\Backend\Controller\NewRecordController\$newPagesSelectPosition
‪bool $newPagesSelectPosition
Definition: NewRecordController.php:74
‪TYPO3\CMS\Core\Domain\Repository\PageRepository\DOKTYPE_SPACER
‪const DOKTYPE_SPACER
Definition: PageRepository.php:103
‪TYPO3\CMS\Backend\Controller\NewRecordController\sortTableRows
‪int sortTableRows(string $a, string $b)
Definition: NewRecordController.php:475
‪TYPO3\CMS\Backend\Controller\NewRecordController\getLanguageService
‪getLanguageService()
Definition: NewRecordController.php:608
‪TYPO3\CMS\Backend\Controller\NewRecordController\doPageRecordsExistInSystem
‪doPageRecordsExistInSystem()
Definition: NewRecordController.php:319
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW
‪const PAGE_SHOW
Definition: Permission.php:35
‪TYPO3\CMS\Core\Domain\Repository\PageRepository\DOKTYPE_SYSFOLDER
‪const DOKTYPE_SYSFOLDER
Definition: PageRepository.php:104
‪TYPO3\CMS\Core\Http\RedirectResponse
Definition: RedirectResponse.php:30
‪TYPO3\CMS\Backend\Controller\NewRecordController\init
‪init(ServerRequestInterface $request)
Definition: NewRecordController.php:180
‪TYPO3\CMS\Webhooks\Message\$url
‪identifier readonly UriInterface $url
Definition: LoginErrorOccurredMessage.php:36
‪TYPO3\CMS\Core\Type\Bitmask\Permission\CONTENT_EDIT
‪const CONTENT_EDIT
Definition: Permission.php:55
‪TYPO3\CMS\Backend\Controller\NewRecordController\getBackendUserAuthentication
‪getBackendUserAuthentication()
Definition: NewRecordController.php:613
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction
Definition: DeletedRestriction.php:28
‪TYPO3\CMS\Backend\Routing\PreviewUriBuilder
Definition: PreviewUriBuilder.php:44
‪TYPO3\CMS\Backend\Controller\NewRecordController\$newRecordSortList
‪array $newRecordSortList
Definition: NewRecordController.php:64
‪TYPO3\CMS\Backend\Controller\NewRecordController\$pidInfo
‪array $pidInfo
Definition: NewRecordController.php:60
‪TYPO3\CMS\Backend\Attribute\AsController
Definition: AsController.php:25
‪TYPO3\CMS\Backend\Controller\NewRecordController\$newContentInto
‪bool $newContentInto
Definition: NewRecordController.php:67
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46
‪TYPO3\CMS\Backend\Controller\NewRecordController\$newPagesInto
‪bool $newPagesInto
Definition: NewRecordController.php:66
‪TYPO3\CMS\Core\Domain\Repository\PageRepository
Definition: PageRepository.php:69
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Backend\Controller\NewRecordController\isRecordCreationAllowedForTable
‪bool isRecordCreationAllowedForTable(string $table, array $allowedNewTables=[], array $deniedNewTables=[])
Definition: NewRecordController.php:583
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Backend\Controller\NewRecordController\$tRows
‪array $tRows
Definition: NewRecordController.php:101
‪TYPO3\CMS\Core\Utility\GeneralUtility\intExplode
‪static list< int > intExplode(string $delimiter, string $string, bool $removeEmptyValues=false)
Definition: GeneralUtility.php:756
‪TYPO3\CMS\Backend\Controller
Definition: AboutController.php:18
‪TYPO3\CMS\Backend\Controller\NewRecordController\__construct
‪__construct(protected readonly IconFactory $iconFactory, protected readonly PageRenderer $pageRenderer, protected readonly UriBuilder $uriBuilder, protected readonly ModuleTemplateFactory $moduleTemplateFactory)
Definition: NewRecordController.php:105
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static list< string > trimExplode(string $delim, string $string, bool $removeEmptyValues=false, int $limit=0)
Definition: GeneralUtility.php:822
‪TYPO3\CMS\Backend\Controller\NewRecordController\$perms_clause
‪string $perms_clause
Definition: NewRecordController.php:97
‪TYPO3\CMS\Backend\Controller\NewRecordController\$allowedNewTables
‪array $allowedNewTables
Definition: NewRecordController.php:78