function social_event_managers_views_pre_view in Open Social 8.7
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/modules/social_event_managers/social_event_managers.module \social_event_managers_views_pre_view()
- 8.5 modules/social_features/social_event/modules/social_event_managers/social_event_managers.module \social_event_managers_views_pre_view()
- 8.6 modules/social_features/social_event/modules/social_event_managers/social_event_managers.module \social_event_managers_views_pre_view()
- 8.8 modules/social_features/social_event/modules/social_event_managers/social_event_managers.module \social_event_managers_views_pre_view()
- 10.3.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.module \social_event_managers_views_pre_view()
- 10.0.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.module \social_event_managers_views_pre_view()
- 10.1.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.module \social_event_managers_views_pre_view()
- 10.2.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.module \social_event_managers_views_pre_view()
Implements hook_views_pre_view().
File
- modules/
social_features/ social_event/ modules/ social_event_managers/ social_event_managers.module, line 605 - Contains social_event_managers.module.
Code
function social_event_managers_views_pre_view(ViewExecutable $view, $display_id, array &$args) {
// Remove fields from the Enrollment Management tab if the user is not a
// manager or organiser.
if ($view
->id() === 'event_manage_enrollments') {
if (!social_event_manager_or_organizer()) {
$fields = $view->display_handler
->getOption('fields');
$fields['operations_1']['exclude'] = TRUE;
$fields['social_views_bulk_operations_bulk_form_enrollments_1']['exclude'] = TRUE;
$view->display_handler
->overrideOption('fields', $fields);
}
}
}