TYPO3 v15 dev-main snapshot ()

This commit is contained in:
2026-08-10 22:31:27 +02:00
commit 44c503b2d1
233 changed files with 31556 additions and 0 deletions
@@ -0,0 +1,61 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Frontend\Aspect;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
use TYPO3\CMS\Core\Http\ApplicationType;
use TYPO3\CMS\Core\Resource\Event\EnrichFileMetaDataEvent;
/**
* This class deals with metadata translation as an event listener which reacts on an event MetadataRepository.
*
* The listener injects user permissions and mount points into the storage
* based on user or group configuration.
*
* @internal this is a concrete TYPO3 Event Listener and solely used for EXT:frontend and not part of TYPO3's Core API.
*/
final readonly class FileMetadataOverlayAspect
{
public function __construct(
private PageRepository $pageRepository,
) {}
/**
* Do translation and workspace overlay
*/
#[AsEventListener('typo3-frontend/overlay')]
public function languageAndWorkspaceOverlay(EnrichFileMetaDataEvent $event): void
{
// Should only be in Frontend, but not in eID context
if (!($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface
|| !ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()
|| isset($_REQUEST['eID'])
) {
return;
}
$overlaidMetaData = $event->getRecord();
$this->pageRepository->versionOL('sys_file_metadata', $overlaidMetaData);
// getLanguageOverlay also calls versionOL() on the language overlaid record
$overlaidMetaData = $this->pageRepository->getLanguageOverlay('sys_file_metadata', $overlaidMetaData);
if ($overlaidMetaData !== null) {
$event->setRecord($overlaidMetaData);
}
}
}
+52
View File
@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Frontend\Aspect;
use TYPO3\CMS\Core\Context\AspectInterface;
use TYPO3\CMS\Core\Context\Exception\AspectPropertyNotFoundException;
/**
* The aspect contains information on whether TYPO3 is currently in preview mode
*
* Allowed properties:
* - isPreview
*/
final readonly class PreviewAspect implements AspectInterface
{
public function __construct(
private bool $isPreview = false
) {}
public function isPreview(): bool
{
return $this->isPreview;
}
/**
* Get a property from aspect
*
* @throws AspectPropertyNotFoundException
*/
public function get(string $name): bool
{
if ($name == 'isPreview') {
return $this->isPreview;
}
throw new AspectPropertyNotFoundException('Property "' . $name . '" not found in Aspect "' . __CLASS__ . '".', 1563375558);
}
}