mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-04 20:36:03 +01:00
Fixes https://github.com/getgrav/grav/issues/476, replace default themes service with admin own theme service to avoid loading the default theme
This commit is contained in:
@@ -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
|
||||
|
||||
18
classes/themes.php
Normal file
18
classes/themes.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace Grav\Plugin;
|
||||
|
||||
/**
|
||||
* Admin theme object
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class Themes extends \Grav\Common\Themes
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
/** @var Themes $themes */
|
||||
$themes = $this->grav['themes'];
|
||||
$themes->configure();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user