mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
pulled base_url out of the theme_url to work with assets manager
This commit is contained in:
@@ -184,7 +184,7 @@ class AdminPlugin extends Plugin
|
|||||||
*/
|
*/
|
||||||
public function onTwigTemplatePaths()
|
public function onTwigTemplatePaths()
|
||||||
{
|
{
|
||||||
$this->theme = $this->config->get('plugins.admin.theme', 'grav');
|
|
||||||
$this->grav['twig']->twig_paths = array(__DIR__ . '/themes/' . $this->theme . '/templates');
|
$this->grav['twig']->twig_paths = array(__DIR__ . '/themes/' . $this->theme . '/templates');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,8 +193,6 @@ class AdminPlugin extends Plugin
|
|||||||
*/
|
*/
|
||||||
public function onTwigSiteVariables()
|
public function onTwigSiteVariables()
|
||||||
{
|
{
|
||||||
// TODO: use real plugin name instead
|
|
||||||
$theme_url = $this->grav['base_url'] . '/user/plugins/admin/themes/' . $this->theme;
|
|
||||||
$twig = $this->grav['twig'];
|
$twig = $this->grav['twig'];
|
||||||
|
|
||||||
// Dynamic type support
|
// Dynamic type support
|
||||||
@@ -207,7 +205,7 @@ class AdminPlugin extends Plugin
|
|||||||
$twig->twig_vars['base_url_relative'] .=
|
$twig->twig_vars['base_url_relative'] .=
|
||||||
($twig->twig_vars['base_url_relative'] != '/' ? '/' : '') . trim($this->config->get('plugins.admin.route'),
|
($twig->twig_vars['base_url_relative'] != '/' ? '/' : '') . trim($this->config->get('plugins.admin.route'),
|
||||||
'/');
|
'/');
|
||||||
$twig->twig_vars['theme_url'] = $theme_url;
|
$twig->twig_vars['theme_url'] = '/user/plugins/admin/themes/' . $this->theme;
|
||||||
$twig->twig_vars['base_url'] = $twig->twig_vars['base_url_relative'];
|
$twig->twig_vars['base_url'] = $twig->twig_vars['base_url_relative'];
|
||||||
$twig->twig_vars['admin'] = $this->admin;
|
$twig->twig_vars['admin'] = $this->admin;
|
||||||
|
|
||||||
@@ -299,5 +297,8 @@ class AdminPlugin extends Plugin
|
|||||||
|
|
||||||
// And store the class into DI container.
|
// And store the class into DI container.
|
||||||
$this->grav['admin'] = $this->admin;
|
$this->grav['admin'] = $this->admin;
|
||||||
|
|
||||||
|
// Get theme for admin
|
||||||
|
$this->theme = $this->config->get('plugins.admin.theme', 'grav');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user