You are here

function social_group_views_data_alter in Open Social 8.3

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  2. 8 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  3. 8.2 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  4. 8.4 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  5. 8.5 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  6. 8.6 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  7. 8.7 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  8. 8.8 modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  9. 10.3.x modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  10. 10.0.x modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  11. 10.1.x modules/social_features/social_group/social_group.views.inc \social_group_views_data_alter()
  12. 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,
    ],
  ];
}