‪TYPO3CMS  10.4
FileMetadataOverlayAspect.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 
33 {
39  {
40  // Should only be in Frontend, but not in eID context
41  if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE) || isset($_REQUEST['eID'])) {
42  return;
43  }
44  $overlaidMetaData = $event->‪getRecord();
45  $pageRepository = GeneralUtility::makeInstance(PageRepository::class);
46  $pageRepository->versionOL('sys_file_metadata', $overlaidMetaData);
47  $overlaidMetaData = $pageRepository
48  ->getLanguageOverlay(
49  'sys_file_metadata',
50  $overlaidMetaData
51  );
52  if ($overlaidMetaData !== null) {
53  $event->‪setRecord($overlaidMetaData);
54  }
55  }
56 }
‪TYPO3\CMS\Frontend\Aspect\FileMetadataOverlayAspect\languageAndWorkspaceOverlay
‪languageAndWorkspaceOverlay(EnrichFileMetaDataEvent $event)
Definition: FileMetadataOverlayAspect.php:38
‪TYPO3\CMS\Frontend\Aspect\FileMetadataOverlayAspect
Definition: FileMetadataOverlayAspect.php:33
‪TYPO3\CMS\Core\Resource\Event\EnrichFileMetaDataEvent
Definition: EnrichFileMetaDataEvent.php:26
‪TYPO3\CMS\Core\Resource\Event\EnrichFileMetaDataEvent\setRecord
‪setRecord(array $record)
Definition: EnrichFileMetaDataEvent.php:61
‪TYPO3\CMS\Core\Domain\Repository\PageRepository
Definition: PageRepository.php:52
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Resource\Event\EnrichFileMetaDataEvent\getRecord
‪getRecord()
Definition: EnrichFileMetaDataEvent.php:56
‪TYPO3\CMS\Frontend\Aspect
Definition: FileMetadataOverlayAspect.php:18