‪TYPO3CMS  10.4
RecordListController.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use Psr\Http\Message\ResponseInterface;
19 use Psr\Http\Message\ServerRequestInterface;
42 
48 {
54  protected ‪$id;
55 
61  protected ‪$pointer;
62 
68  protected ‪$table;
69 
75  protected ‪$search_field;
76 
82  protected ‪$search_levels;
83 
89  protected ‪$showLimit;
90 
96  protected ‪$returnUrl;
97 
103  protected ‪$cmd;
104 
110  protected ‪$cmd_table;
111 
117  protected ‪$perms_clause = '';
118 
125  protected ‪$modTSconfig;
126 
132  protected ‪$pageinfo;
133 
139  protected ‪$MOD_MENU = [];
140 
147  protected ‪$MOD_SETTINGS = [];
148 
152  protected ‪$body = '';
153 
157  protected ‪$pageRenderer;
158 
162  protected ‪$iconFactory;
163 
169  protected ‪$moduleTemplate;
170 
174  protected ‪$siteLanguages = [];
175 
179  public function ‪__construct()
180  {
181  $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
182  $this->‪getLanguageService()->‪includeLLFile('EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf');
183  $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Recordlist/FieldSelectBox');
184  $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Recordlist/Recordlist');
185  $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Recordlist/ClearCache');
186  $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
187  }
188 
194  protected function ‪init(ServerRequestInterface $request): void
195  {
196  $parsedBody = $request->getParsedBody();
197  $queryParams = $request->getQueryParams();
198  $backendUser = $this->‪getBackendUserAuthentication();
199  $this->perms_clause = $backendUser->getPagePermsClause(‪Permission::PAGE_SHOW);
200  // Get session data
201  $sessionData = $backendUser->getSessionData(__CLASS__);
202  $this->search_field = !empty($sessionData['search_field']) ? $sessionData['search_field'] : '';
203  // GPvars:
204  $this->id = (int)($parsedBody['id'] ?? $queryParams['id'] ?? 0);
205  $this->pointer = max(0, (int)($parsedBody['pointer'] ?? $queryParams['pointer'] ?? 0));
206  $this->table = (string)($parsedBody['table'] ?? $queryParams['table'] ?? '');
207  $this->search_field = (string)($parsedBody['search_field'] ?? $queryParams['search_field'] ?? $this->search_field);
208  $this->search_levels = (int)($parsedBody['search_levels'] ?? $queryParams['search_levels'] ?? 0);
209  $this->showLimit = (int)($parsedBody['showLimit'] ?? $queryParams['showLimit'] ?? 0);
210  $this->returnUrl = GeneralUtility::sanitizeLocalUrl((string)($parsedBody['returnUrl'] ?? $queryParams['returnUrl'] ?? ''));
211  $this->cmd = (string)($parsedBody['cmd'] ?? $queryParams['cmd'] ?? '');
212  $this->cmd_table = (string)($parsedBody['cmd_table'] ?? $queryParams['cmd_table'] ?? '');
213  $sessionData['search_field'] = ‪$this->search_field;
214  // Initialize menu
215  $this->MOD_MENU = [
216  'bigControlPanel' => '',
217  'clipBoard' => '',
218  ];
219  // Loading module configuration:
220  $this->modTSconfig['properties'] = ‪BackendUtility::getPagesTSconfig($this->id)['mod.']['web_list.'] ?? [];
221  // Clean up settings:
222  $this->MOD_SETTINGS = ‪BackendUtility::getModuleData($this->MOD_MENU, (array)($parsedBody['SET'] ?? $queryParams['SET'] ?? []), 'web_list');
223  // Store session data
224  $backendUser->setAndSaveSessionData(self::class, $sessionData);
225  $this->‪getPageRenderer()->‪addInlineLanguageLabelFile('EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf');
226  }
227 
234  protected function ‪main(ServerRequestInterface $request): string
235  {
236  $backendUser = $this->‪getBackendUserAuthentication();
237  $lang = $this->‪getLanguageService();
238  // Loading current page record and checking access:
239  $this->pageinfo = ‪BackendUtility::readPageAccess($this->id, $this->perms_clause);
240  $access = is_array($this->pageinfo);
241 
242  $this->‪getPageRenderer()->‪loadRequireJsModule('TYPO3/CMS/Backend/AjaxDataHandler');
243  $calcPerms = $backendUser->calcPerms($this->pageinfo);
244  $userCanEditPage = $calcPerms & ‪Permission::PAGE_EDIT && !empty($this->id) && ($backendUser->isAdmin() || (int)$this->pageinfo['editlock'] === 0);
245  $pageActionsCallback = null;
246  if ($userCanEditPage) {
247  $pageActionsCallback = 'function(PageActions) {
248  PageActions.setPageId(' . (int)$this->id . ');
249  }';
250  }
251  $this->‪getPageRenderer()->‪loadRequireJsModule('TYPO3/CMS/Backend/PageActions', $pageActionsCallback);
252  $this->‪getPageRenderer()->‪loadRequireJsModule('TYPO3/CMS/Recordlist/Tooltip');
253  // Apply predefined values for hidden checkboxes
254  // Set predefined value for DisplayBigControlPanel:
255  if ($this->modTSconfig['properties']['enableDisplayBigControlPanel'] === 'activated') {
256  $this->MOD_SETTINGS['bigControlPanel'] = true;
257  } elseif ($this->modTSconfig['properties']['enableDisplayBigControlPanel'] === 'deactivated') {
258  $this->MOD_SETTINGS['bigControlPanel'] = false;
259  }
260  // Set predefined value for Clipboard:
261  if ($this->modTSconfig['properties']['enableClipBoard'] === 'activated') {
262  $this->MOD_SETTINGS['clipBoard'] = true;
263  } elseif ($this->modTSconfig['properties']['enableClipBoard'] === 'deactivated') {
264  $this->MOD_SETTINGS['clipBoard'] = false;
265  } else {
266  if ($this->MOD_SETTINGS['clipBoard'] === null) {
267  $this->MOD_SETTINGS['clipBoard'] = true;
268  }
269  }
270 
271  // Initialize the dblist object:
272  $dblist = GeneralUtility::makeInstance(DatabaseRecordList::class);
273  $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
274  $dblist->setModuleData($this->MOD_SETTINGS ?? []);
275  $dblist->script = (string)$uriBuilder->buildUriFromRoute('web_list');
276  $dblist->calcPerms = $calcPerms;
277  $dblist->thumbs = $backendUser->uc['thumbnailsByDefault'];
278  $dblist->returnUrl = ‪$this->returnUrl;
279  $dblist->allFields = $this->MOD_SETTINGS['bigControlPanel'] || $this->table ? 1 : 0;
280  $dblist->showClipboard = 1;
281  $dblist->disableSingleTableView = $this->modTSconfig['properties']['disableSingleTableView'];
282  $dblist->listOnlyInSingleTableMode = $this->modTSconfig['properties']['listOnlyInSingleTableView'];
283  $dblist->hideTables = $this->modTSconfig['properties']['hideTables'];
284  $dblist->hideTranslations = $this->modTSconfig['properties']['hideTranslations'];
285  $dblist->tableTSconfigOverTCA = $this->modTSconfig['properties']['table.'];
286  $dblist->allowedNewTables = ‪GeneralUtility::trimExplode(',', $this->modTSconfig['properties']['allowedNewTables'], true);
287  $dblist->deniedNewTables = ‪GeneralUtility::trimExplode(',', $this->modTSconfig['properties']['deniedNewTables'], true);
288  $dblist->pageRow = ‪$this->pageinfo;
289  $dblist->counter++;
290  $dblist->MOD_MENU = ['bigControlPanel' => '', 'clipBoard' => ''];
291  $dblist->modTSconfig = ‪$this->modTSconfig;
292  $clickTitleMode = trim($this->modTSconfig['properties']['clickTitleMode']);
293  $dblist->clickTitleMode = $clickTitleMode === '' ? 'edit' : $clickTitleMode;
294  if (isset($this->modTSconfig['properties']['tableDisplayOrder.'])) {
295  $typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class);
296  $dblist->setTableDisplayOrder($typoScriptService->convertTypoScriptArrayToPlainArray($this->modTSconfig['properties']['tableDisplayOrder.']));
297  }
298  // Clipboard is initialized:
299  // Start clipboard
300  $dblist->clipObj = GeneralUtility::makeInstance(Clipboard::class);
301  // Initialize - reads the clipboard content from the user session
302  $dblist->clipObj->initializeClipboard();
303  // Clipboard actions are handled:
304  // CB is the clipboard command array
305  $CB = GeneralUtility::_GET('CB');
306  if ($this->cmd === 'setCB') {
307  // CBH is all the fields selected for the clipboard, CBC is the checkbox fields which were checked.
308  // By merging we get a full array of checked/unchecked elements
309  // This is set to the 'el' array of the CB after being parsed so only the table in question is registered.
310  $CB['el'] = $dblist->clipObj->cleanUpCBC(array_merge(GeneralUtility::_POST('CBH'), (array)GeneralUtility::_POST('CBC')), $this->cmd_table);
311  }
312  if (!$this->MOD_SETTINGS['clipBoard']) {
313  // If the clipboard is NOT shown, set the pad to 'normal'.
314  $CB['setP'] = 'normal';
315  }
316  // Execute commands.
317  $dblist->clipObj->setCmd($CB);
318  // Clean up pad
319  $dblist->clipObj->cleanCurrent();
320  // Save the clipboard content
321  $dblist->clipObj->endClipboard();
322  // This flag will prevent the clipboard panel in being shown.
323  // It is set, if the clickmenu-layer is active AND the extended view is not enabled.
324  $dblist->dontShowClipControlPanels = ($dblist->clipObj->current === 'normal' && !$this->modTSconfig['properties']['showClipControlPanelsDespiteOfCMlayers']);
325  // If there is access to the page or root page is used for searching, then render the list contents and set up the document template object:
326  if ($access || ($this->id === 0 && $this->search_levels !== 0 && $this->search_field !== '')) {
327  // Deleting records...:
328  // Has not to do with the clipboard but is simply the delete action. The clipboard object is used to clean up the submitted entries to only the selected table.
329  if ($this->cmd === 'delete') {
330  $items = $dblist->clipObj->cleanUpCBC(GeneralUtility::_POST('CBC'), ‪$this->cmd_table, 1);
331  if (!empty($items)) {
332  ‪$cmd = [];
333  foreach ($items as $iK => $value) {
334  $iKParts = explode('|', (string)$iK);
335  ‪$cmd[$iKParts[0]][$iKParts[1]]['delete'] = 1;
336  }
337  $tce = GeneralUtility::makeInstance(DataHandler::class);
338  $tce->start([], ‪$cmd);
339  $tce->process_cmdmap();
340  if (isset(‪$cmd['pages'])) {
341  ‪BackendUtility::setUpdateSignal('updatePageTree');
342  }
343  $tce->printLogErrorMessages();
344  }
345  }
346  // Initialize the listing object, dblist, for rendering the list:
347  $dblist->start($this->id, $this->table, $this->pointer, $this->search_field, $this->search_levels, $this->showLimit);
348  $dblist->setDispFields();
349  // Render the list of tables:
350  $dblist->generateList();
351  $listUrl = $dblist->listURL();
352 
353  // Add JavaScript functions to the page:
354  $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ClipboardComponent');
355 
356  $this->moduleTemplate->addJavaScriptCode(
357  'RecordListInlineJS',
358  '
359  function jumpExt(URL,anchor) {
360  console.warn(\'jumpExt() has been marked as deprecated. Consider using regular links instead.\');
361  var anc = anchor?anchor:"";
362  window.location.href = URL+(T3_THIS_LOCATION?"&returnUrl="+T3_THIS_LOCATION:"")+anc;
363  return false;
364  }
365  function jumpToUrl(URL) {
366  console.warn(\'jumpToUrl() has been marked as deprecated. Consider using regular links or window.location.href instead.\');
367  window.location.href = URL;
368  return false;
369  }
370 
371  function setHighlight(id) {
372  top.fsMod.recentIds["web"] = id;
373  top.fsMod.navFrameHighlightedID["web"] = top.fsMod.currentBank + "_" + id; // For highlighting
374 
375  if (top.nav_frame && top.nav_frame.refresh_nav) {
376  top.nav_frame.refresh_nav();
377  }
378  }
379  ' . $this->moduleTemplate->redirectUrls($listUrl) . '
380  function editRecords(table,idList,addParams,CBflag) {
381  window.location.href="' . (string)$uriBuilder->buildUriFromRoute('record_edit', ['returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]) . '&edit["+table+"]["+idList+"]=edit"+addParams;
382  }
383 
384  if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int)$this->id . ';
385  '
386  );
387 
388  // Setting up the context sensitive menu:
389  $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
390  }
391  // access
392  // Begin to compile the whole page, starting out with page header:
393  if (!$this->id) {
394  $title = ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
395  } else {
396  $title = $this->pageinfo['title'];
397  }
398  $this->body = $this->moduleTemplate->header($title);
399 
400  // Additional header content
401  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawHeaderHook'] ?? [] as $hook) {
402  $params = [
403  'request' => $request,
404  ];
405  $null = null;
406  $this->body .= GeneralUtility::callUserFunction($hook, $params, $null);
407  }
408 
409  $this->moduleTemplate->setTitle($title);
410 
411  ‪$output = '';
412  // Show the selector to add page translations, but only when in "default" mode.
413  // If not disabled via module TSconfig and the user is allowed, also show the page translations table.
414  if ($this->id && !$dblist->csvOutput && !$this->search_field && !$this->cmd && !$this->table) {
415  ‪$output .= $this->‪languageSelector($this->id);
416  if ($this->‪showPageTranslations()) {
417  $pageTranslationsDatabaseRecordList = clone $dblist;
418  $pageTranslationsDatabaseRecordList->listOnlyInSingleTableMode = false;
419  $pageTranslationsDatabaseRecordList->disableSingleTableView = true;
420  $pageTranslationsDatabaseRecordList->deniedNewTables = ['pages'];
421  $pageTranslationsDatabaseRecordList->hideTranslations = '';
422  $pageTranslationsDatabaseRecordList->iLimit = $pageTranslationsDatabaseRecordList->itemsLimitPerTable;
423  $pageTranslationsDatabaseRecordList->setLanguagesAllowedForUser($this->siteLanguages);
424  $pageTranslationsDatabaseRecordList->showOnlyTranslatedRecords(true);
425  ‪$output .= $pageTranslationsDatabaseRecordList->getTable('pages', $this->id);
426  }
427  }
428 
429  if (!empty($dblist->HTMLcode)) {
430  ‪$output .= $dblist->HTMLcode;
431  } else {
432  if (isset($this->table, ‪$GLOBALS['TCA'][$this->table]['ctrl']['title'])) {
433  if (strpos(‪$GLOBALS['TCA'][$this->table]['ctrl']['title'], 'LLL:') === 0) {
434  $ll = sprintf($lang->getLL('noRecordsOfTypeOnThisPage'), $lang->sL(‪$GLOBALS['TCA'][$this->table]['ctrl']['title']));
435  } else {
436  $ll = sprintf($lang->getLL('noRecordsOfTypeOnThisPage'), ‪$GLOBALS['TCA'][$this->table]['ctrl']['title']);
437  }
438  } else {
439  $ll = $lang->getLL('noRecordsOnThisPage');
440  }
441  $flashMessage = GeneralUtility::makeInstance(
442  FlashMessage::class,
443  $ll,
444  '',
446  );
447  unset($ll);
449  $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
451  $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
452  $defaultFlashMessageQueue->enqueue($flashMessage);
453  }
454 
455  $this->body .= '<form action="' . htmlspecialchars($dblist->listURL()) . '" method="post" name="dblistForm">';
456  $this->body .= ‪$output;
457  $this->body .= '<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" /></form>';
458  // If a listing was produced, create the page footer with search form etc:
459  if ($dblist->HTMLcode) {
460  // Making field select box (when extended view for a single table is enabled):
461  if ($dblist->table) {
462  $this->body .= $dblist->fieldSelectBox($dblist->table);
463  }
464  // Adding checkbox options for extended listing and clipboard display:
465  $this->body .= '
466 
467  <!--
468  Listing options for extended view and clipboard view
469  -->
470  <div class="typo3-listOptions">
471  <form action="" method="post">';
472 
473  // Add "display bigControlPanel" checkbox:
474  if ($this->modTSconfig['properties']['enableDisplayBigControlPanel'] === 'selectable') {
475  $this->body .= '<div class="checkbox">' .
476  '<label for="checkLargeControl">' .
477  ‪BackendUtility::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'] ?? '', '', $this->table ? '&table=' . $this->table : '', 'id="checkLargeControl"') .
478  ‪BackendUtility::wrapInHelp('xMOD_csh_corebe', 'list_options', htmlspecialchars($lang->getLL('largeControl'))) .
479  '</label>' .
480  '</div>';
481  }
482 
483  // Add "clipboard" checkbox:
484  if ($this->modTSconfig['properties']['enableClipBoard'] === 'selectable') {
485  if ($dblist->showClipboard) {
486  $this->body .= '<div class="checkbox">' .
487  '<label for="checkShowClipBoard">' .
488  ‪BackendUtility::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'] ?? '', '', $this->table ? '&table=' . $this->table : '', 'id="checkShowClipBoard"') .
489  ‪BackendUtility::wrapInHelp('xMOD_csh_corebe', 'list_options', htmlspecialchars($lang->getLL('showClipBoard'))) .
490  '</label>' .
491  '</div>';
492  }
493  }
494 
495  $this->body .= '
496  </form>
497  </div>';
498  }
499  // Printing clipboard if enabled
500  if ($this->MOD_SETTINGS['clipBoard'] && $dblist->showClipboard && ($dblist->HTMLcode || $dblist->clipObj->hasElements())) {
501  $this->body .= '<div class="db_list-dashboard">' . $dblist->clipObj->printClipboard() . '</div>';
502  }
503  // Additional footer content
504  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawFooterHook'] ?? [] as $hook) {
505  $params = [
506  'request' => $request,
507  ];
508  $null = null;
509  $this->body .= GeneralUtility::callUserFunction($hook, $params, $null);
510  }
511  // Setting up the buttons for docheader
512  $dblist->getDocHeaderButtons($this->moduleTemplate);
513  // search box toolbar
514  $content = '';
515  if (!($this->modTSconfig['properties']['disableSearchBox'] ?? false) && ($dblist->HTMLcode || !empty($dblist->searchString))) {
516  $content .= $dblist->getSearchBox();
517  $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ToggleSearchToolbox');
518 
519  $searchButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->makeLinkButton();
520  $searchButton
521  ->setHref('#')
522  ->setClasses('t3js-toggle-search-toolbox')
523  ->setTitle($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.title.searchIcon'))
524  ->setIcon($this->iconFactory->getIcon('actions-search', ‪Icon::SIZE_SMALL));
525  $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton(
526  $searchButton,
528  90
529  );
530  }
531 
532  if ($this->pageinfo) {
533  $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
534  }
535 
536  // Build the <body> for the module
537  $content .= ‪$this->body;
538  return $content;
539  }
540 
548  public function ‪mainAction(ServerRequestInterface $request): ResponseInterface
549  {
550  $site = $request->getAttribute('site');
551  $this->siteLanguages = $site->getAvailableLanguages($this->‪getBackendUserAuthentication(), false, (int)$this->id);
553  $this->‪init($request);
554  $content = $this->‪main($request);
555  $this->moduleTemplate->setContent($content);
556  return new ‪HtmlResponse($this->moduleTemplate->renderContent());
557  }
558 
567  protected function ‪languageSelector(int ‪$id): string
568  {
569  if (!$this->‪getBackendUserAuthentication()->check('tables_modify', 'pages')) {
570  return '';
571  }
572  $availableTranslations = [];
573  foreach ($this->siteLanguages as $siteLanguage) {
574  if ($siteLanguage->getLanguageId() === 0) {
575  continue;
576  }
577  $availableTranslations[$siteLanguage->getLanguageId()] = $siteLanguage->getTitle();
578  }
579  // Then, subtract the languages which are already on the page:
580  $localizationParentField = ‪$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField'];
581  $languageField = ‪$GLOBALS['TCA']['pages']['ctrl']['languageField'];
582  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');
583  $queryBuilder->getRestrictions()->removeAll()
584  ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
585  ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, (int)$this->‪getBackendUserAuthentication()->workspace));
586  $statement = $queryBuilder->select('uid', $languageField)
587  ->from('pages')
588  ->where(
589  $queryBuilder->expr()->eq(
590  $localizationParentField,
591  $queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT)
592  )
593  )
594  ->execute();
595  while ($pageTranslation = $statement->fetch()) {
596  unset($availableTranslations[(int)$pageTranslation[$languageField]]);
597  }
598  // If any languages are left, make selector:
599  if (!empty($availableTranslations)) {
600  ‪$output = '<option value="">' . htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:new_language')) . '</option>';
601  foreach ($availableTranslations as $languageUid => $languageTitle) {
602  // Build localize command URL to DataHandler (tce_db)
603  // which redirects to FormEngine (record_edit)
604  // which, when finished editing should return back to the current page (returnUrl)
605  $parameters = [
606  'justLocalized' => 'pages:' . ‪$id . ':' . $languageUid,
607  'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
608  ];
609  $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
610  $redirectUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
612  '&cmd[pages][' . ‪$id . '][localize]=' . $languageUid,
613  $redirectUrl
614  );
615 
616  ‪$output .= '<option value="' . htmlspecialchars($targetUrl) . '">' . htmlspecialchars($languageTitle) . '</option>';
617  }
618 
619  return '<div class="form-inline form-inline-spaced">'
620  . '<div class="form-group">'
621  . '<select class="form-control input-sm" name="createNewLanguage" data-global-event="change" data-action-navigate="$value">'
622  . ‪$output
623  . '</select></div></div>';
624  }
625  return '';
626  }
627 
628  protected function ‪showPageTranslations(): bool
629  {
630  if (!$this->‪getBackendUserAuthentication()->check('tables_select', 'pages')) {
631  return false;
632  }
633 
634  if (isset($this->modTSconfig['properties']['table.']['pages.']['hideTable'])) {
635  return !$this->modTSconfig['properties']['table.']['pages.']['hideTable'];
636  }
637 
638  $hideTables = $this->modTSconfig['properties']['hideTables'] ?? '';
639  return !(‪$GLOBALS['TCA']['pages']['ctrl']['hideTable'] ?? false)
640  && $hideTables !== '*'
641  && !in_array('pages', ‪GeneralUtility::trimExplode(',', $hideTables), true);
642  }
643 
647  protected function ‪getModuleTemplate(): ModuleTemplate
648  {
650  }
651 
655  protected function ‪getBackendUserAuthentication(): BackendUserAuthentication
656  {
657  return ‪$GLOBALS['BE_USER'];
658  }
659 
663  protected function ‪getLanguageService(): LanguageService
664  {
665  return ‪$GLOBALS['LANG'];
666  }
667 
671  protected function ‪getPageRenderer(): PageRenderer
672  {
673  if ($this->pageRenderer === null) {
674  $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
675  }
676  return ‪$this->pageRenderer;
677  }
678 }
‪TYPO3\CMS\Core\DataHandling\DataHandler
Definition: DataHandler.php:84
‪TYPO3\CMS\Recordlist\Controller\RecordListController\languageSelector
‪string languageSelector(int $id)
Definition: RecordListController.php:548
‪TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL
‪const SIZE_SMALL
Definition: Icon.php:30
‪TYPO3\CMS\Recordlist\Controller\RecordListController\showPageTranslations
‪showPageTranslations()
Definition: RecordListController.php:609
‪TYPO3\CMS\Core\Page\PageRenderer\addInlineLanguageLabelFile
‪addInlineLanguageLabelFile($fileRef, $selectionPrefix='', $stripFromSelectionName='')
Definition: PageRenderer.php:1564
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$search_field
‪string $search_field
Definition: RecordListController.php:71
‪TYPO3\CMS\Core\Localization\LanguageService\includeLLFile
‪array includeLLFile($fileRef, $setGlobal=null, $mergeLocalOntoDefault=null)
Definition: LanguageService.php:297
‪TYPO3\CMS\Backend\Template\Components\ButtonBar\BUTTON_POSITION_LEFT
‪const BUTTON_POSITION_LEFT
Definition: ButtonBar.php:36
‪TYPO3\CMS\Backend\Template\Components\ButtonBar
Definition: ButtonBar.php:32
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$cmd
‪string $cmd
Definition: RecordListController.php:95
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$pageinfo
‪mixed[] bool $pageinfo
Definition: RecordListController.php:120
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$cmd_table
‪string $cmd_table
Definition: RecordListController.php:101
‪TYPO3\CMS\Backend\Utility\BackendUtility\getLinkToDataHandlerAction
‪static string getLinkToDataHandlerAction($parameters, $redirectUrl='')
Definition: BackendUtility.php:2539
‪TYPO3\CMS\Recordlist\Controller\RecordListController\getPageRenderer
‪PageRenderer getPageRenderer()
Definition: RecordListController.php:652
‪TYPO3\CMS\Backend\Clipboard\Clipboard
Definition: Clipboard.php:43
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:26
‪TYPO3\CMS\Backend\Utility\BackendUtility\setUpdateSignal
‪static setUpdateSignal($set='', $params='')
Definition: BackendUtility.php:2798
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$siteLanguages
‪SiteLanguage[] $siteLanguages
Definition: RecordListController.php:155
‪TYPO3\CMS\Recordlist\Controller\RecordListController\getLanguageService
‪LanguageService getLanguageService()
Definition: RecordListController.php:644
‪TYPO3\CMS\Recordlist\Controller\RecordListController\__construct
‪__construct()
Definition: RecordListController.php:160
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$iconFactory
‪IconFactory $iconFactory
Definition: RecordListController.php:145
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$perms_clause
‪string $perms_clause
Definition: RecordListController.php:107
‪TYPO3\CMS\Backend\Utility\BackendUtility\lockRecords
‪static lockRecords($table='', $uid=0, $pid=0)
Definition: BackendUtility.php:2967
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:33
‪TYPO3\CMS\Backend\Utility\BackendUtility\wrapInHelp
‪static string wrapInHelp($table, $field, $text='', array $overloadHelpText=[])
Definition: BackendUtility.php:2260
‪TYPO3\CMS\Backend\Template\ModuleTemplate
Definition: ModuleTemplate.php:43
‪TYPO3\CMS\Core\Type\Bitmask\Permission
Definition: Permission.php:24
‪TYPO3\CMS\Core\Page\PageRenderer\loadRequireJsModule
‪loadRequireJsModule($mainModuleName, $callBackFunction=null)
Definition: PageRenderer.php:1493
‪TYPO3\CMS\Core\Site\Entity\SiteLanguage
Definition: SiteLanguage.php:26
‪TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList
Definition: DatabaseRecordList.php:57
‪TYPO3\CMS\Core\Page\PageRenderer
Definition: PageRenderer.php:42
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$returnUrl
‪string $returnUrl
Definition: RecordListController.php:89
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$body
‪string $body
Definition: RecordListController.php:137
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$search_levels
‪int $search_levels
Definition: RecordListController.php:77
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$table
‪string $table
Definition: RecordListController.php:65
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$moduleTemplate
‪ModuleTemplate $moduleTemplate
Definition: RecordListController.php:151
‪TYPO3\CMS\Recordlist\Controller\RecordListController
Definition: RecordListController.php:48
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:38
‪TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig
‪static array getPagesTSconfig($id)
Definition: BackendUtility.php:698
‪TYPO3\CMS\Backend\Utility\BackendUtility\getModuleData
‪static array getModuleData( $MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
Definition: BackendUtility.php:2893
‪TYPO3\CMS\Backend\Utility\BackendUtility\getFuncCheck
‪static string getFuncCheck( $mainParams, $elementName, $currentValue, $script='', $addParams='', $tagParams='')
Definition: BackendUtility.php:2709
‪TYPO3\CMS\Recordlist\Controller\RecordListController\mainAction
‪ResponseInterface mainAction(ServerRequestInterface $request)
Definition: RecordListController.php:529
‪TYPO3\CMS\Recordlist\Controller\RecordListController\main
‪string main(ServerRequestInterface $request)
Definition: RecordListController.php:215
‪TYPO3\CMS\Recordlist\Controller
Definition: AbstractLinkBrowserController.php:16
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$MOD_SETTINGS
‪string[] $MOD_SETTINGS
Definition: RecordListController.php:133
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW
‪const PAGE_SHOW
Definition: Permission.php:33
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$pageRenderer
‪PageRenderer $pageRenderer
Definition: RecordListController.php:141
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$id
‪int $id
Definition: RecordListController.php:53
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static string[] trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:1059
‪TYPO3\CMS\Backend\Utility\BackendUtility\readPageAccess
‪static array false readPageAccess($id, $perms_clause)
Definition: BackendUtility.php:597
‪TYPO3\CMS\Core\TypoScript\TypoScriptService
Definition: TypoScriptService.php:25
‪$output
‪$output
Definition: annotationChecker.php:119
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$modTSconfig
‪array $modTSconfig
Definition: RecordListController.php:114
‪TYPO3\CMS\Recordlist\Controller\RecordListController\init
‪init(ServerRequestInterface $request)
Definition: RecordListController.php:175
‪TYPO3\CMS\Core\Messaging\AbstractMessage\INFO
‪const INFO
Definition: AbstractMessage.php:28
‪TYPO3\CMS\Core\Messaging\FlashMessage
Definition: FlashMessage.php:24
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction
Definition: DeletedRestriction.php:28
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_EDIT
‪const PAGE_EDIT
Definition: Permission.php:38
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$showLimit
‪int $showLimit
Definition: RecordListController.php:83
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$MOD_MENU
‪string[] $MOD_MENU
Definition: RecordListController.php:126
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Recordlist\Controller\RecordListController\getModuleTemplate
‪ModuleTemplate getModuleTemplate()
Definition: RecordListController.php:628
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Messaging\FlashMessageService
Definition: FlashMessageService.php:27
‪TYPO3\CMS\Recordlist\Controller\RecordListController\getBackendUserAuthentication
‪BackendUserAuthentication getBackendUserAuthentication()
Definition: RecordListController.php:636
‪TYPO3\CMS\Core\Http\HtmlResponse
Definition: HtmlResponse.php:26
‪TYPO3\CMS\Recordlist\Controller\RecordListController\$pointer
‪int $pointer
Definition: RecordListController.php:59
‪TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction
Definition: WorkspaceRestriction.php:39