mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Flex Directory: Implemented customizable configuration
This commit is contained in:
parent
75ee0670f6
commit
5ea7ec1013
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
1. [](#new)
|
||||
* Plugins & Themes: Call `$plugin->autoload()` and `$theme->autoload()` automatically when object gets initialized
|
||||
* Flex Directory: Implemented customizable configuration
|
||||
* Flex Storages: Added support for renaming directory entries
|
||||
1. [](#bugfix)
|
||||
* Regression: Fixed fatal error in blueprints [#2811](https://github.com/getgrav/grav/issues/2811)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ form:
|
|||
validation: loose
|
||||
|
||||
fields:
|
||||
plugin_tabs:
|
||||
tabs:
|
||||
type: tabs
|
||||
fields:
|
||||
cache:
|
||||
|
|
|
|||
|
|
@ -183,9 +183,17 @@ class FlexDirectory implements FlexAuthorizeInterface
|
|||
public function getDirectoryBlueprint()
|
||||
{
|
||||
$name = 'configure';
|
||||
|
||||
$type = $this->getBlueprint();
|
||||
$overrides = $type->get("blueprints/{$name}");
|
||||
|
||||
$path = "blueprints://flex/shared/{$name}.yaml";
|
||||
$blueprint = new Blueprint($path);
|
||||
$blueprint->load()->init();
|
||||
$blueprint->load();
|
||||
if ($overrides) {
|
||||
$blueprint->embed('form/fields/tabs/fields', $overrides['fields']);
|
||||
}
|
||||
$blueprint->init();
|
||||
|
||||
return $blueprint;
|
||||
}
|
||||
|
|
@ -237,8 +245,9 @@ class FlexDirectory implements FlexAuthorizeInterface
|
|||
public function getDirectoryConfigUri(string $name = null): string
|
||||
{
|
||||
$name = $name ?: $this->getFlexType();
|
||||
$blueprint = $this->getBlueprint();
|
||||
|
||||
return "config://flex/{$name}.yaml";
|
||||
return $blueprint->get('blueprints/configure/file') ?? "config://flex/{$name}.yaml";
|
||||
}
|
||||
|
||||
protected function getDirectoryConfig(string $name = null): array
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user