From 970d77219e4eac80c413045c87dcfaefd61fefb8 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Wed, 25 Nov 2015 18:31:25 +0100 Subject: [PATCH] Fixes https://github.com/getgrav/grav/issues/476, replace default themes service with admin own theme service to avoid loading the default theme --- admin.php | 6 ++++++ classes/themes.php | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 classes/themes.php diff --git a/admin.php b/admin.php index a1128e07..adc4030f 100644 --- a/admin.php +++ b/admin.php @@ -111,6 +111,12 @@ class AdminPlugin extends Plugin // Disable Asset pipelining $this->config->set('system.assets.css_pipeline', false); $this->config->set('system.assets.js_pipeline', false); + + // Replace themes service with admin. + $this->grav['themes'] = function ($c) { + require_once __DIR__ . '/classes/themes.php'; + return new Themes($this->grav); + }; } // We need popularity no matter what diff --git a/classes/themes.php b/classes/themes.php new file mode 100644 index 00000000..7c321b8f --- /dev/null +++ b/classes/themes.php @@ -0,0 +1,18 @@ +grav['themes']; + $themes->configure(); + } +}