Added support for loading flex type configuration

This commit is contained in:
Matias Griese
2020-01-17 15:07:57 +02:00
parent 26584b9909
commit 76bb7fe4af
3 changed files with 79 additions and 1 deletions

View File

@@ -0,0 +1,64 @@
form:
validation: loose
fields:
plugin_tabs:
type: tabs
fields:
cache_tab:
type: tab
title: Caching
fields:
object.cache.index.enabled:
type: toggle
label: Enable Index Caching
highlight: 1
default: 1
options:
1: Enabled
0: Disabled
validate:
type: bool
object.cache.index.timeout:
type: text
label: Index Cache Timeout (s)
default: 60
validate:
type: int
object.cache.object.enabled:
type: toggle
label: Enable Object Caching
highlight: 1
default: 1
options:
1: Enabled
0: Disabled
validate:
type: bool
object.cache.object.timeout:
type: text
label: Object Cache Timeout (s)
default: 60
validate:
type: int
object.cache.render.enabled:
type: toggle
label: Enable Render Caching
highlight: 1
default: 1
options:
1: Enabled
0: Disabled
validate:
type: bool
object.cache.render.timeout:
type: text
label: Render Cache Timeout (s)
default: 60
validate:
type: int

View File

@@ -40,7 +40,7 @@ form:
access:
type: permissions
check_authorize: true
check_authorize: false
label: PLUGIN_ADMIN.PERMISSIONS
ignore_empty: true
validate:

View File

@@ -158,6 +158,20 @@ class FlexDirectory implements FlexAuthorizeInterface
return null === $name ? $this->config : $this->config->get($name, $default);
}
/**
* @param string|null $name
* @return Blueprint|null
*/
public function getConfigureBlueprint(string $name = null)
{
$name = $name ?? 'configure';
$path = "blueprints://flex/shared/{$name}.yaml";
$blueprint = new Blueprint($path);
$blueprint->load()->init();
return $blueprint->form() ? $blueprint : null;
}
/**
* Returns a new uninitialized instance of blueprint.
*