TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?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\Form\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Listeners to those Events will be able to modify the form definition and
|
||||
* persistence identifier before a form is processed, e.g. created or saved.
|
||||
*/
|
||||
abstract class AbstractFormEvent
|
||||
{
|
||||
/**
|
||||
* @param array{type: string, label: string, identifier: string, prototypeName: string, renderables?: array} $form
|
||||
* The form definition as an array. The array contains at least the following keys: type, label, identifier,
|
||||
* prototypeName. Optionally, the array may contain a key "renderables" with predefined renderables of the form.
|
||||
*/
|
||||
public function __construct(
|
||||
public string $formPersistenceIdentifier,
|
||||
public array $form,
|
||||
public readonly ServerRequestInterface $request,
|
||||
) {}
|
||||
}
|
||||
@@ -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\Form\Event;
|
||||
|
||||
use TYPO3\CMS\Extbase\Mvc\RequestInterface;
|
||||
use TYPO3\CMS\Form\Domain\Model\FormElements\Page;
|
||||
use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the current page after it has been resolved.
|
||||
*/
|
||||
final class AfterCurrentPageIsResolvedEvent
|
||||
{
|
||||
public function __construct(
|
||||
public ?Page $currentPage,
|
||||
public readonly FormRuntime $formRuntime,
|
||||
public readonly ?Page $lastDisplayedPage,
|
||||
public readonly RequestInterface $request,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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\Form\Event;
|
||||
|
||||
/**
|
||||
* Listeners to this event are able to modify the form definition validation
|
||||
* configuration after it has been built from the form editor setup. Use this
|
||||
* event to add additional writable property paths for custom form editor
|
||||
* inspector editor implementations that do not declare their writable
|
||||
* property paths through the standard YAML configuration (e.g. propertyPath).
|
||||
*/
|
||||
final class AfterFormDefinitionValidationConfigurationIsBuiltEvent
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $prototypeName,
|
||||
private array $configuration,
|
||||
) {}
|
||||
|
||||
public function getPrototypeName(): string
|
||||
{
|
||||
return $this->prototypeName;
|
||||
}
|
||||
|
||||
public function getConfiguration(): array
|
||||
{
|
||||
return $this->configuration;
|
||||
}
|
||||
|
||||
public function setConfiguration(array $configuration): void
|
||||
{
|
||||
$this->configuration = $configuration;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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\Form\Event;
|
||||
|
||||
use TYPO3\CMS\Form\Domain\Model\FormDefinition;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the form definition after it has been built
|
||||
*/
|
||||
final class AfterFormIsBuiltEvent
|
||||
{
|
||||
public function __construct(
|
||||
public FormDefinition $form
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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\Form\Event;
|
||||
|
||||
use TYPO3\CMS\Extbase\Mvc\RequestInterface;
|
||||
use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the form runtime after it has been initialized.
|
||||
*/
|
||||
final class AfterFormStateInitializedEvent
|
||||
{
|
||||
public function __construct(
|
||||
public FormRuntime $formRuntime,
|
||||
public readonly RequestInterface $request,
|
||||
) {}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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\Form\Event;
|
||||
|
||||
use TYPO3\CMS\Form\Domain\Finishers\FinisherContext;
|
||||
|
||||
/**
|
||||
* Listeners are able to modify the options, used by the EmailFinisher. Possible
|
||||
* use cases might be unsetting recipients or to changing the subject of the mail.
|
||||
*/
|
||||
final class BeforeEmailFinisherInitializedEvent
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $options
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly FinisherContext $finisherContext,
|
||||
private array $options
|
||||
) {}
|
||||
|
||||
public function getFinisherContext(): FinisherContext
|
||||
{
|
||||
return $this->finisherContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function getOptions(): array
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $options
|
||||
*/
|
||||
public function setOptions(array $options): void
|
||||
{
|
||||
$this->options = $options;
|
||||
}
|
||||
}
|
||||
@@ -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\Form\Event;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the form definition
|
||||
* and persistence identifier before a new form is created.
|
||||
*/
|
||||
final class BeforeFormIsCreatedEvent extends AbstractFormEvent {}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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\Form\Event;
|
||||
|
||||
use Psr\EventDispatcher\StoppableEventInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to:
|
||||
* - Get the form persistence identifier before a form is deleted
|
||||
* - Stop the deletion process by setting preventDeletion to true
|
||||
* - Add custom logic, e.g. cleanup tasks, before deletion
|
||||
*/
|
||||
final class BeforeFormIsDeletedEvent implements StoppableEventInterface
|
||||
{
|
||||
public function __construct(
|
||||
public readonly string $formPersistenceIdentifier,
|
||||
public readonly ServerRequestInterface $request,
|
||||
public bool $preventDeletion = false,
|
||||
) {}
|
||||
|
||||
public function isPropagationStopped(): bool
|
||||
{
|
||||
return $this->preventDeletion;
|
||||
}
|
||||
}
|
||||
@@ -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\Form\Event;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the form definition
|
||||
* and persistence identifier before a form is duplicated.
|
||||
*/
|
||||
final class BeforeFormIsDuplicatedEvent extends AbstractFormEvent {}
|
||||
@@ -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\Form\Event;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the form definition
|
||||
* and persistence identifier before a form is saved.
|
||||
*/
|
||||
final class BeforeFormIsSavedEvent extends AbstractFormEvent {}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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\Form\Event;
|
||||
|
||||
use TYPO3\CMS\Form\Domain\Model\Renderable\RenderableInterface;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the renderable (form element) before being finally added to the form
|
||||
*/
|
||||
final class BeforeRenderableIsAddedToFormEvent
|
||||
{
|
||||
public function __construct(
|
||||
public RenderableInterface $renderable
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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\Form\Event;
|
||||
|
||||
use Psr\EventDispatcher\StoppableEventInterface;
|
||||
use TYPO3\CMS\Form\Domain\Model\Renderable\AbstractRenderable;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to:
|
||||
* - Get the renderable that is about to be removed from the form
|
||||
* - Stop the deletion process by setting preventRemoval to true
|
||||
* - Add custom logic, e.g. cleanup tasks, before deletion
|
||||
*/
|
||||
final class BeforeRenderableIsRemovedFromFormEvent implements StoppableEventInterface
|
||||
{
|
||||
public function __construct(
|
||||
public readonly AbstractRenderable $renderable,
|
||||
public bool $preventRemoval = false,
|
||||
) {}
|
||||
|
||||
public function isPropagationStopped(): bool
|
||||
{
|
||||
return $this->preventRemoval;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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\Form\Event;
|
||||
|
||||
use TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface;
|
||||
use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the renderable before it is rendered.
|
||||
*/
|
||||
final class BeforeRenderableIsRenderedEvent
|
||||
{
|
||||
public function __construct(
|
||||
public RootRenderableInterface $renderable,
|
||||
public FormRuntime $formRuntime,
|
||||
) {}
|
||||
}
|
||||
@@ -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\Form\Event;
|
||||
|
||||
use TYPO3\CMS\Extbase\Mvc\RequestInterface;
|
||||
use TYPO3\CMS\Form\Domain\Model\Renderable\RenderableInterface;
|
||||
use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the submitted value
|
||||
*/
|
||||
final class BeforeRenderableIsValidatedEvent
|
||||
{
|
||||
public function __construct(
|
||||
public mixed $value,
|
||||
public readonly FormRuntime $formRuntime,
|
||||
public readonly RenderableInterface $renderable,
|
||||
public readonly RequestInterface $request,
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user