TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
use TYPO3\CMS\Core\View\ViewInterface;
|
||||
|
||||
/**
|
||||
* This event triggers after a page has been rendered.
|
||||
*
|
||||
* Listeners may update the page content string with a modified
|
||||
* version if appropriate.
|
||||
*/
|
||||
final class AfterBackendPageRenderEvent
|
||||
{
|
||||
public function __construct(private string $content, private readonly ViewInterface $view) {}
|
||||
|
||||
public function getContent(): string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function setContent(string $content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
public function getView(): ViewInterface
|
||||
{
|
||||
return $this->view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Listeners to this event will be able to modify the prepared file storage tree items for the file / folder tree
|
||||
*/
|
||||
final class AfterFileStorageTreeItemsPreparedEvent
|
||||
{
|
||||
/**
|
||||
* @param array<int, array<string, mixed>> $items
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly ServerRequestInterface $request,
|
||||
private array $items
|
||||
) {}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function getItems(): array
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
public function setItems(array $items): void
|
||||
{
|
||||
$this->items = $items;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Backend\Controller\EditDocumentController;
|
||||
|
||||
/**
|
||||
* Event to listen to after the form engine has been initialized (= all data has been persisted)
|
||||
*/
|
||||
final readonly class AfterFormEnginePageInitializedEvent
|
||||
{
|
||||
public function __construct(
|
||||
private EditDocumentController $controller,
|
||||
private ServerRequestInterface $request
|
||||
) {}
|
||||
|
||||
public function getController(): EditDocumentController
|
||||
{
|
||||
return $this->controller;
|
||||
}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
use TYPO3\CMS\Backend\View\BackendLayout\BackendLayout;
|
||||
|
||||
/**
|
||||
* This event triggers after the LocalizationController (AJAX) has
|
||||
* selected page columns to be translated. Allows third parties to
|
||||
* add to or change the columns and content elements withing those
|
||||
* columns which will be available for localization through the
|
||||
* "translate" modal in the page module.
|
||||
*/
|
||||
final class AfterPageColumnsSelectedForLocalizationEvent
|
||||
{
|
||||
public function __construct(
|
||||
private array $columns,
|
||||
private array $columnList,
|
||||
private readonly BackendLayout $backendLayout,
|
||||
private readonly array $records,
|
||||
private readonly array $parameters
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Returns list of columns, indexed by column position number, value is label (either LLL: or hardcoded).
|
||||
*/
|
||||
public function getColumns(): array
|
||||
{
|
||||
return $this->columns;
|
||||
}
|
||||
|
||||
public function setColumns(array $columns): void
|
||||
{
|
||||
$this->columns = $columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of integer column position numbers used in the BackendLayout.
|
||||
*/
|
||||
public function getColumnList(): array
|
||||
{
|
||||
return $this->columnList;
|
||||
}
|
||||
|
||||
public function setColumnList(array $columnList): void
|
||||
{
|
||||
$this->columnList = $columnList;
|
||||
}
|
||||
|
||||
public function getBackendLayout(): BackendLayout
|
||||
{
|
||||
return $this->backendLayout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of records which were used when building the original column
|
||||
* manifest and column position numbers list.
|
||||
*/
|
||||
public function getRecords(): array
|
||||
{
|
||||
return $this->records;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns request parameters passed to LocalizationController.
|
||||
*/
|
||||
public function getParameters(): array
|
||||
{
|
||||
return $this->parameters;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Listeners to this event will be able to modify the prepared page tree items for the page tree
|
||||
*/
|
||||
final class AfterPageTreeItemsPreparedEvent
|
||||
{
|
||||
/**
|
||||
* @param array<int, array<string, mixed>> $items
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly ServerRequestInterface $request,
|
||||
private array $items
|
||||
) {}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function getItems(): array
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
public function setItems(array $items): void
|
||||
{
|
||||
$this->items = $items;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
/**
|
||||
* Event dispatched after a record is opened for editing in FormEngine.
|
||||
*
|
||||
* This event allows extensions to track when records are opened,
|
||||
* such as maintaining lists of open documents or logging user activity.
|
||||
*
|
||||
* One event is dispatched per record being opened.
|
||||
*
|
||||
* @internal This event may change until v15 LTS
|
||||
*/
|
||||
final readonly class AfterRecordOpenedEvent
|
||||
{
|
||||
/**
|
||||
* @param string $table The database table name
|
||||
* @param int|string $uid The record UID
|
||||
* @param array<string, mixed> $record The full database record
|
||||
*/
|
||||
public function __construct(
|
||||
public string $table,
|
||||
public int|string $uid,
|
||||
public array $record,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
final class AfterRecordSummaryForLocalizationEvent
|
||||
{
|
||||
public function __construct(
|
||||
private array $records,
|
||||
private array $columns
|
||||
) {}
|
||||
|
||||
public function getColumns(): array
|
||||
{
|
||||
return $this->columns;
|
||||
}
|
||||
|
||||
public function setColumns(array $columns): void
|
||||
{
|
||||
$this->columns = $columns;
|
||||
}
|
||||
|
||||
public function getRecords(): array
|
||||
{
|
||||
return $this->records;
|
||||
}
|
||||
|
||||
public function setRecords(array $records): void
|
||||
{
|
||||
$this->records = $records;
|
||||
}
|
||||
}
|
||||
@@ -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\Backend\Controller\Event;
|
||||
|
||||
use TYPO3\CMS\Core\Page\JavaScriptRenderer;
|
||||
use TYPO3\CMS\Core\Page\PageRenderer;
|
||||
use TYPO3\CMS\Core\View\ViewInterface;
|
||||
|
||||
/**
|
||||
* This event triggers before a page has been rendered.
|
||||
*/
|
||||
final readonly class BeforeBackendPageRenderEvent
|
||||
{
|
||||
public function __construct(
|
||||
public ViewInterface $view,
|
||||
public JavaScriptRenderer $javaScriptRenderer,
|
||||
/** @internal */
|
||||
public PageRenderer $pageRenderer,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Backend\Controller\EditDocumentController;
|
||||
|
||||
/**
|
||||
* Event to listen to before the form engine has been initialized (= before all data will be persisted)
|
||||
*/
|
||||
final readonly class BeforeFormEnginePageInitializedEvent
|
||||
{
|
||||
public function __construct(
|
||||
private EditDocumentController $controller,
|
||||
private ServerRequestInterface $request
|
||||
) {}
|
||||
|
||||
public function getController(): EditDocumentController
|
||||
{
|
||||
return $this->controller;
|
||||
}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
||||
@@ -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\Backend\Controller\Event;
|
||||
|
||||
/**
|
||||
* This event allows extensions to add or remove from the list of allowed link types.
|
||||
*/
|
||||
final class ModifyAllowedItemsEvent
|
||||
{
|
||||
/**
|
||||
* @param string[] $allowedItems
|
||||
* @param array<string, mixed> $currentLinkParts
|
||||
*/
|
||||
public function __construct(
|
||||
private array $allowedItems,
|
||||
private array $currentLinkParts,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getAllowedItems(): array
|
||||
{
|
||||
return $this->allowedItems;
|
||||
}
|
||||
|
||||
public function addAllowedItem(string $item): self
|
||||
{
|
||||
$this->allowedItems[] = $item;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeAllowedItem(string $new): self
|
||||
{
|
||||
$this->allowedItems = array_filter($this->allowedItems, static fn(string $item): bool => $item !== $new);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function getCurrentLinkParts(): array
|
||||
{
|
||||
return $this->currentLinkParts;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
use TYPO3\CMS\Core\Messaging\AbstractMessage;
|
||||
|
||||
/**
|
||||
* Listeners to this event are able to add or change messages for the "Help > About" module.
|
||||
*/
|
||||
final class ModifyGenericBackendMessagesEvent
|
||||
{
|
||||
private array $messages = [];
|
||||
|
||||
public function getMessages(): array
|
||||
{
|
||||
return $this->messages;
|
||||
}
|
||||
|
||||
public function addMessage(AbstractMessage $message): void
|
||||
{
|
||||
$this->messages[] = $message;
|
||||
}
|
||||
|
||||
public function setMessages(array $messages): void
|
||||
{
|
||||
$this->messages = $messages;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
/**
|
||||
* This event allows extensions to modify the list of link handlers and their configuration before they are invoked.
|
||||
*/
|
||||
final class ModifyLinkHandlersEvent
|
||||
{
|
||||
/**
|
||||
* @param array<string, array> $linkHandlers
|
||||
* @param array<string, mixed> $currentLinkParts
|
||||
*/
|
||||
public function __construct(
|
||||
private array $linkHandlers,
|
||||
private array $currentLinkParts,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return array<string, array>
|
||||
*/
|
||||
public function getLinkHandlers(): array
|
||||
{
|
||||
return $this->linkHandlers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an individual handler by name.
|
||||
*
|
||||
* @param string $name The handler name, including trailing period.
|
||||
* @return array<string, mixed>|null The handler definition, or null if not defined.
|
||||
*/
|
||||
public function getLinkHandler(string $name): ?array
|
||||
{
|
||||
return $this->linkHandlers[$name] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a handler by name, overwriting it if it already exists.
|
||||
*
|
||||
* @param string $name The handler name, including trailing period.
|
||||
* @param array<string, mixed> $handler
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinkHandler(string $name, array $handler): self
|
||||
{
|
||||
$this->linkHandlers[$name] = $handler;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function getCurrentLinkParts(): array
|
||||
{
|
||||
return $this->currentLinkParts;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the wizard items of the new content element wizard component
|
||||
*/
|
||||
final class ModifyNewContentElementWizardItemsEvent
|
||||
{
|
||||
public function __construct(
|
||||
private array $wizardItems,
|
||||
private readonly array $pageInfo,
|
||||
private readonly ?int $colPos,
|
||||
private readonly int $sys_language,
|
||||
private readonly int $uid_pid,
|
||||
private readonly ServerRequestInterface $request,
|
||||
) {}
|
||||
|
||||
public function getWizardItems(): array
|
||||
{
|
||||
return $this->wizardItems;
|
||||
}
|
||||
|
||||
public function setWizardItems(array $wizardItems): void
|
||||
{
|
||||
$this->wizardItems = $wizardItems;
|
||||
}
|
||||
|
||||
public function hasWizardItem(string $identifier): bool
|
||||
{
|
||||
return isset($this->wizardItems[$identifier]);
|
||||
}
|
||||
|
||||
public function getWizardItem(string $identifier): ?array
|
||||
{
|
||||
return $this->wizardItems[$identifier] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new wizard item with configuration at a defined position.
|
||||
* Can also be used to relocate existing items and to modify their configuration.
|
||||
*/
|
||||
public function setWizardItem(string $identifier, array $configuration, array $position = []): void
|
||||
{
|
||||
if (isset($this->wizardItems[$position['before'] ?? ''])
|
||||
|| isset($this->wizardItems[$position['after'] ?? ''])
|
||||
) {
|
||||
// Always unset an existing item if valid positioning is requested
|
||||
unset($this->wizardItems[$identifier]);
|
||||
}
|
||||
|
||||
// Add item before another item
|
||||
if (($position['before'] ?? false)
|
||||
&& ($insertPosition = array_search((string)$position['before'], array_keys($this->wizardItems), true)) !== false
|
||||
) {
|
||||
$this->wizardItems = array_slice($this->wizardItems, 0, $insertPosition)
|
||||
+ [$identifier => $configuration]
|
||||
+ array_slice($this->wizardItems, $insertPosition);
|
||||
return;
|
||||
}
|
||||
|
||||
// Add item after another item
|
||||
if (($position['after'] ?? false)
|
||||
&& ($insertPosition = array_search((string)$position['after'], array_keys($this->wizardItems), true)) !== false
|
||||
) {
|
||||
$this->wizardItems = array_slice($this->wizardItems, 0, $insertPosition + 1)
|
||||
+ [$identifier => $configuration]
|
||||
+ array_slice($this->wizardItems, $insertPosition + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
// By default, add the item at the bottom or might just overwrite configuration of an existing item
|
||||
$this->wizardItems[$identifier] = $configuration;
|
||||
}
|
||||
|
||||
public function removeWizardItem(string $identifier): bool
|
||||
{
|
||||
if (!$this->hasWizardItem($identifier)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
unset($this->wizardItems[$identifier]);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides information about the current page making use of the wizard.
|
||||
*/
|
||||
public function getPageInfo(): array
|
||||
{
|
||||
return $this->pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides information about the column position of the button that triggered the wizard.
|
||||
*/
|
||||
public function getColPos(): ?int
|
||||
{
|
||||
return $this->colPos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides information about the language used while triggering the wizard.
|
||||
*/
|
||||
public function getSysLanguage(): int
|
||||
{
|
||||
return $this->sys_language;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides information about the element to position the new element after (uid) or into (pid).
|
||||
*/
|
||||
public function getUidPid(): int
|
||||
{
|
||||
return $this->uid_pid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the request in the state it was provided to the NewContentElementController::wizardAction() method.
|
||||
*/
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?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\Backend\Controller\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Core\Imaging\Icon;
|
||||
|
||||
/**
|
||||
* Event to modify the grouped links as result of NewRecordController
|
||||
*
|
||||
* Structure (array):
|
||||
*
|
||||
* "content" => [
|
||||
* "title" => "Content",
|
||||
* "icon" => "<img...>"
|
||||
* "items" => [
|
||||
* "sys_note" => [
|
||||
* [
|
||||
* "url" => "...",
|
||||
* "icon" => "...",
|
||||
* "label" => "...",
|
||||
* ],
|
||||
* ],
|
||||
* "sys_file_collection" => [
|
||||
* [
|
||||
* "icon" => "...",
|
||||
* "label" => "...",
|
||||
* "types" => [
|
||||
* "static" => [
|
||||
* 'url' => "...",
|
||||
* 'icon' => "...",
|
||||
* 'label' => "...",
|
||||
* ],
|
||||
* "folder" => [
|
||||
* 'url' => "...",
|
||||
* 'icon' => "...",
|
||||
* 'label' => "...",
|
||||
* ],
|
||||
* ],
|
||||
* ],
|
||||
* ],
|
||||
* ],
|
||||
* ],
|
||||
* "system" => [
|
||||
* "title" => "System Records",
|
||||
* "icon" => "<img...>"
|
||||
* "items" => [
|
||||
* "sys_template" => [
|
||||
* [
|
||||
* "url" => "...",
|
||||
* "icon" => "...",
|
||||
* "label" => "...",
|
||||
* ],
|
||||
* ],
|
||||
* "backend_layout" => [
|
||||
* [
|
||||
* "url" => "...",
|
||||
* "icon" => "...",
|
||||
* "label" => "...",
|
||||
* ],
|
||||
* ],
|
||||
* ],
|
||||
* ],
|
||||
*/
|
||||
final class ModifyNewRecordCreationLinksEvent
|
||||
{
|
||||
public function __construct(
|
||||
public array $groupedCreationLinks,
|
||||
public readonly array $pageTS,
|
||||
public readonly int $pageId,
|
||||
public readonly ServerRequestInterface $request
|
||||
) {}
|
||||
}
|
||||
@@ -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\Backend\Controller\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Backend\Template\ModuleTemplate;
|
||||
|
||||
/**
|
||||
* Listeners to this Event will be able to modify the header and footer content of the page module
|
||||
*/
|
||||
final class ModifyPageLayoutContentEvent
|
||||
{
|
||||
private string $headerContent = '';
|
||||
private string $footerContent = '';
|
||||
|
||||
public function __construct(
|
||||
private readonly ServerRequestInterface $request,
|
||||
private readonly ModuleTemplate $moduleTemplate
|
||||
) {}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function getModuleTemplate(): ModuleTemplate
|
||||
{
|
||||
return $this->moduleTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set content for the header. Can also be used to e.g. reorder existing content.
|
||||
* IMPORTANT: This overwrites existing content from previous listeners!
|
||||
*/
|
||||
public function setHeaderContent(string $content): void
|
||||
{
|
||||
$this->headerContent = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add additional content to the header
|
||||
*/
|
||||
public function addHeaderContent(string $content): void
|
||||
{
|
||||
$this->headerContent .= $content;
|
||||
}
|
||||
|
||||
public function getHeaderContent(): string
|
||||
{
|
||||
return $this->headerContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set content for the footer. Can also be used to e.g. reorder existing content.
|
||||
* IMPORTANT: This overwrites existing content from previous listeners!
|
||||
*/
|
||||
public function setFooterContent(string $content): void
|
||||
{
|
||||
$this->footerContent = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add additional content to the footer
|
||||
*/
|
||||
public function addFooterContent(string $content): void
|
||||
{
|
||||
$this->footerContent .= $content;
|
||||
}
|
||||
|
||||
public function getFooterContent(): string
|
||||
{
|
||||
return $this->footerContent;
|
||||
}
|
||||
}
|
||||
@@ -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\Backend\Controller\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Add content above or below the main content of the record list
|
||||
*/
|
||||
final class RenderAdditionalContentToRecordListEvent
|
||||
{
|
||||
private string $contentAbove = '';
|
||||
private string $contentBelow = '';
|
||||
|
||||
public function __construct(private readonly ServerRequestInterface $request) {}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function addContentAbove(string $contentAbove): void
|
||||
{
|
||||
$this->contentAbove .= $contentAbove;
|
||||
}
|
||||
|
||||
public function addContentBelow(string $contentBelow): void
|
||||
{
|
||||
$this->contentBelow .= $contentBelow;
|
||||
}
|
||||
|
||||
public function getAdditionalContentAbove(): string
|
||||
{
|
||||
return $this->contentAbove;
|
||||
}
|
||||
|
||||
public function getAdditionalContentBelow(): string
|
||||
{
|
||||
return $this->contentBelow;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user