From 578f27d35efcacc7c93df42db63eaa4402f1ac3b Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 29 Jan 2020 21:46:41 +0200 Subject: [PATCH] Added message to dashboard to install Flex Objects plugin if it is missing --- CHANGELOG.md | 1 + themes/grav/templates/dashboard.html.twig | 3 +++ .../templates/partials/dashboard-problems.html.twig | 12 ++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 themes/grav/templates/partials/dashboard-problems.html.twig diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f38ac45..bb9dfcc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## mm/dd/2020 1. [](#new) + * Added message to dashboard to install Flex Objects plugin if it is missing * Updated `permissions` field to use new `$grav['permissions']` * DEPRECATED `onAdminRegisterPermissions` event, use `PermissionsRegisterEvent::class` event instead * DEPRECATED `Admin::setPermissions()` and `Admin::addPermissions()`, use `PermissionsRegisterEvent::class` event instead diff --git a/themes/grav/templates/dashboard.html.twig b/themes/grav/templates/dashboard.html.twig index d9990f49..4ebfde3f 100644 --- a/themes/grav/templates/dashboard.html.twig +++ b/themes/grav/templates/dashboard.html.twig @@ -34,6 +34,9 @@
{% endif %} + {# System notifications, cannot be turned off #} + {% include 'partials/dashboard-problems.html.twig' %} +
{% if grav.twig.plugins_hooked_dashboard_widgets_top %} {% for widget in grav.twig.plugins_hooked_dashboard_widgets_top %} diff --git a/themes/grav/templates/partials/dashboard-problems.html.twig b/themes/grav/templates/partials/dashboard-problems.html.twig new file mode 100644 index 00000000..cd5d712d --- /dev/null +++ b/themes/grav/templates/partials/dashboard-problems.html.twig @@ -0,0 +1,12 @@ +{% if authorize(['admin.plugins', 'admin.super']) and grav['flex_objects'] is null %} +
+
+

Admin plugin dependency is missing

+ +

Admin requires Flex Objects plugin for managing User Accounts and Pages. Without the Flex Objects plugin Admin falls back to the old behavior, which is missing a lot of new features.

+

After installing Flex Objects plugin, this message will disappear. If you still prefer using the old way, it is still possible by entering the Flex Objects plugin settings and disabling those Directories which you do not want to be using.

+

Please install and enable Flex Objects plugin.

+
+
+ +{% endif %}