Re #27 - Create system.yaml and site.yaml files

This commit is contained in:
Andy Miller
2015-08-08 15:52:34 -06:00
parent 41ecc3ba6f
commit 46c0e1c44b

View File

@@ -304,6 +304,17 @@ class AdminPlugin extends Plugin
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.
$path = trim(substr($this->uri->route(), strlen($this->base)), '/');
$this->template = 'dashboard';