function social_group_request_views_pre_view in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/modules/social_group_request/social_group_request.module \social_group_request_views_pre_view()
- 10.3.x modules/social_features/social_group/modules/social_group_request/social_group_request.module \social_group_request_views_pre_view()
- 10.1.x modules/social_features/social_group/modules/social_group_request/social_group_request.module \social_group_request_views_pre_view()
- 10.2.x modules/social_features/social_group/modules/social_group_request/social_group_request.module \social_group_request_views_pre_view()
Implements hook_views_pre_view().
File
- modules/
social_features/ social_group/ modules/ social_group_request/ social_group_request.module, line 376 - Primary module hooks for social_group_request module.
Code
function social_group_request_views_pre_view(ViewExecutable $view, $display_id, array &$args) {
if ($view
->id() === 'group_pending_members' && $display_id === 'membership_requests') {
$options = [
'id' => 'area_text_custom',
'table' => 'views',
'field' => 'area_text_custom',
'relationship' => 'none',
'group_type' => 'none',
'admin_label' => '',
'empty' => TRUE,
'tokenize' => FALSE,
'content' => Link::fromTextAndUrl(t('Back to group'), Url::fromRoute('entity.group.canonical', [
'group' => $args[0],
], [
'attributes' => [
'class' => [
'btn',
'btn-default',
],
],
]))
->toString(),
'plugin_id' => 'text_custom',
];
$view
->setHandler('membership_requests', 'footer', 'area_text_custom', $options);
$view->element['#attached']['library'][] = 'social_group_request/social_group_table';
}
}