‪TYPO3CMS  ‪main
PageLayoutViewDrawEmptyColposContent.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 
23 
28 {
29  #[AsEventListener('backend-empty-colpos')]
30  public function ‪__invoke(‪AfterSectionMarkupGeneratedEvent $event): void
31  {
32  if (($event->‪getColumnConfig()['name'] ?? '') === 'unused'
33  || (isset($event->‪getColumnConfig()['colPos']) &&
34  trim((string)$event->‪getColumnConfig()['colPos']) !== '')
35  ) {
36  // Early return for the special "unused" column or
37  // in case the current column has a colPos set.
38  return;
39  }
40 
41  $lang = $this->‪getLanguageService();
42  $content = $event->‪getContent();
43  $content .= '
44  <div data-colpos="1" data-language-uid="0" class="t3-page-ce-wrapper">
45  <div class="t3-page-ce">
46  <div class="t3-page-ce-element">
47  <div class="t3-page-ce-header">
48  <div class="t3-page-ce-header-title">' . htmlspecialchars($lang->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:emptyColPos')) . '</div>
49  </div>
50  <div class="t3-page-ce-body">' . htmlspecialchars($lang->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:emptyColPos.message')) . '</div>
51  </div>
52  </div>
53  </div>';
54 
55  $event->‪setContent($content);
56  }
57 
59  {
60  return ‪$GLOBALS['LANG'];
61  }
62 }
‪TYPO3\CMS\Backend\View\Event\AbstractSectionMarkupGeneratedEvent\getContent
‪getContent()
Definition: AbstractSectionMarkupGeneratedEvent.php:59
‪TYPO3\CMS\Core\Attribute\AsEventListener
Definition: AsEventListener.php:25
‪TYPO3\CMS\Backend\View
Definition: AuthenticationStyleInformation.php:18
‪TYPO3\CMS\Backend\View\Event\AfterSectionMarkupGeneratedEvent
Definition: AfterSectionMarkupGeneratedEvent.php:24
‪TYPO3\CMS\Backend\View\PageLayoutViewDrawEmptyColposContent
Definition: PageLayoutViewDrawEmptyColposContent.php:28
‪TYPO3\CMS\Backend\View\Event\AbstractSectionMarkupGeneratedEvent\getColumnConfig
‪getColumnConfig()
Definition: AbstractSectionMarkupGeneratedEvent.php:39
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Backend\View\Event\AbstractSectionMarkupGeneratedEvent\setContent
‪setContent(string $content='')
Definition: AbstractSectionMarkupGeneratedEvent.php:54
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46
‪TYPO3\CMS\Backend\View\PageLayoutViewDrawEmptyColposContent\getLanguageService
‪getLanguageService()
Definition: PageLayoutViewDrawEmptyColposContent.php:58
‪TYPO3\CMS\Backend\View\PageLayoutViewDrawEmptyColposContent\__invoke
‪__invoke(AfterSectionMarkupGeneratedEvent $event)
Definition: PageLayoutViewDrawEmptyColposContent.php:30