TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
<?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\View\Event;
|
||||
|
||||
use TYPO3\CMS\Backend\View\PageLayoutContext;
|
||||
use TYPO3\CMS\Core\Domain\RecordInterface;
|
||||
|
||||
/**
|
||||
* Use this Event to modify a custom preview for a content type in the
|
||||
* Page Module after PageContentPreviewRenderingEvent and content preview rendering is executed.
|
||||
*/
|
||||
final class AfterPageContentPreviewRenderedEvent
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $table,
|
||||
private readonly string $recordType,
|
||||
private readonly RecordInterface $record,
|
||||
private readonly PageLayoutContext $context,
|
||||
private string $previewContent,
|
||||
) {}
|
||||
|
||||
public function getTable(): string
|
||||
{
|
||||
return $this->table;
|
||||
}
|
||||
|
||||
public function getRecordType(): string
|
||||
{
|
||||
return $this->recordType;
|
||||
}
|
||||
|
||||
public function getRecord(): RecordInterface
|
||||
{
|
||||
return $this->record;
|
||||
}
|
||||
|
||||
public function getPageLayoutContext(): PageLayoutContext
|
||||
{
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
public function getPreviewContent(): string
|
||||
{
|
||||
return $this->previewContent;
|
||||
}
|
||||
|
||||
public function setPreviewContent(string $content): void
|
||||
{
|
||||
$this->previewContent = $content;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?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\View\Event;
|
||||
|
||||
use TYPO3\CMS\Backend\View\PageLayoutContext;
|
||||
|
||||
/**
|
||||
* Use this Event to identify whether a content element is used.
|
||||
*/
|
||||
final class IsContentUsedOnPageLayoutEvent
|
||||
{
|
||||
public function __construct(
|
||||
private readonly array $record,
|
||||
private bool $used,
|
||||
private readonly PageLayoutContext $context
|
||||
) {}
|
||||
|
||||
public function getRecord(): array
|
||||
{
|
||||
return $this->record;
|
||||
}
|
||||
|
||||
public function isRecordUsed(): bool
|
||||
{
|
||||
return $this->used;
|
||||
}
|
||||
|
||||
public function setUsed(bool $isUsed): void
|
||||
{
|
||||
$this->used = $isUsed;
|
||||
}
|
||||
|
||||
public function getKnownColumnPositionNumbers(): array
|
||||
{
|
||||
return $this->context->getBackendLayout()->getColumnPositionNumbers();
|
||||
}
|
||||
|
||||
public function getPageLayoutContext(): PageLayoutContext
|
||||
{
|
||||
return $this->context;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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\View\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Backend\View\BackendLayout\BackendLayout;
|
||||
|
||||
/**
|
||||
* Event to change backend layout configuration based on colPos and pageUid of records. This is designed
|
||||
* for extensions like ext:container to update allowed & disallowed restrictions if needed.
|
||||
*
|
||||
* @internal TYPO3 core v14 needs to emit *some* event at this point to enable extensions to hook in. However,
|
||||
* this event is dispatched from within BackendLayoutView which is involved in a quite convoluted
|
||||
* system around current backend layout handling. The backend layout handling should in general see
|
||||
* more refactorings to model things more straight forward, and the method dispatching the event is not
|
||||
* called as systematically as it should be and is declared internal as well. As such, this event is
|
||||
* for now declared as "may change, use at your own risk" since it exposes the ugly internal structures
|
||||
* of the backend layout implementation.
|
||||
*/
|
||||
final class ManipulateBackendLayoutColPosConfigurationForPageEvent
|
||||
{
|
||||
public function __construct(
|
||||
public array $configuration,
|
||||
public readonly BackendLayout $backendLayout,
|
||||
public readonly int $colPos,
|
||||
public readonly int $pageUid,
|
||||
public readonly ?ServerRequestInterface $request = null,
|
||||
) {}
|
||||
}
|
||||
@@ -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\Backend\View\Event;
|
||||
|
||||
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
|
||||
|
||||
/**
|
||||
* Use this Event to alter the database query when loading content for a page.
|
||||
*/
|
||||
final class ModifyDatabaseQueryForContentEvent
|
||||
{
|
||||
public function __construct(
|
||||
private QueryBuilder $queryBuilder,
|
||||
private readonly string $table,
|
||||
private readonly int $pageId,
|
||||
) {}
|
||||
|
||||
public function getQueryBuilder(): QueryBuilder
|
||||
{
|
||||
return $this->queryBuilder;
|
||||
}
|
||||
|
||||
public function setQueryBuilder(QueryBuilder $queryBuilder): void
|
||||
{
|
||||
$this->queryBuilder = $queryBuilder;
|
||||
}
|
||||
|
||||
public function getTable(): string
|
||||
{
|
||||
return $this->table;
|
||||
}
|
||||
|
||||
public function getPageId(): int
|
||||
{
|
||||
return $this->pageId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<?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\View\Event;
|
||||
|
||||
use TYPO3\CMS\Backend\RecordList\DatabaseRecordList;
|
||||
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
|
||||
|
||||
/**
|
||||
* Use this Event to alter the database query when loading content for a page (usually in the records module)
|
||||
* before it is executed.
|
||||
* @todo This event should contain the $addSorting value, so listener knows when to add ORDER-BY stuff.
|
||||
*/
|
||||
final class ModifyDatabaseQueryForRecordListingEvent
|
||||
{
|
||||
public function __construct(
|
||||
private QueryBuilder $queryBuilder,
|
||||
private readonly string $table,
|
||||
private readonly int $pageId,
|
||||
private readonly array $fields,
|
||||
private readonly int $firstResult,
|
||||
private readonly int $maxResults,
|
||||
private readonly DatabaseRecordList $recordList
|
||||
) {}
|
||||
|
||||
public function getQueryBuilder(): QueryBuilder
|
||||
{
|
||||
return $this->queryBuilder;
|
||||
}
|
||||
|
||||
public function setQueryBuilder(QueryBuilder $queryBuilder): void
|
||||
{
|
||||
$this->queryBuilder = $queryBuilder;
|
||||
}
|
||||
|
||||
public function getTable(): string
|
||||
{
|
||||
return $this->table;
|
||||
}
|
||||
|
||||
public function getPageId(): int
|
||||
{
|
||||
return $this->pageId;
|
||||
}
|
||||
|
||||
public function getFields(): array
|
||||
{
|
||||
return $this->fields;
|
||||
}
|
||||
|
||||
public function getFirstResult(): int
|
||||
{
|
||||
return $this->firstResult;
|
||||
}
|
||||
|
||||
public function getMaxResults(): int
|
||||
{
|
||||
return $this->maxResults;
|
||||
}
|
||||
|
||||
public function getDatabaseRecordList(): DatabaseRecordList
|
||||
{
|
||||
return $this->recordList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?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\View\Event;
|
||||
|
||||
use Psr\EventDispatcher\StoppableEventInterface;
|
||||
use TYPO3\CMS\Backend\View\PageLayoutContext;
|
||||
use TYPO3\CMS\Core\Domain\RecordInterface;
|
||||
|
||||
/**
|
||||
* Use this Event to have a custom preview for a content type in the Page Module
|
||||
*/
|
||||
final class PageContentPreviewRenderingEvent implements StoppableEventInterface
|
||||
{
|
||||
private ?string $content = null;
|
||||
|
||||
public function __construct(
|
||||
private readonly string $table,
|
||||
private readonly string $recordType,
|
||||
private RecordInterface $record,
|
||||
private readonly PageLayoutContext $context
|
||||
) {}
|
||||
|
||||
public function getTable(): string
|
||||
{
|
||||
return $this->table;
|
||||
}
|
||||
|
||||
public function getRecordType(): string
|
||||
{
|
||||
return $this->recordType;
|
||||
}
|
||||
|
||||
public function getRecord(): RecordInterface
|
||||
{
|
||||
return $this->record;
|
||||
}
|
||||
|
||||
public function setRecord(RecordInterface $record): void
|
||||
{
|
||||
$this->record = $record;
|
||||
}
|
||||
|
||||
public function getPageLayoutContext(): PageLayoutContext
|
||||
{
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
public function getPreviewContent(): ?string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function setPreviewContent(string $content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
public function isPropagationStopped(): bool
|
||||
{
|
||||
return $this->content !== null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user