mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-26 15:56:30 +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) {
|
switch ($this->template) {
|
||||||
case 'plugins':
|
case 'plugins':
|
||||||
$twig->twig_vars['plugins'] = \Grav\Common\Plugins::all();
|
$twig->twig_vars['plugins'] = $this->grav['plugins']->all();
|
||||||
break;
|
break;
|
||||||
case 'pages':
|
case 'pages':
|
||||||
$twig->twig_vars['file'] = File\General::instance($this->admin->page(true)->filePath());
|
$twig->twig_vars['file'] = File\General::instance($this->admin->page(true)->filePath());
|
||||||
|
|||||||
@@ -254,12 +254,12 @@ class Admin
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if (preg_match('|plugins/|', $type)) {
|
if (preg_match('|plugins/|', $type)) {
|
||||||
$obj = Plugins::get(preg_replace('|plugins/|', '', $type));
|
$obj = $this->grav['plugins']->get(preg_replace('|plugins/|', '', $type));
|
||||||
$obj->merge($post);
|
$obj->merge($post);
|
||||||
|
|
||||||
$data[$type] = $obj;
|
$data[$type] = $obj;
|
||||||
} elseif (preg_match('|themes/|', $type)) {
|
} elseif (preg_match('|themes/|', $type)) {
|
||||||
$obj = Themes::get(preg_replace('|themes/|', '', $type));
|
$obj = $this->grav['themes']->get(preg_replace('|themes/|', '', $type));
|
||||||
$obj->merge($post);
|
$obj->merge($post);
|
||||||
|
|
||||||
$data[$type] = $obj;
|
$data[$type] = $obj;
|
||||||
|
|||||||
Reference in New Issue
Block a user