mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-26 07:46:31 +01:00
Fix static call to Plugins and Themes objects
This commit is contained in:
@@ -175,7 +175,7 @@ class AdminPlugin extends Plugin
|
||||
|
||||
switch ($this->template) {
|
||||
case 'plugins':
|
||||
$twig->twig_vars['plugins'] = \Grav\Common\Plugins::all();
|
||||
$twig->twig_vars['plugins'] = $this->grav['plugins']->all();
|
||||
break;
|
||||
case 'pages':
|
||||
$twig->twig_vars['file'] = File\General::instance($this->admin->page(true)->filePath());
|
||||
|
||||
@@ -254,12 +254,12 @@ class Admin
|
||||
|
||||
default:
|
||||
if (preg_match('|plugins/|', $type)) {
|
||||
$obj = Plugins::get(preg_replace('|plugins/|', '', $type));
|
||||
$obj = $this->grav['plugins']->get(preg_replace('|plugins/|', '', $type));
|
||||
$obj->merge($post);
|
||||
|
||||
$data[$type] = $obj;
|
||||
} elseif (preg_match('|themes/|', $type)) {
|
||||
$obj = Themes::get(preg_replace('|themes/|', '', $type));
|
||||
$obj = $this->grav['themes']->get(preg_replace('|themes/|', '', $type));
|
||||
$obj->merge($post);
|
||||
|
||||
$data[$type] = $obj;
|
||||
|
||||
Reference in New Issue
Block a user