From 37362c250c2cd7d24cf2795715775b2ed92e256a Mon Sep 17 00:00:00 2001 From: Alexander Walther Date: Sun, 18 Aug 2024 23:57:15 +0200 Subject: [PATCH] Add preview mode --- lang/de_de.lang | 2 ++ package.yml | 4 ++++ pages/frontend.php | 10 ++++++++++ pages/preview.php | 7 +++++++ 4 files changed, 23 insertions(+) create mode 100644 pages/preview.php diff --git a/lang/de_de.lang b/lang/de_de.lang index 1725171..94a1348 100644 --- a/lang/de_de.lang +++ b/lang/de_de.lang @@ -86,3 +86,5 @@ maintenance_allowed_yrewrite_domains_label = Liste erlaubter YRewrite-Domains maintenance_allowed_yrewrite_domains_notice = YRewrite-Domains eintragen, die nicht gesperrt werden sollen. maintenance_copy_url_title = URL kopieren + +maintenance_preview_title = Vorschau diff --git a/package.yml b/package.yml index d21831b..9ed82f3 100644 --- a/package.yml +++ b/package.yml @@ -17,6 +17,10 @@ page: backend: title: translate:maintenance_backend_title icon: rex-icon fa-user-gear + preview: + title: translate:maintenance_preview_title + icon: rex-icon fa-eye + hidden: true help: title: translate:maintenance_docs_title subPath: README.md diff --git a/pages/frontend.php b/pages/frontend.php index dbb4026..a517115 100644 --- a/pages/frontend.php +++ b/pages/frontend.php @@ -136,7 +136,16 @@ ' . rex_i18n::msg('maintenance_preview') . ''; +$fragment = new rex_fragment(); +$fragment->setVar('class', 'info', false); +$fragment->setVar('title', rex_i18n::msg('maintenance_preview_title'), false); +$fragment->setVar('body', $preview, false); +echo $fragment->parse('core/page/section.php'); + +/* Kopieren der URL für den Wartungsmodus */ $copy = '