function bat_unit_views_pre_render in Booking and Availability Management Tools for Drupal 8
Same name and namespace in other branches
- 7 modules/bat_unit/bat_unit.module \bat_unit_views_pre_render()
Implements hook_views_pre_render().
File
- modules/
bat_unit/ bat_unit.module, line 120 - Manage units - Units are things that can be booked for some period of time. (e.g. rooms - but also villas bungalows, cars, drills, you-get-the-idea etc.)
Code
function bat_unit_views_pre_render(ViewExecutable $view) {
// Hide "Calendars" field until module "BAT Event UI" is enabled.
if ($view
->id() == 'unit_management' && !\Drupal::moduleHandler()
->moduleExists('bat_event_ui')) {
$view->field['calendars']->options['exclude'] = TRUE;
}
}