mirror of
https://github.com/flextype/flextype.git
synced 2025-08-25 06:00:43 +02:00
feat(admin-plugin): add ability to hide fieldsets from entries type select #304
This commit is contained in:
@@ -128,7 +128,10 @@ class EntriesController extends Controller
|
||||
foreach ($fieldsets_list as $fieldset) {
|
||||
if ($fieldset['type'] == 'file' && $fieldset['extension'] == 'yaml') {
|
||||
$fieldset_content = $this->parser->decode(Filesystem::read($fieldset['path']), 'yaml');
|
||||
if (isset($fieldset_content['sections']) && isset($fieldset_content['sections']['main']) && isset($fieldset_content['sections']['main']['fields'])) {
|
||||
if (isset($fieldset_content['sections']) &&
|
||||
isset($fieldset_content['sections']['main']) &&
|
||||
isset($fieldset_content['sections']['main']['fields']) &&
|
||||
isset($fieldset_content['sections']['main']['fields']['title'])) {
|
||||
if (isset($fieldset_content['hide']) && $fieldset_content['hide'] == true) {
|
||||
continue;
|
||||
}
|
||||
@@ -285,7 +288,10 @@ class EntriesController extends Controller
|
||||
foreach ($_fieldsets as $fieldset) {
|
||||
if ($fieldset['type'] == 'file' && $fieldset['extension'] == 'yaml') {
|
||||
$fieldset_content = $this->parser->decode(Filesystem::read($fieldset['path']), 'yaml');
|
||||
if (isset($fieldset_content['sections']) && isset($fieldset_content['sections']['main']) && isset($fieldset_content['sections']['main']['fields'])) {
|
||||
if (isset($fieldset_content['sections']) &&
|
||||
isset($fieldset_content['sections']['main']) &&
|
||||
isset($fieldset_content['sections']['main']['fields']) &&
|
||||
isset($fieldset_content['sections']['main']['fields']['title'])) {
|
||||
if (isset($fieldset_content['hide']) && $fieldset_content['hide'] == true) {
|
||||
continue;
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ class FieldsetsController extends Controller
|
||||
'hide' => (bool) $data['hide'],
|
||||
'sections' => [
|
||||
'main' => [
|
||||
'title' => 'Main',
|
||||
'title' => 'admin_main',
|
||||
'fields' => [
|
||||
'title' => [
|
||||
'title' => 'admin_title',
|
||||
|
Reference in New Issue
Block a user