You are here

function gdpr_tasks_entity_view_alter in General Data Protection Regulation 3.0.x

Same name and namespace in other branches
  1. 8.2 modules/gdpr_tasks/gdpr_tasks.module \gdpr_tasks_entity_view_alter()
  2. 8 modules/gdpr_tasks/gdpr_tasks.module \gdpr_tasks_entity_view_alter()

Implements hook_entity_view_alter().

File

modules/gdpr_tasks/gdpr_tasks.module, line 169
Module file for the GDPR Tasks module.

Code

function gdpr_tasks_entity_view_alter(array &$build, EntityInterface $entity, EntityDisplayInterface $display) {
  if ($entity
    ->bundle() !== 'gdpr_sar') {
    return;
  }
  if (in_array($entity
    ->getStatus(), [
    'reviewing',
    'processed',
  ])) {
    if (isset($build['sar_export'])) {
      unset($build['sar_export']);
    }
  }
  elseif (isset($build['sar_export_parts'])) {
    unset($build['sar_export_parts']);
  }
}