From 30246a8666bf533cf5e4a8cd69fd41d6f4d22030 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 3 Sep 2014 10:33:45 +0300 Subject: [PATCH] Post merge fixes --- system/src/Grav/Common/Themes.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/system/src/Grav/Common/Themes.php b/system/src/Grav/Common/Themes.php index 079637938..1cca6cc52 100644 --- a/system/src/Grav/Common/Themes.php +++ b/system/src/Grav/Common/Themes.php @@ -1,10 +1,9 @@ content(), $blueprint); // Override with user configuration. - $file = Yaml::instance("user://config/themes/{$name}.yaml"); + $file = CompiledYaml::instance("user://config/themes/{$name}.yaml"); $obj->merge($file->content()); // Save configuration always to user/config. @@ -140,9 +139,7 @@ class Themes /** @var Config $config */ $config = $this->grav['config']; - $themeConfig = Yaml::instance(THEMES_DIR . "{$name}/{$name}.yaml")->content(); - - $config->merge(['themes' => [$name => $themeConfig]]); + $this->loadConfiguration($name, $config); /** @var ResourceLocator $locator */ $locator = $this->grav['locator']; @@ -151,7 +148,7 @@ class Themes $registered = stream_get_wrappers(); $schemes = $config->get( "themes.{$name}.streams.schemes", - ['theme' => ['paths' => ["user/themes/{$name}"]]] + ['theme' => ['paths' => $locator->findResources("theme:///{$name}")]] ); foreach ($schemes as $scheme => $config) { @@ -178,4 +175,11 @@ class Themes } } + + protected function loadConfiguration($name, Config $config) + { + $themeConfig = CompiledYaml::instance(THEMES_DIR . "{$name}/{$name}.yaml")->content(); + + $config->merge(['themes' => [$name => $themeConfig]]); + } }