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