mirror of
https://github.com/getgrav/grav.git
synced 2026-07-19 22:40:43 +02:00
Better fix for GPM issues
This commit is contained in:
@@ -105,12 +105,11 @@ class Plugins extends Iterator
|
||||
}
|
||||
|
||||
$plugin = $directory->getBasename();
|
||||
$result = self::get($plugin);
|
||||
|
||||
$filePath = $locator->findResource('plugins://' . $plugin . DS . $plugin . PLUGIN_EXT);
|
||||
if (!is_file($filePath)) {
|
||||
continue;
|
||||
if ($result) {
|
||||
$list[$plugin] = $result;
|
||||
}
|
||||
$list[$plugin] = self::get($plugin);
|
||||
}
|
||||
}
|
||||
ksort($list);
|
||||
@@ -125,9 +124,9 @@ class Plugins extends Iterator
|
||||
$blueprint->name = $name;
|
||||
|
||||
// Load default configuration.
|
||||
$file = CompiledYamlFile::instance("plugins://{$name}/{$name}.yaml");
|
||||
$file = CompiledYamlFile::instance("plugins://{$name}/{$name}" . YAML_EXT);
|
||||
|
||||
// ensure the plugin exists physically
|
||||
// ensure this is a valid plugin
|
||||
if (!$file->exists()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -87,12 +87,11 @@ class Themes extends Iterator
|
||||
}
|
||||
|
||||
$theme = $directory->getBasename();
|
||||
$result = self::get($theme);
|
||||
|
||||
$filePath = $locator->findResource('themes://' . $theme . DS . $theme . PLUGIN_EXT);
|
||||
if (!is_file($filePath)) {
|
||||
continue;
|
||||
if ($result) {
|
||||
$list[$theme] = $result;
|
||||
}
|
||||
$list[$theme] = self::get($theme);
|
||||
}
|
||||
}
|
||||
ksort($list);
|
||||
@@ -117,14 +116,20 @@ class Themes extends Iterator
|
||||
$blueprint = $blueprints->get("{$name}/blueprints");
|
||||
$blueprint->name = $name;
|
||||
|
||||
// Load default configuration.
|
||||
$file = CompiledYamlFile::instance("themes://{$name}/{$name}" . YAML_EXT);
|
||||
|
||||
// ensure this is a valid theme
|
||||
if (!$file->exists()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Find thumbnail.
|
||||
$thumb = "themes://{$name}/thumbnail.jpg";
|
||||
if ($path = $this->grav['locator']->findResource($thumb, false)) {
|
||||
$blueprint->set('thumbnail', $this->grav['base_url'] . '/' . $path);
|
||||
}
|
||||
|
||||
// Load default configuration.
|
||||
$file = CompiledYamlFile::instance("themes://{$name}/{$name}" . YAML_EXT);
|
||||
$obj = new Data($file->content(), $blueprint);
|
||||
|
||||
// Override with user configuration.
|
||||
|
||||
Reference in New Issue
Block a user