mirror of
https://github.com/getgrav/grav.git
synced 2026-03-17 18:10:55 +01:00
Added support for loading flex type configuration
This commit is contained in:
64
system/blueprints/flex/shared/configure.yaml
Normal file
64
system/blueprints/flex/shared/configure.yaml
Normal 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
|
||||
@@ -40,7 +40,7 @@ form:
|
||||
|
||||
access:
|
||||
type: permissions
|
||||
check_authorize: true
|
||||
check_authorize: false
|
||||
label: PLUGIN_ADMIN.PERMISSIONS
|
||||
ignore_empty: true
|
||||
validate:
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user