mirror of
https://github.com/getgrav/grav.git
synced 2026-06-20 03:11:29 +02:00
Improve Flex configuration: gather views together in blueprint
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
* Forward a `sid` to GPM when downloading a premium package via CLI
|
||||
* Allow `JsonFormatter` options to be passed as a string
|
||||
* Hide Flex Pages frontend configuration (not ready for production use)
|
||||
* Improve Flex configuration: gather views together in blueprint
|
||||
1. [](#bugfix)
|
||||
* *Menu Visibility Requires Access* Security option setting wrong frontmatter [login#265](https://github.com/getgrav/grav-plugin-login/issues/265)
|
||||
* Accessing page with unsupported file extension (jpg, pdf, xsl) will use wrong mime type [#3031](https://github.com/getgrav/grav/issues/3031)
|
||||
|
||||
@@ -152,7 +152,7 @@ class FlexDirectory implements FlexDirectoryInterface, FlexAuthorizeInterface
|
||||
{
|
||||
if (null === $this->config) {
|
||||
$config = $this->getBlueprintInternal()->get('config', []);
|
||||
$config = is_array($config) ? array_replace_recursive($config, $this->defaults, $this->getDirectoryConfig($config['admin']['configure']['form'] ?? null)) : null;
|
||||
$config = is_array($config) ? array_replace_recursive($config, $this->defaults, $this->getDirectoryConfig($config['admin']['views']['configure']['form'] ?? $config['admin']['configure']['form'] ?? null)) : null;
|
||||
if (!is_array($config)) {
|
||||
throw new RuntimeException('Bad configuration');
|
||||
}
|
||||
@@ -171,7 +171,7 @@ class FlexDirectory implements FlexDirectoryInterface, FlexAuthorizeInterface
|
||||
*/
|
||||
public function getDirectoryForm(string $name = null, array $options = [])
|
||||
{
|
||||
$name = $name ?: $this->getConfig('admin.configure.form', '');
|
||||
$name = $name ?: $this->getConfig('admin.views.configure.form', '') ?: $this->getConfig('admin.configure.form', '');
|
||||
|
||||
return new FlexDirectoryForm($name ?? '', $this, $options);
|
||||
}
|
||||
@@ -252,7 +252,7 @@ class FlexDirectory implements FlexDirectoryInterface, FlexAuthorizeInterface
|
||||
$name = $name ?: $this->getFlexType();
|
||||
$blueprint = $this->getBlueprint();
|
||||
|
||||
return $blueprint->get('blueprints/configure/file') ?? "config://flex/{$name}.yaml";
|
||||
return $blueprint->get('blueprints/views/configure/file') ?? $blueprint->get('blueprints/configure/file') ?? "config://flex/{$name}.yaml";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -226,7 +226,8 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
|
||||
{
|
||||
$properties = (array)($properties ?? $this->getFlexDirectory()->getConfig('data.search.fields'));
|
||||
if (!$properties) {
|
||||
foreach ($this->getFlexDirectory()->getConfig('admin.list.fields', []) as $property => $value) {
|
||||
$fields = $this->getFlexDirectory()->getConfig('admin.views.list.fields') ?? $this->getFlexDirectory()->getConfig('admin.list.fields', []);
|
||||
foreach ($fields as $property => $value) {
|
||||
if (!empty($value['link'])) {
|
||||
$properties[] = $property;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user