Vorlesen und Leichte Sprache mit KI-Vorschlag (0.34.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 9m24s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 9m15s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 9m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 9m21s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 10m33s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m5s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m10s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m8s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 48s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m23s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-27 13:24:56 +00:00
parent fc2505297b
commit 856a5c30af
210 changed files with 1447 additions and 521 deletions

View file

@ -2,6 +2,7 @@
namespace Inhaus\Plugins\News\Http\Controllers;
use App\Accessibility\EasyLanguage;
use App\Http\Controllers\Controller;
use App\Models\User;
use App\Pagebuilder\Content;
@ -79,6 +80,7 @@ class NewsController extends Controller
] : null,
],
'editUrl' => $canEdit ? route('news.editor.edit', $post) : null,
'easy' => app(EasyLanguage::class)->props('news', $post->id, $user, $canEdit),
// Reichweite und wer ein Herz gegeben hat: nur für die Redaktion der Kategorie
'reach' => $canEdit ? [
...app(Reach::class)->stats($post),

View file

@ -2,6 +2,7 @@
namespace Inhaus\Plugins\News;
use App\Accessibility\EasyLanguage;
use App\Dashboard\Widgets;
use App\Editorial\Editorial;
use App\Media\ImagePaths;
@ -9,6 +10,7 @@ use App\Media\MediaUsages;
use App\Models\User;
use App\Pagebuilder\Blocks;
use App\Pagebuilder\BlockType;
use App\Pagebuilder\Content;
use App\Pagebuilder\Field;
use App\Plugins\Plugin;
use App\Profile\ProfilePanels;
@ -31,6 +33,19 @@ class NewsPlugin extends Plugin
{
public function register(): void
{
// Leichte Sprache als zweite Fassung von Beiträgen
$this->app->make(EasyLanguage::class)->register('news', function (int $id, User $user) {
$post = NewsPost::query()->find($id);
return $post ? [
'can_view' => $post->isPublished() && $post->isVisibleTo($user),
'can_edit' => $user->can('update', $post),
'title' => $post->title,
'text' => fn () => trim($post->teaser."\n\n".app(Content::class)->plainText($post->blocks(), publicOnly: true)),
] : null;
});
NewsPost::deleted(fn (NewsPost $post) => app(EasyLanguage::class)->forget('news', $post->id));
$this->app->make(GlobalSearch::class)->add('news', 'Neuigkeiten', 'newspaper', fn (...$args) => app(NewsSearch::class)(...$args), sort: 10);
$this->app->make(Navigation::class)->add('news', 'Neuigkeiten', '/neuigkeiten', active: ['news.index', 'news.show'], sort: 20);