mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
Re #27 - Create system.yaml and site.yaml files
This commit is contained in:
11
admin.php
11
admin.php
@@ -304,6 +304,17 @@ class AdminPlugin extends Plugin
|
|||||||
throw new \RuntimeException('One of the required plugins is missing or not enabled');
|
throw new \RuntimeException('One of the required plugins is missing or not enabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Double check we have system.yaml and site.yaml
|
||||||
|
$config_files[] = $this->grav['locator']->findResource('user://config') . '/system.yaml';
|
||||||
|
$config_files[] = $this->grav['locator']->findResource('user://config') . '/site.yaml';
|
||||||
|
foreach ($config_files as $config_file) {
|
||||||
|
if (!file_exists($config_file)) {
|
||||||
|
touch($config_file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Decide admin template and route.
|
// Decide admin template and route.
|
||||||
$path = trim(substr($this->uri->route(), strlen($this->base)), '/');
|
$path = trim(substr($this->uri->route(), strlen($this->base)), '/');
|
||||||
$this->template = 'dashboard';
|
$this->template = 'dashboard';
|
||||||
|
|||||||
Reference in New Issue
Block a user