Baue den Aufbauarbeitsplatz nach dem kombinierten Entwurf um.
Struktur links mit Position, Ziehgriff, aufklappbarem Quelleninhalt und Auf/Ab für die ausgewählte Verwendung; rechts der Detailbereich mit „An dieser Stelle“ (Rolle, Hinweis, Fassung), „Quelle“ und „Inhaltsvorschau“. Didaktik und Katalogbild sowie Fassungen und Verwendung sind eigene Bereiche statt Dialog und Seitenspalte. Freigabe- und Textdialog nutzen den gemeinsamen Dialog. Entfernt verdeckte Speicherungen: Hinzufügen eines Bestandteils speichert den Entwurf nicht mehr nebenbei (Ausnahme: ausdrückliches „Zurück und einbinden“), der Textwortlaut wird an der Quelle gespeichert, ohne den Aufbau mitzuspeichern. Der Mediendialog „Angaben und Vorschaubild“ war ein zweiter Editor für Medientexte und weicht „Quelle bearbeiten“. Vorhandene Bilder als Katalogbild kommen über den gemeinsamen Picker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
156cdd6976
commit
7eb3cd6230
11 files changed
+840
-743
No files matched your search
@@ -121,28 +121,21 @@ abstract class EditComposition extends EditRecord
|
||||
|
||||
public ?string $thumbnailError = null;
|
||||
|
||||
public string $imageQuery = '';
|
||||
/** Bereich des Aufbauarbeitsplatzes: aufbau, angaben oder verlauf. */
|
||||
public string $aufbauTab = 'aufbau';
|
||||
|
||||
public bool $moduleOpen = false;
|
||||
/** Ansicht der ausgewählten Verwendung: stelle, quelle oder vorschau. */
|
||||
public string $detailTab = 'stelle';
|
||||
|
||||
public string $moduleTab = 'didaktik';
|
||||
|
||||
public bool $partOpen = false;
|
||||
/** @var list<int> aufgeklappte Bestandteile mit Quelleninhalt */
|
||||
public array $expanded = [];
|
||||
|
||||
public string $imageMode = 'film';
|
||||
|
||||
public string $imagePick = '';
|
||||
|
||||
public ?int $frameVersionId = null;
|
||||
|
||||
public string $frameSecond = '';
|
||||
|
||||
/** @var array<string, mixed> */
|
||||
public array $moduleSnapshot = [];
|
||||
|
||||
/** @var list<array<string, mixed>> */
|
||||
public array $partSnapshot = [];
|
||||
|
||||
/** @var list<array<string, string|null>> */
|
||||
public array $members = [];
|
||||
|
||||
@@ -154,11 +147,14 @@ public function mount(int|string $record): void
|
||||
parent::mount($record);
|
||||
|
||||
$this->loadEditor();
|
||||
$this->selectFirstPart();
|
||||
$this->returnUrl = $this->safeReturn(request()->query('zurueck'));
|
||||
$adopt = request()->query('uebernehmen');
|
||||
|
||||
if (is_string($adopt)) {
|
||||
$this->addPart($adopt);
|
||||
// Ausdrücklich gewählte Rückkehr „Zurück und einbinden“: frisch geladen, daher keine anderen offenen Eingaben.
|
||||
if (is_string($adopt) && $this->includePart($adopt, true) && $this->persistDraft()) {
|
||||
$title = (string) ($this->members[array_key_last($this->members)]['title'] ?? 'Der Bestandteil');
|
||||
$this->feedback = $title.' ist in den Aufbau übernommen. Der Entwurf ist gespeichert; es entsteht keine neue Fassung.';
|
||||
}
|
||||
|
||||
$flashed = session('redaktion');
|
||||
@@ -307,14 +303,7 @@ public function hits(): array
|
||||
|
||||
public function openPicker(): void
|
||||
{
|
||||
if ($this->moduleOpen) {
|
||||
$this->closeModule();
|
||||
}
|
||||
|
||||
if ($this->partOpen) {
|
||||
$this->closePart();
|
||||
}
|
||||
|
||||
$this->commitRoleDraft();
|
||||
$this->textOpen = false;
|
||||
$this->resetPicker('aufbau');
|
||||
$this->pickerKind = 'alle';
|
||||
@@ -325,8 +314,7 @@ public function openPicker(): void
|
||||
*/
|
||||
protected function redaktionWillOpen(): void
|
||||
{
|
||||
$this->moduleOpen = false;
|
||||
$this->partOpen = false;
|
||||
$this->commitRoleDraft();
|
||||
$this->textOpen = false;
|
||||
$this->releaseArmed = false;
|
||||
}
|
||||
@@ -485,8 +473,6 @@ public function openText(): void
|
||||
{
|
||||
$this->feedback = '';
|
||||
$this->pickerOpen = false;
|
||||
$this->moduleOpen = false;
|
||||
$this->partOpen = false;
|
||||
$this->textOpen = true;
|
||||
}
|
||||
|
||||
@@ -579,6 +565,14 @@ public function releaseFollowUp(): string
|
||||
return $library.$draft;
|
||||
}
|
||||
|
||||
protected function selectFirstPart(): void
|
||||
{
|
||||
if ($this->members !== [] && ($this->selected === null || ! isset($this->members[$this->selected]))) {
|
||||
$this->selected = 0;
|
||||
$this->syncRoleDraft();
|
||||
}
|
||||
}
|
||||
|
||||
public function discardDraft(): void
|
||||
{
|
||||
/** @var Composition $record */
|
||||
@@ -586,6 +580,8 @@ public function discardDraft(): void
|
||||
app(EditorialWorkingDraft::class)->clear($record);
|
||||
$this->releaseArmed = false;
|
||||
$this->loadAufbau();
|
||||
$this->selected = null;
|
||||
$this->selectFirstPart();
|
||||
$this->feedback = 'Der Entwurf ist verworfen. Eine freigegebene Fassung bleibt unverändert. Offene Eingaben der Redaktion bleiben erhalten.';
|
||||
}
|
||||
|
||||
@@ -811,9 +807,105 @@ public function selectPart(int $index): void
|
||||
$this->commitRoleDraft();
|
||||
$this->selected = $index;
|
||||
$this->panel = 'bestandteil';
|
||||
$this->aufbauTab = 'aufbau';
|
||||
$this->syncRoleDraft();
|
||||
}
|
||||
|
||||
/**
|
||||
* Früherer Einstieg „Bestandteil bearbeiten“: wählt die Verwendung im Detailbereich.
|
||||
*/
|
||||
public function openPart(int $index): void
|
||||
{
|
||||
$this->selectPart($index);
|
||||
$this->detailTab = 'stelle';
|
||||
}
|
||||
|
||||
public function toggleExpanded(int $index): void
|
||||
{
|
||||
$this->expanded = in_array($index, $this->expanded, true)
|
||||
? array_values(array_diff($this->expanded, [$index]))
|
||||
: [...$this->expanded, $index];
|
||||
}
|
||||
|
||||
public function showAufbauTab(string $tab): void
|
||||
{
|
||||
$this->commitRoleDraft();
|
||||
|
||||
if (in_array($tab, ['aufbau', 'angaben', 'verlauf'], true)) {
|
||||
$this->aufbauTab = $tab;
|
||||
}
|
||||
}
|
||||
|
||||
public function updatedNoteDraft(): void
|
||||
{
|
||||
$this->commitRoleDraft();
|
||||
}
|
||||
|
||||
public function updatedMembers(): void
|
||||
{
|
||||
$this->syncRoleDraft();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inhalt der referenzierten Komposition zur Ansicht (eine Ebene).
|
||||
*
|
||||
* @return list<array{title: string, kind: string, image: ?string, tone: string, role: string}>
|
||||
*/
|
||||
public function childrenRows(string $target): array
|
||||
{
|
||||
$catalog = app(EditorialCatalog::class);
|
||||
$exceptId = (int) $this->getRecord()->getKey();
|
||||
$rows = [];
|
||||
|
||||
if (preg_match('/^composition-draft:(\d+)$/', $target, $match) === 1) {
|
||||
$composition = Composition::query()->find($match[1]);
|
||||
$draft = $composition instanceof Composition && is_array($composition->working_draft) ? $composition->working_draft : [];
|
||||
|
||||
foreach ($draft['members'] ?? [] as $member) {
|
||||
if (! is_array($member)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$row = $catalog->rowForTarget((string) ($member['target'] ?? ''), $exceptId, allowSelf: true, allowDraft: true, allowBlocked: true);
|
||||
$rows[] = [
|
||||
'title' => (string) ($row['title'] ?? 'Bestandteil'),
|
||||
'kind' => (string) ($row['kind'] ?? ''),
|
||||
'image' => $row['image'] ?? null,
|
||||
'tone' => (string) ($row['tone'] ?? 'text'),
|
||||
'role' => trim((string) ($member['role'] ?? '')),
|
||||
];
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
if (preg_match('/^composition:(\d+)$/', $target, $match) !== 1) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$version = CompositionVersion::query()->find($match[1]);
|
||||
|
||||
if (! $version instanceof CompositionVersion) {
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach (app(CompositionStructureReader::class)->tree($version) as $node) {
|
||||
$childTarget = $node->contentElementVersionId !== null
|
||||
? 'element:'.$node->contentElementVersionId
|
||||
: ($node->compositionVersionId !== null ? 'composition:'.$node->compositionVersionId : '');
|
||||
$row = $childTarget !== '' ? $catalog->rowForTarget($childTarget, $exceptId, allowSelf: true, allowDraft: true, allowBlocked: true) : null;
|
||||
$rows[] = [
|
||||
'title' => $node->title,
|
||||
'kind' => (string) ($row['kind'] ?? $node->editorialKindLabel ?? $node->technicalKindLabel ?? ''),
|
||||
'image' => $row['image'] ?? null,
|
||||
'tone' => (string) ($row['tone'] ?? 'text'),
|
||||
'role' => $node->role,
|
||||
];
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public function addPart(string $target): void
|
||||
{
|
||||
$this->includePart($target, true);
|
||||
@@ -855,12 +947,8 @@ private function includePart(string $target, bool $allowDraft): bool
|
||||
$this->search = '';
|
||||
$this->pickerOpen = false;
|
||||
$this->pickerSelected = '';
|
||||
|
||||
if (! $this->persistDraft()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->feedback = $row['title'].' ist in den Aufbau übernommen. Die Datei wird nicht kopiert. Der Entwurf ist gespeichert. Es entsteht keine neue Fassung.';
|
||||
$this->detailTab = 'stelle';
|
||||
$this->feedback = $row['title'].' steht jetzt an Stelle '.count($this->members).' im Aufbau. Es wird nur verwiesen, nichts kopiert. Gespeichert wird mit „Entwurf speichern“.';
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -871,15 +959,41 @@ public function removePart(int $index): void
|
||||
return;
|
||||
}
|
||||
|
||||
$title = (string) ($this->members[$index]['title'] ?? 'Der Bestandteil');
|
||||
unset($this->members[$index]);
|
||||
$this->members = array_values($this->members);
|
||||
$this->selected = null;
|
||||
$this->roleDraft = '';
|
||||
$this->noteDraft = '';
|
||||
$this->panel = 'angaben';
|
||||
$this->partOpen = false;
|
||||
$this->partSnapshot = [];
|
||||
$this->feedback = 'Der Bestandteil ist aus dem Arbeitsstand genommen. Entwurf speichern hält das fest. Eine freigegebene Fassung bleibt unverändert.';
|
||||
$this->expanded = [];
|
||||
$this->selected = $this->members === [] ? null : min($index, count($this->members) - 1);
|
||||
$this->syncRoleDraft();
|
||||
$this->feedback = '„'.$title.'“ ist aus diesem Aufbau genommen. Das Quellobjekt bleibt im Bestand. Gespeichert ist das erst mit „Entwurf speichern“; eine freigegebene Fassung bleibt unverändert.';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{aktion: string, argument: int|string|null, titel: string, text: string, label: string, gefahr: bool}|null
|
||||
*/
|
||||
protected function extraConfirmation(string $aktion, int|string|null $argument): ?array
|
||||
{
|
||||
if ($aktion !== 'removePart' || ! isset($this->members[(int) $argument])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$title = (string) ($this->members[(int) $argument]['title'] ?? 'Bestandteil');
|
||||
|
||||
return [
|
||||
'aktion' => $aktion,
|
||||
'argument' => (int) $argument,
|
||||
'titel' => '„'.$title.'“ aus diesem Aufbau entfernen?',
|
||||
'text' => 'Nur diese Verwendung wird entfernt. Das Medium oder Modul bleibt im Bestand und in anderen Aufbauten. Gespeichert wird das mit „Entwurf speichern“.',
|
||||
'label' => 'Aus dem Aufbau entfernen',
|
||||
'gefahr' => true,
|
||||
];
|
||||
}
|
||||
|
||||
protected function runExtraConfirmation(string $aktion, int|string|null $argument): void
|
||||
{
|
||||
if ($aktion === 'removePart') {
|
||||
$this->removePart((int) $argument);
|
||||
}
|
||||
}
|
||||
|
||||
public function movePart(int $index, int $direction): void
|
||||
@@ -980,7 +1094,6 @@ public function startCreateMedium(): void
|
||||
private function revealMediumForm(): void
|
||||
{
|
||||
$this->pickerOpen = false;
|
||||
$this->partOpen = false;
|
||||
$this->textOpen = false;
|
||||
}
|
||||
|
||||
@@ -1013,46 +1126,6 @@ public function createMediumAction(): Action
|
||||
});
|
||||
}
|
||||
|
||||
public function editMediumAction(): Action
|
||||
{
|
||||
return Action::make('editMedium')
|
||||
->modalHeading('Medium bearbeiten')
|
||||
->modalDescription('Titel, Beschreibung, Hinweise und Vorschaubild gelten für das Medium. Eine neue Fassung entsteht nur, wenn der Text bereits freigegeben und verwendet wird.')
|
||||
->modalSubmitActionLabel('Speichern')
|
||||
->modalWidth(Width::Large)
|
||||
->beforeFormFilled(fn () => $this->revealMediumForm())
|
||||
->fillForm(function (array $arguments): array {
|
||||
$element = ContentElement::query()->find($arguments['element'] ?? 0);
|
||||
|
||||
return $element instanceof ContentElement ? MediumForm::fill($element) : [];
|
||||
})
|
||||
->schema(function (array $arguments): array {
|
||||
$element = ContentElement::query()->find($arguments['element'] ?? 0);
|
||||
|
||||
return MediumForm::fields(creating: false, element: $element instanceof ContentElement ? $element : null);
|
||||
})
|
||||
->action(function (array $data, array $arguments): void {
|
||||
$element = ContentElement::query()->find($arguments['element'] ?? 0);
|
||||
|
||||
if (! $element instanceof ContentElement) {
|
||||
Notification::make()->title('Dieses Medium ist nicht mehr vorhanden.')->danger()->send();
|
||||
|
||||
throw new Halt;
|
||||
}
|
||||
|
||||
try {
|
||||
$revised = MediumForm::update($element, $data);
|
||||
} catch (DomainRuleException $exception) {
|
||||
Notification::make()->title($exception->getMessage())->danger()->send();
|
||||
|
||||
throw new Halt;
|
||||
}
|
||||
|
||||
$this->retargetContainedElement($element, $revised);
|
||||
$this->feedback = 'Die Angaben des Mediums sind gespeichert.';
|
||||
});
|
||||
}
|
||||
|
||||
public function startModule(): void
|
||||
{
|
||||
$name = trim($this->newModuleName);
|
||||
@@ -1078,57 +1151,46 @@ public function saveDisplay(): void
|
||||
$this->feedback = 'Die Anzeige ist gespeichert. Die Fassung bleibt unverändert.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Früherer Dialog „Didaktik und Katalogbild“: öffnet den Bereich „Angaben“.
|
||||
*/
|
||||
public function openModule(): void
|
||||
{
|
||||
$this->moduleSnapshot = [
|
||||
'learningGoal' => $this->learningGoal,
|
||||
'durationMinutes' => $this->durationMinutes,
|
||||
'materialNote' => $this->materialNote,
|
||||
'revisionNote' => $this->revisionNote,
|
||||
'thumbnailAlt' => $this->thumbnailAlt,
|
||||
'imageMode' => $this->imageMode,
|
||||
'imagePick' => $this->imagePick,
|
||||
'frameVersionId' => $this->frameVersionId,
|
||||
'frameSecond' => $this->frameSecond,
|
||||
];
|
||||
$this->pickerOpen = false;
|
||||
$this->partOpen = false;
|
||||
$this->textOpen = false;
|
||||
$this->feedback = '';
|
||||
$this->moduleTab = in_array($this->moduleTab, ['didaktik', 'titelbild'], true) ? $this->moduleTab : 'didaktik';
|
||||
$this->commitRoleDraft();
|
||||
$this->aufbauTab = 'angaben';
|
||||
$this->frameFilmChoices = $this->frameFilms();
|
||||
$films = $this->frameFilmChoices;
|
||||
$this->imageMode = $films === [] ? 'bestand' : 'film';
|
||||
|
||||
if ($films !== [] && $this->frameVersionId === null) {
|
||||
$this->frameVersionId = $films[0]['version_id'];
|
||||
if ($this->frameFilmChoices !== [] && $this->frameVersionId === null) {
|
||||
$this->frameVersionId = $this->frameFilmChoices[0]['version_id'];
|
||||
}
|
||||
|
||||
$this->moduleOpen = true;
|
||||
if ($this->frameFilmChoices === [] && $this->imageMode === 'film') {
|
||||
$this->imageMode = 'upload';
|
||||
}
|
||||
}
|
||||
|
||||
public function closeModule(): void
|
||||
public function openCatalogImagePicker(): void
|
||||
{
|
||||
foreach ($this->moduleSnapshot as $key => $value) {
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
$this->guardEditorial();
|
||||
$this->resetPicker('vorschaubild');
|
||||
$this->pickerKind = 'bild';
|
||||
}
|
||||
|
||||
$this->moduleOpen = false;
|
||||
$this->moduleSnapshot = [];
|
||||
$this->previewUpload = null;
|
||||
protected function adoptThumbnailFromPicker(string $target): void
|
||||
{
|
||||
$elementId = $this->elementIdOf($target);
|
||||
|
||||
if ($elementId !== null) {
|
||||
$this->adoptPicture($elementId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Übernimmt Didaktik und Katalogbild. Texte, Name und Einordnung gehören zur Redaktion und werden hier nicht gespeichert.
|
||||
* Übernimmt Alternativtext und gewähltes Katalogbild (Filmstelle oder Upload) sofort.
|
||||
* Didaktik und Aufbau speichert „Entwurf speichern“; Texte und Einordnung die Redaktion.
|
||||
*/
|
||||
public function saveModule(): void
|
||||
public function saveCatalogImage(): void
|
||||
{
|
||||
if ($this->minutes($this->durationMinutes) === false) {
|
||||
$this->feedback = 'Der Zeitbedarf ist eine Zahl von Minuten oder bleibt leer.';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var Composition $record */
|
||||
$record = $this->getRecord();
|
||||
app(IdentityProfile::class)->fill($record, ['thumbnail_alt' => trim($this->thumbnailAlt)], $this->actor());
|
||||
@@ -1139,66 +1201,29 @@ public function saveModule(): void
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->needsRevision() || app(EditorialWorkingDraft::class)->read($record) !== null) {
|
||||
$this->persistDraft();
|
||||
}
|
||||
|
||||
$this->moduleOpen = false;
|
||||
$this->moduleSnapshot = [];
|
||||
$this->previewUpload = null;
|
||||
$this->imagePick = '';
|
||||
$this->feedback = trim('Didaktik und Katalogbild sind übernommen. Es entsteht keine neue Fassung.'.($image === '' ? '' : ' '.$image));
|
||||
$this->feedback = trim('Das Katalogbild ist übernommen. Es entsteht keine neue Fassung.'.($image === '' ? '' : ' '.$image));
|
||||
}
|
||||
|
||||
public function openPart(int $index): void
|
||||
/**
|
||||
* Speichert den Wortlaut eines Textbausteins an seiner Quelle. Wird die Fassung schon verwendet, entsteht eine neue
|
||||
* Fassung; der Aufbau verweist dann im Arbeitsstand darauf und speichert das mit „Entwurf speichern“.
|
||||
*/
|
||||
public function saveSourceText(): void
|
||||
{
|
||||
$this->selectPart($index);
|
||||
$member = $this->selectedMember();
|
||||
$this->partTitle = (string) ($member['title'] ?? '');
|
||||
$this->partBody = (string) ($member['body'] ?? '');
|
||||
$this->partSnapshot = $this->members;
|
||||
$this->feedback = '';
|
||||
$this->moduleOpen = false;
|
||||
$this->pickerOpen = false;
|
||||
$this->textOpen = false;
|
||||
$this->partOpen = true;
|
||||
}
|
||||
|
||||
public function closePart(): void
|
||||
{
|
||||
if ($this->partSnapshot !== []) {
|
||||
$this->members = $this->partSnapshot;
|
||||
}
|
||||
|
||||
$this->partOpen = false;
|
||||
$this->partSnapshot = [];
|
||||
$this->syncRoleDraft();
|
||||
}
|
||||
|
||||
public function savePart(): void
|
||||
{
|
||||
if (trim($this->roleDraft) === '') {
|
||||
$this->feedback = 'Die Rolle fehlt.';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->commitRoleDraft();
|
||||
$textNote = $this->writePartText();
|
||||
$note = $this->writePartText();
|
||||
|
||||
if ($note === false || $note === '') {
|
||||
if ($note === '') {
|
||||
$this->feedback = 'Der Text ist unverändert.';
|
||||
}
|
||||
|
||||
if ($textNote === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (! $this->persistDraft()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->partOpen = false;
|
||||
$this->partSnapshot = [];
|
||||
$this->feedback = $textNote !== ''
|
||||
? $textNote
|
||||
: 'Die Angaben zum Bestandteil sind im Entwurf. Es entsteht keine neue Fassung.';
|
||||
$this->syncRoleDraft();
|
||||
$this->feedback = $note.' Die Zuordnung im Aufbau speichert „Entwurf speichern“.';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1348,37 +1373,6 @@ public function adoptPicture(int $elementId): void
|
||||
$this->feedback = $this->previewFeedback($record, $before);
|
||||
}
|
||||
|
||||
private function retargetContainedElement(ContentElement $element, ?ContentElementVersion $revised): void
|
||||
{
|
||||
$element->refresh();
|
||||
|
||||
foreach ($this->members as $index => $member) {
|
||||
if ((int) ($member['element_id'] ?? 0) !== $element->id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$target = $revised instanceof ContentElementVersion
|
||||
? 'element:'.$revised->id
|
||||
: (string) ($member['target'] ?? '');
|
||||
$row = app(EditorialCatalog::class)->rowForTarget(
|
||||
$target,
|
||||
(int) $this->getRecord()->getKey(),
|
||||
allowSelf: true,
|
||||
allowDraft: true,
|
||||
);
|
||||
|
||||
if ($row === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$row['role'] = (string) ($member['role'] ?? $row['kind']);
|
||||
$row['note'] = (string) ($member['note'] ?? '');
|
||||
$this->members[$index] = $row;
|
||||
}
|
||||
|
||||
$this->persistDraft();
|
||||
}
|
||||
|
||||
private function writePartText(): string|false
|
||||
{
|
||||
$index = $this->selected;
|
||||
@@ -1509,14 +1503,6 @@ public function suggestedFilm(): ?array
|
||||
return count($films) === 1 ? $films[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{id: int, title: string, image: string, kind: string}>
|
||||
*/
|
||||
public function mediaChoices(): array
|
||||
{
|
||||
return app(EditorialCatalog::class)->mediaPictures($this->imageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{label: string, tone: string}>
|
||||
*/
|
||||
@@ -1785,6 +1771,8 @@ protected function syncRoleDraft(): void
|
||||
$member = $this->selected !== null ? ($this->members[$this->selected] ?? null) : null;
|
||||
$this->roleDraft = is_array($member) ? (string) ($member['role'] ?? '') : '';
|
||||
$this->noteDraft = is_array($member) ? (string) ($member['note'] ?? '') : '';
|
||||
$this->partTitle = is_array($member) ? (string) ($member['title'] ?? '') : '';
|
||||
$this->partBody = is_array($member) ? (string) ($member['body'] ?? '') : '';
|
||||
}
|
||||
|
||||
public function releaseDisplay(): void
|
||||
@@ -1977,12 +1965,6 @@ protected function applyChosenImage(): string|false
|
||||
return str_contains($this->feedback, 'unverändert') ? $this->feedback : false;
|
||||
}
|
||||
|
||||
if ($this->imageMode === 'bestand' && ctype_digit($this->imagePick)) {
|
||||
$this->adoptPicture((int) $this->imagePick);
|
||||
|
||||
return str_contains($this->feedback, 'unverändert') ? $this->feedback : false;
|
||||
}
|
||||
|
||||
if ($this->imageMode === 'film' && $this->frameVersionId !== null && trim($this->frameSecond) !== '') {
|
||||
if (! is_numeric($this->frameSecond) || (float) $this->frameSecond < 0 || (float) $this->frameSecond > 7200) {
|
||||
$this->feedback = 'Die Zeitposition muss eine Zahl in Sekunden sein.';
|
||||
@@ -2068,12 +2050,9 @@ protected function statusSentence(): string
|
||||
*/
|
||||
protected function payload(): array
|
||||
{
|
||||
// Rolle und Hinweis stehen bereits in $members (commitRoleDraft bei jeder Änderung und vor jedem Speichern).
|
||||
$members = $this->members;
|
||||
|
||||
if ($this->selected !== null && isset($members[$this->selected]) && trim($this->roleDraft) !== '') {
|
||||
$members[$this->selected]['role'] = trim($this->roleDraft);
|
||||
}
|
||||
|
||||
$minutes = $this->minutes($this->durationMinutes);
|
||||
|
||||
return [
|
||||
|
||||
Reference in new issue
Block a user