TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
||||
|
||||
/**
|
||||
* Listeners are able to modify the initialized ContentObjectRenderer instance
|
||||
*/
|
||||
final readonly class AfterContentObjectRendererInitializedEvent
|
||||
{
|
||||
public function __construct(
|
||||
private ContentObjectRenderer $contentObjectRenderer
|
||||
) {}
|
||||
|
||||
public function getContentObjectRenderer(): ContentObjectRenderer
|
||||
{
|
||||
return $this->contentObjectRenderer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
||||
|
||||
/**
|
||||
* Listeners are able to modify the resolved ContentObjectRenderer->getData() result
|
||||
*/
|
||||
final class AfterGetDataResolvedEvent
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $parameterString,
|
||||
private readonly array $alternativeFieldArray,
|
||||
private mixed $result,
|
||||
private readonly ContentObjectRenderer $contentObjectRenderer
|
||||
) {}
|
||||
|
||||
public function getResult(): mixed
|
||||
{
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
public function setResult(mixed $result): void
|
||||
{
|
||||
$this->result = $result;
|
||||
}
|
||||
|
||||
public function getParameterString(): string
|
||||
{
|
||||
return $this->parameterString;
|
||||
}
|
||||
|
||||
public function getAlternativeFieldArray(): array
|
||||
{
|
||||
return $this->alternativeFieldArray;
|
||||
}
|
||||
|
||||
public function getContentObjectRenderer(): ContentObjectRenderer
|
||||
{
|
||||
return $this->contentObjectRenderer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
use TYPO3\CMS\Core\Imaging\ImageResource;
|
||||
use TYPO3\CMS\Core\Resource\File;
|
||||
use TYPO3\CMS\Core\Resource\FileReference;
|
||||
|
||||
/**
|
||||
* Listeners are able to modify the resolved ContentObjectRenderer->getImgResource() result
|
||||
*/
|
||||
final class AfterImageResourceResolvedEvent
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string|File|FileReference $file,
|
||||
private readonly array $fileArray,
|
||||
private ?ImageResource $imageResource
|
||||
) {}
|
||||
|
||||
public function getFile(): string|File|FileReference
|
||||
{
|
||||
return $this->file;
|
||||
}
|
||||
|
||||
public function getFileArray(): array
|
||||
{
|
||||
return $this->fileArray;
|
||||
}
|
||||
|
||||
public function getImageResource(): ?ImageResource
|
||||
{
|
||||
return $this->imageResource;
|
||||
}
|
||||
|
||||
public function setImageResource(?ImageResource $imageResource): void
|
||||
{
|
||||
$this->imageResource = $imageResource;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
/**
|
||||
* Event is called after the content has been modified by the rest of the stdWrap functions
|
||||
*/
|
||||
final class AfterStdWrapFunctionsExecutedEvent extends EnhanceStdWrapEvent {}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
/**
|
||||
* Event is dispatched after stdWrap functions have been initialized,
|
||||
* but before any content gets modified or replaced.
|
||||
*/
|
||||
final class AfterStdWrapFunctionsInitializedEvent extends EnhanceStdWrapEvent {}
|
||||
@@ -0,0 +1,89 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
||||
|
||||
/**
|
||||
* Listeners to this Event are able to modify the final stdWrap content
|
||||
* and corresponding cache tags, before being stored in cache.
|
||||
*
|
||||
* Additionally, listeners are also able to change the cache key to be used
|
||||
* as well as the lifetime. Therefore, the whole configuration is available.
|
||||
*/
|
||||
final class BeforeStdWrapContentStoredInCacheEvent
|
||||
{
|
||||
public function __construct(
|
||||
private ?string $content,
|
||||
private array $tags,
|
||||
private string $key,
|
||||
private ?int $lifetime,
|
||||
private readonly array $configuration,
|
||||
private readonly ContentObjectRenderer $contentObjectRenderer
|
||||
) {}
|
||||
|
||||
public function getContent(): ?string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function setContent(string $content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
public function getTags(): array
|
||||
{
|
||||
return $this->tags;
|
||||
}
|
||||
|
||||
public function setTags(array $tags): void
|
||||
{
|
||||
$this->tags = $tags;
|
||||
}
|
||||
|
||||
public function getKey(): string
|
||||
{
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
public function setKey(string $key): void
|
||||
{
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
public function getLifetime(): ?int
|
||||
{
|
||||
return $this->lifetime;
|
||||
}
|
||||
|
||||
public function setLifetime(?int $lifetime): void
|
||||
{
|
||||
$this->lifetime = $lifetime;
|
||||
}
|
||||
|
||||
public function getConfiguration(): array
|
||||
{
|
||||
return $this->configuration;
|
||||
}
|
||||
|
||||
public function getContentObjectRenderer(): ContentObjectRenderer
|
||||
{
|
||||
return $this->contentObjectRenderer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
/**
|
||||
* Event is called directly after the recursive stdWrap function call but still before the content gets modified
|
||||
*/
|
||||
final class BeforeStdWrapFunctionsExecutedEvent extends EnhanceStdWrapEvent {}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
/**
|
||||
* Event is dispatched before any stdWrap function is initialized / called
|
||||
*/
|
||||
final class BeforeStdWrapFunctionsInitializedEvent extends EnhanceStdWrapEvent {}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
||||
|
||||
/**
|
||||
* Listeners to this Event are able to modify the stdWrap processing, enhancing the functionality and
|
||||
* manipulating the final result / content. This is the parent Event, which allows the corresponding
|
||||
* listeners to be called on each step, see child Events:
|
||||
*
|
||||
* @see BeforeStdWrapFunctionsInitializedEvent
|
||||
* @see AfterStdWrapFunctionsInitializedEvent
|
||||
* @see BeforeStdWrapFunctionsExecutedEvent
|
||||
* @see AfterStdWrapFunctionsExecutedEvent
|
||||
*
|
||||
* Note: The class is declared abstract to prevent it from being dispatched directly.
|
||||
* Only child classes are to be dispatched to prevent duplicate executions.
|
||||
*/
|
||||
abstract class EnhanceStdWrapEvent
|
||||
{
|
||||
public function __construct(
|
||||
private ?string $content,
|
||||
private readonly array $configuration,
|
||||
private readonly ContentObjectRenderer $contentObjectRenderer
|
||||
) {}
|
||||
|
||||
public function getContent(): ?string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function setContent(string $content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
public function getConfiguration(): array
|
||||
{
|
||||
return $this->configuration;
|
||||
}
|
||||
|
||||
public function getContentObjectRenderer(): ContentObjectRenderer
|
||||
{
|
||||
return $this->contentObjectRenderer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
||||
|
||||
/**
|
||||
* Listeners are able to enrich the final source collection result
|
||||
*/
|
||||
final class ModifyImageSourceCollectionEvent
|
||||
{
|
||||
public function __construct(
|
||||
private string $sourceCollection,
|
||||
private readonly string $fullSourceCollection,
|
||||
private readonly array $sourceConfiguration,
|
||||
private readonly array $sourceRenderConfiguration,
|
||||
private readonly ContentObjectRenderer $contentObjectRenderer
|
||||
) {}
|
||||
|
||||
public function setSourceCollection(string $sourceCollection): void
|
||||
{
|
||||
$this->sourceCollection = $sourceCollection;
|
||||
}
|
||||
|
||||
public function getSourceCollection(): string
|
||||
{
|
||||
return $this->sourceCollection;
|
||||
}
|
||||
|
||||
public function getFullSourceCollection(): string
|
||||
{
|
||||
return $this->fullSourceCollection;
|
||||
}
|
||||
|
||||
public function getSourceConfiguration(): array
|
||||
{
|
||||
return $this->sourceConfiguration;
|
||||
}
|
||||
|
||||
public function getSourceRenderConfiguration(): array
|
||||
{
|
||||
return $this->sourceRenderConfiguration;
|
||||
}
|
||||
|
||||
public function getContentObjectRenderer(): ContentObjectRenderer
|
||||
{
|
||||
return $this->contentObjectRenderer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?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\ContentObject\Event;
|
||||
|
||||
/**
|
||||
* Event which is fired after ContentContentObject has pulled records from database.
|
||||
*
|
||||
* Therefore, allows listeners to completely manipulate the fetched
|
||||
* records, prior to being further processed by the content object.
|
||||
*
|
||||
* Additionally, the event also allows to manipulate the configuration
|
||||
* and options, such as the "value" or "slide".
|
||||
*/
|
||||
final class ModifyRecordsAfterFetchingContentEvent
|
||||
{
|
||||
public function __construct(
|
||||
private array $records,
|
||||
private string $finalContent,
|
||||
private int $slide,
|
||||
private int $slideCollect,
|
||||
private bool $slideCollectReverse,
|
||||
private bool $slideCollectFuzzy,
|
||||
private array $configuration,
|
||||
) {}
|
||||
|
||||
public function getRecords(): array
|
||||
{
|
||||
return $this->records;
|
||||
}
|
||||
|
||||
public function setRecords(array $records): void
|
||||
{
|
||||
$this->records = $records;
|
||||
}
|
||||
|
||||
public function getFinalContent(): string
|
||||
{
|
||||
return $this->finalContent;
|
||||
}
|
||||
|
||||
public function setFinalContent(string $finalContent): void
|
||||
{
|
||||
$this->finalContent = $finalContent;
|
||||
}
|
||||
|
||||
public function getSlide(): int
|
||||
{
|
||||
return $this->slide;
|
||||
}
|
||||
|
||||
public function setSlide(int $slide): void
|
||||
{
|
||||
$this->slide = $slide;
|
||||
}
|
||||
|
||||
public function getSlideCollect(): int
|
||||
{
|
||||
return $this->slideCollect;
|
||||
}
|
||||
|
||||
public function setSlideCollect(int $slideCollect): void
|
||||
{
|
||||
$this->slideCollect = $slideCollect;
|
||||
}
|
||||
|
||||
public function getSlideCollectReverse(): bool
|
||||
{
|
||||
return $this->slideCollectReverse;
|
||||
}
|
||||
|
||||
public function setSlideCollectReverse(bool $slideCollectReverse): void
|
||||
{
|
||||
$this->slideCollectReverse = $slideCollectReverse;
|
||||
}
|
||||
|
||||
public function getSlideCollectFuzzy(): bool
|
||||
{
|
||||
return $this->slideCollectFuzzy;
|
||||
}
|
||||
|
||||
public function setSlideCollectFuzzy(bool $slideCollectFuzzy): void
|
||||
{
|
||||
$this->slideCollectFuzzy = $slideCollectFuzzy;
|
||||
}
|
||||
|
||||
public function getConfiguration(): array
|
||||
{
|
||||
return $this->configuration;
|
||||
}
|
||||
|
||||
public function setConfiguration(array $configuration): void
|
||||
{
|
||||
$this->configuration = $configuration;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user