Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ui_patterns
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
ui_patterns
Merge requests
!14
Issue
#3311455
: Support field_groups nesting
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Issue
#3311455
: Support field_groups nesting
issue/ui_patterns-3311455:3311455-support-fieldgroups-nesting
into
8.x-1.x
Overview
0
Commits
3
Pipelines
3
Changes
2
Merged
Issue #3311455: Support field_groups nesting
Edouard Cunibil
requested to merge
issue/ui_patterns-3311455:3311455-support-fieldgroups-nesting
into
8.x-1.x
Dec 9, 2022
Overview
0
Commits
3
Pipelines
3
Changes
2
0
0
Merge request reports
Compare
8.x-1.x
version 4
b9374957
2 months ago
version 3
f45c72d0
5 months ago
version 2
68f3954d
5 months ago
version 1
f45c72d0
Dec 9, 2022
8.x-1.x (base)
and
latest version
latest version
f3e695e6
3 commits,
2 months ago
version 4
b9374957
1 commit,
2 months ago
version 3
f45c72d0
1 commit,
5 months ago
version 2
68f3954d
3 commits,
5 months ago
version 1
f45c72d0
1 commit,
Dec 9, 2022
2 files
+
114
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
modules/ui_patterns_field_group/src/Plugin/UiPatterns/Source/FieldgroupSource.php
0 → 100644
+
46
−
0
View file @ f3e695e6
Edit in single-file editor
Open in Web IDE
<?php
namespace
Drupal\ui_patterns_field_group\Plugin\UiPatterns\Source
;
use
Drupal\ui_patterns
\Plugin\PatternSourceBase
;
/**
* Defines Fields API pattern source plugin.
*
* @UiPatternsSource(
* id = "fieldgroup",
* label = @Translation("Fieldgroups"),
* provider = "field_group",
* tags = {
* "entity_display"
* }
* )
*/
class
FieldgroupSource
extends
PatternSourceBase
{
/**
* Return list of source fields.
*
* @return \Drupal\ui_patterns\Definition\PatternSourceField[]
* List of source fields.
*
* @throws \Drupal\Component\Plugin\Exception\PluginException
*/
public
function
getSourceFields
()
{
$sources
=
[];
$entity_type_id
=
$this
->
getContextProperty
(
'entity_type'
);
$bundle
=
$this
->
getContextProperty
(
'entity_bundle'
);
$view_mode
=
$this
->
getContextProperty
(
'entity_view_mode'
);
$groups
=
field_group_info_groups
(
$entity_type_id
,
$bundle
,
'view'
,
$view_mode
);
foreach
(
$groups
as
$group_name
=>
$group
)
{
if
(
empty
(
$this
->
getContextProperty
(
'limit'
))
||
in_array
(
$group_name
,
$this
->
getContextProperty
(
'limit'
)))
{
$sources
[]
=
$this
->
getSourceField
(
$group_name
,
$group
->
label
);
}
}
return
$sources
;
}
}
Loading