From b26adb1adafe9fd7e67b98e394561247ed40e91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=B6ritz?= Date: Mon, 8 Jul 2024 18:04:03 +0200 Subject: [PATCH] =?UTF-8?q?kirby=20docs=20are=20wrong=20=F0=9F=91=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/DreamForm.php | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/classes/DreamForm.php b/classes/DreamForm.php index 75875f7..f4db823 100644 --- a/classes/DreamForm.php +++ b/classes/DreamForm.php @@ -190,30 +190,18 @@ public static function install(): void } $isUuid = Str::startsWith($page, "page://"); - $content = [ - 'content' => [ - 'uuid' => $isUuid ? Str::after($page, "page://") : 'forms', - ] - ]; - - if ($kirby->multilang()) { - $content = [ - 'translations' => [ - $kirby->languages()->default()->code() => array_merge( - $content, - [ - 'code' => $kirby->languages()->default()->code() - ] - ) - ] - ]; - } // create the page - $kirby->impersonate('kirby', fn () => $kirby->site()->createChild(array_merge([ - 'slug' => $isUuid ? "forms" : $page, - 'template' => 'forms', - ], $content))); + $kirby->impersonate( + 'kirby', + fn () => $kirby->site()->createChild([ + 'slug' => $isUuid ? "forms" : $page, + 'template' => 'forms', + 'content' => [ + 'uuid' => $isUuid ? Str::after($page, "page://") : 'forms', + ] + ])->changeStatus('unlisted') + ); } /**