function social_group_views_data_alter in Open Social 10.3.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 8 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 8.2 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 8.3 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 8.4 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 8.5 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 8.6 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 8.7 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 8.8 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 10.0.x modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 10.1.x modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
- 10.2.x modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
Implements hook_views_data_alter().
File
- modules/
social_features/ social_group/ social_group.views.inc, line 11 - Contains Views hooks.
Code
function social_group_views_data_alter(array &$data) {
// @todo remove this when this hits https://www.drupal.org/node/2715285.
// Also note that by default the Group Creator is a Member now, that's
// where we check on in Drupal\social_group\Plugin\views\argument\UserUid.php.
$data['groups']['group_membership_or_creator'] = [
'group' => t('Group Content'),
'title' => t('User is member'),
'help' => t('User is member of the group'),
'argument' => [
'field' => 'uid',
'name table' => 'group_content_field_data',
'name field' => 'name',
'id' => 'group_content_user_uid',
'no group by' => TRUE,
],
];
// Create our own views VBO field for enrollments.
$data['views']['social_views_bulk_operations_bulk_form_group'] = [
'title' => t('Social Views bulk operations for Group Management'),
'help' => t("Process enrollments returned by the view with Views Bulk Operations actions."),
'field' => [
'id' => 'social_views_bulk_operations_bulk_form_group',
],
];
// Field with the count of group members.
$data['group_content']['group_membership_count'] = [
'title' => t('Membership count'),
'field' => [
'title' => t('Membership count'),
'help' => t('Displays the count of members in a group.'),
'id' => 'social_group_membership_count',
],
];
}