Add a "Group membership" field group for group and is_group_assignment log fields.

This commit is contained in:
Michael Stenta 2024-01-15 20:14:01 -05:00
parent 067ea5fa05
commit c8b9fad4b6
1 changed files with 31 additions and 0 deletions

View File

@ -71,3 +71,34 @@ function farm_group_farm_ui_theme_region_items(string $entity_type) {
}
return $region_items;
}
/**
* Implements hook_farm_ui_theme_field_groups().
*/
function farm_group_farm_ui_theme_field_groups(string $entity_type, string $bundle) {
// Add a field group for group membership fields on logs.
if ($entity_type == 'log') {
return [
'group' => [
'location' => 'main',
'title' => t('Group'),
'weight' => 60,
],
];
}
return [];
}
/**
* Implements hook_farm_ui_theme_field_group_items().
*/
function farm_group_farm_ui_theme_field_group_items(string $entity_type, string $bundle) {
if ($entity_type == 'log') {
return [
'group' => 'group',
'is_group_assignment' => 'group',
];
}
return [];
}