Wähle den Kartentext auch an der Programm- und Modulkarte und führe den Filmbild-Regler nach.
CI Feature / test (push) Successful in 1m46s
Deploy Test / test (push) Successful in 1m45s
Deploy Test / deploy (push) Successful in 36s

- Programm- und Modulkarte: „Text der Karte“ (Automatisch wie bisher: Teaser, sonst Kurzbeschreibung, sonst
  Lernziel; Teaser, Kurzbeschreibung, Ausführliche Beschreibung, Lernziel der Fassung). Eine ausdrückliche Wahl
  ersetzt nicht still; die Vorschau nennt, wo der Text zu pflegen ist. Das Vorschaubild des Programms oder Moduls
  lässt sich als Bild-Medium übernehmen (CompositionStill, additive Tabelle composition_still_sources).
- Filmbild im Dialog wie im Medienmanager: Regler und Zahlenfeld zeigen dieselbe Stelle, das Bild folgt dem Regler
  nach kurzer Pause, „Diese Stelle übernehmen“; das Vorschaubild des Films mit kleiner Ansicht daneben.
- Gemeinsame Meldung nach dem tatsächlichen Stand für Film- und Programmbilder.
- Test bewusst angepasst: Die Programmkarte hat jetzt eine Textwahl (vorher nur die Medienkarte).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-21 21:19:43 +01:00
1 parent 604e1791c5
commit 3825f53a9b
16 files changed
+641 -47

No files matched your search

+53 -5
View File
@@ -2,9 +2,11 @@
namespace App\Filament\Support;
use App\Domain\Catalog\Composition;
use App\Domain\Catalog\ContentElement;
use App\Domain\Catalog\DomainRuleException;
use App\Domain\Cms\Widgets\Support\WebsiteImage;
use App\Domain\Media\CompositionStill;
use App\Domain\Media\FilmStill;
use App\Domain\Media\WebsiteMedia;
use App\Filament\Resources\ContentElements\ContentElementResource;
@@ -58,6 +60,38 @@ public function adoptFilmFrame(string $pfad, int $elementId, string $sekunde): v
$this->adoptFilmStill($pfad, $elementId, fn (FilmStill $stills, ContentElement $film): ContentElement => $stills->fromSecond($film, (float) $sekunde, auth('staff')->user()));
}
/**
* Programm- und Modulkarte: das Vorschaubild des Programms oder Moduls als Bild für die Website übernehmen
* (Bild-Medium im Medienmanager, einmal kopiert).
*/
public function adoptCompositionThumbnail(string $pfad, int $compositionId): void
{
abort_unless(ContentElementResource::editor(), 403);
if ($this->imageTargetIsInvalid($pfad)) {
return;
}
$composition = Composition::query()->find($compositionId);
if (! $composition instanceof Composition) {
return;
}
$stills = app(CompositionStill::class);
try {
$still = $stills->fromThumbnail($composition, auth('staff')->user());
} catch (DomainRuleException $exception) {
Notification::make()->danger()->title($exception->getMessage())->send();
return;
}
data_set($this, $pfad, $still->id);
$this->announceAdoptedStill($still, $stills->reused, 'Dieses Vorschaubild war schon übernommen.');
}
/**
* @param callable(FilmStill, ContentElement): ContentElement $make
*/
@@ -65,7 +99,7 @@ private function adoptFilmStill(string $pfad, int $elementId, callable $make): v
{
abort_unless(ContentElementResource::editor(), 403);
if (preg_match('/^(data|mountedActions\.\d+\.data)(\.[A-Za-z0-9_-]+)+\.image$/', $pfad) !== 1) {
if ($this->imageTargetIsInvalid($pfad)) {
return;
}
@@ -86,9 +120,24 @@ private function adoptFilmStill(string $pfad, int $elementId, callable $make): v
}
data_set($this, $pfad, $still->id);
$this->announceAdoptedStill($still, $stills->reused, 'Diese Stelle war schon übernommen.');
}
/** Nur das Bildfeld eines Widgets oder Abschnitts ist ein zulässiges Ziel (…image). */
private function imageTargetIsInvalid(string $pfad): bool
{
return preg_match('/^(data|mountedActions\.\d+\.data)(\.[A-Za-z0-9_-]+)+\.image$/', $pfad) !== 1;
}
/**
* Meldung nach dem tatsächlichen Stand des Bildes: neu angelegt, schon vorhanden und freigegeben, wird verarbeitet
* oder Website-Freigabe zurückgenommen (bleibt zurückgenommen).
*/
private function announceAdoptedStill(ContentElement $still, bool $reused, string $reusedText): void
{
$title = ($still->display_title ?: $still->working_title);
if (! $stills->reused) {
if (! $reused) {
Notification::make()
->success()
->title('Im Medienmanager angelegt: „'.$title.'“')
@@ -98,14 +147,13 @@ private function adoptFilmStill(string $pfad, int $elementId, callable $make): v
return;
}
// Dieselbe Stelle war schon übernommen: Der tatsächliche Stand des Bildes entscheidet über die Meldung.
if (app(WebsiteMedia::class)->present($still) !== null) {
Notification::make()->success()->title('Bereits im Medienmanager: „'.$title.'“')->body('Diese Stelle war schon übernommen. Das Bild ist als Kartenbild ausgewählt.')->send();
Notification::make()->success()->title('Bereits im Medienmanager: „'.$title.'“')->body($reusedText.' Das Bild ist als Kartenbild ausgewählt.')->send();
} elseif (blank($still->thumbnail_path) && blank($still->thumbnail_error)) {
Notification::make()->success()->title('Bereits im Medienmanager: „'.$title.'“')->body('Das Bild wird noch verarbeitet und danach für die Website freigegeben.')->send();
} else {
Notification::make()->warning()->title('Bild ausgewählt, aber nicht für die Website freigegeben: „'.$title.'“')
->body('Diese Stelle war schon übernommen und die Website-Freigabe wurde zurückgenommen. Das Bild erscheint öffentlich erst wieder, wenn sie im Medienmanager (Reiter „Website“) erneut gegeben wird.')
->body($reusedText.' Die Website-Freigabe wurde zurückgenommen. Das Bild erscheint öffentlich erst wieder, wenn sie im Medienmanager (Reiter „Website“) erneut gegeben wird.')
->persistent()
->send();
}