TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -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\Dto\Breadcrumb;
|
||||
|
||||
/**
|
||||
* Represents a single breadcrumb node in the backend document header.
|
||||
*
|
||||
* Breadcrumb nodes are used to build hierarchical navigation trails that help users
|
||||
* understand their current location within the TYPO3 backend and navigate back through
|
||||
* parent items.
|
||||
*
|
||||
* @internal Subject to change until v15 LTS
|
||||
*/
|
||||
final readonly class BreadcrumbNode implements \JsonSerializable
|
||||
{
|
||||
/**
|
||||
* @param string $identifier Unique identifier for this node (e.g., record UID, page ID, storage identifier)
|
||||
* @param string $label Display text shown to the user
|
||||
* @param string|null $icon Icon identifier from the icon registry (e.g., 'actions-page-open', 'apps-pagetree-root')
|
||||
* @param string|null $iconOverlay Overlay icon identifier for additional visual context (e.g., 'overlay-new', 'overlay-hidden')
|
||||
* @param string|null $url Backend URL to navigate to when clicking the node. Null means node is not clickable (typically the current item)
|
||||
* @param bool|null $forceShowIcon Forces icon display even in contexts where icons are normally hidden (e.g., module nodes)
|
||||
*/
|
||||
public function __construct(
|
||||
public string $identifier,
|
||||
public string $label,
|
||||
public ?string $icon = null,
|
||||
public ?string $iconOverlay = null,
|
||||
public ?string $url = null,
|
||||
public ?bool $forceShowIcon = false,
|
||||
) {}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return get_object_vars($this);
|
||||
}
|
||||
}
|
||||
@@ -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\Dto;
|
||||
|
||||
use TYPO3\CMS\Core\Type\Bitmask\Permission;
|
||||
use TYPO3\CMS\Core\Utility\MathUtility;
|
||||
|
||||
/**
|
||||
* All information that is need to edit a single record.
|
||||
*
|
||||
* This is mainly used as DTO within FormEngine / EditDocumentController.
|
||||
*
|
||||
* @internal not part of TYPO3 Core API
|
||||
*/
|
||||
final readonly class FormElementData
|
||||
{
|
||||
public function __construct(
|
||||
/** Is loaded with the "title" of the currently "open document"
|
||||
* used for the open document toolbar */
|
||||
public string $title,
|
||||
public string $table,
|
||||
public int|string $uid,
|
||||
public int $pid,
|
||||
public array $record,
|
||||
public int $viewId,
|
||||
public string $command,
|
||||
private int $userPermissionOnPage,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Determine if delete button can be shown
|
||||
*/
|
||||
public function hasDeleteAccess(): bool
|
||||
{
|
||||
$permission = new Permission($this->userPermissionOnPage);
|
||||
return $permission->get($this->table ? Permission::PAGE_DELETE : Permission::CONTENT_EDIT);
|
||||
}
|
||||
|
||||
/**
|
||||
* True if a record has been saved
|
||||
*/
|
||||
public function isSavedRecord(): bool
|
||||
{
|
||||
return $this->command !== 'new' && $this->table !== '' && MathUtility::canBeInterpretedAsInteger($this->uid);
|
||||
}
|
||||
}
|
||||
@@ -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\Dto\Settings;
|
||||
|
||||
use TYPO3\CMS\Core\Settings\SettingDefinition;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final readonly class EditableSetting implements \JsonSerializable
|
||||
{
|
||||
public function __construct(
|
||||
public SettingDefinition $definition,
|
||||
public string|int|float|bool|array|null $value,
|
||||
public string|int|float|bool|array|null $systemDefault,
|
||||
public string $typeImplementation,
|
||||
) {}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return get_object_vars($this);
|
||||
}
|
||||
|
||||
public function getRenderedValue(): string
|
||||
{
|
||||
if (is_array($this->value)) {
|
||||
return implode(', ', $this->value);
|
||||
}
|
||||
if (is_scalar($this->value)) {
|
||||
return (string)$this->value;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -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\Dto\Tree;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final readonly class FileTreeItem implements \JsonSerializable
|
||||
{
|
||||
public function __construct(
|
||||
public TreeItem $item,
|
||||
public string $pathIdentifier,
|
||||
public int $storage,
|
||||
public string $resourceType,
|
||||
) {}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return [
|
||||
'type' => 'FileTreeItem',
|
||||
...$this->item->jsonSerialize(),
|
||||
'pathIdentifier' => $this->pathIdentifier,
|
||||
'storage' => $this->storage,
|
||||
'resourceType' => $this->resourceType,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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\Dto\Tree\Label;
|
||||
|
||||
final readonly class Label implements \JsonSerializable
|
||||
{
|
||||
public function __construct(
|
||||
public string $label,
|
||||
public string $color = '#ff8700',
|
||||
public int $priority = 0,
|
||||
/** @internal Only to be used by TYPO3 core */
|
||||
public bool $inheritByChildren = true,
|
||||
) {}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return get_object_vars($this);
|
||||
}
|
||||
}
|
||||
@@ -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\Backend\Dto\Tree;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final readonly class PageTreeItem implements \JsonSerializable
|
||||
{
|
||||
public function __construct(
|
||||
public TreeItem $item,
|
||||
public int $doktype,
|
||||
public string $nameSourceField,
|
||||
public int $workspaceId,
|
||||
public bool $locked,
|
||||
public bool $stopPageTree,
|
||||
public int $mountPoint,
|
||||
) {}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return [
|
||||
'type' => 'PageTreeItem',
|
||||
...$this->item->jsonSerialize(),
|
||||
'doktype' => $this->doktype,
|
||||
'nameSourceField' => $this->nameSourceField,
|
||||
'workspaceId' => $this->workspaceId,
|
||||
'locked' => $this->locked,
|
||||
'stopPageTree' => $this->stopPageTree,
|
||||
'mountPoint' => $this->mountPoint,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -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\Backend\Dto\Tree;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final readonly class SelectTreeItem implements \JsonSerializable
|
||||
{
|
||||
public function __construct(
|
||||
public TreeItem $item,
|
||||
public bool $checked,
|
||||
public bool $selectable,
|
||||
) {}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return [
|
||||
'type' => 'SelectTreeItem',
|
||||
...$this->item->jsonSerialize(),
|
||||
'checked' => $this->checked,
|
||||
'selectable' => $this->selectable,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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\Dto\Tree\Status;
|
||||
|
||||
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
|
||||
|
||||
final readonly class StatusInformation implements \JsonSerializable
|
||||
{
|
||||
public function __construct(
|
||||
public string $label,
|
||||
public ContextualFeedbackSeverity $severity = ContextualFeedbackSeverity::INFO,
|
||||
public int $priority = 0,
|
||||
public string $icon = '',
|
||||
public string $overlayIcon = '',
|
||||
) {}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return get_object_vars($this);
|
||||
}
|
||||
}
|
||||
@@ -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\Dto\Tree;
|
||||
|
||||
use TYPO3\CMS\Backend\Dto\Tree\Label\Label;
|
||||
use TYPO3\CMS\Backend\Dto\Tree\Status\StatusInformation;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final readonly class TreeItem implements \JsonSerializable
|
||||
{
|
||||
/**
|
||||
* @param StatusInformation[] $statusInformation
|
||||
* @param Label[] $labels
|
||||
**/
|
||||
public function __construct(
|
||||
public string $identifier,
|
||||
public string $parentIdentifier,
|
||||
public string $recordType,
|
||||
public string $name,
|
||||
public string $prefix,
|
||||
public string $suffix,
|
||||
public string $tooltip,
|
||||
public int $depth,
|
||||
public bool $hasChildren,
|
||||
public bool $loaded,
|
||||
public string $icon,
|
||||
public string $overlayIcon,
|
||||
public string $note = '',
|
||||
public array $statusInformation = [],
|
||||
public array $labels = [],
|
||||
public bool $editable = false,
|
||||
public bool $deletable = false,
|
||||
) {}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return get_object_vars($this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user