You are here

function gdpr_tasks_theme_suggestions_gdpr_task in General Data Protection Regulation 8.2

Same name and namespace in other branches
  1. 8 modules/gdpr_tasks/gdpr_tasks.module \gdpr_tasks_theme_suggestions_gdpr_task()
  2. 3.0.x modules/gdpr_tasks/gdpr_tasks.module \gdpr_tasks_theme_suggestions_gdpr_task()

Implements hook_theme_suggestions_HOOK().

File

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

Code

function gdpr_tasks_theme_suggestions_gdpr_task(array $variables) {
  $suggestions = [];

  /* @var \Drupal\gdpr_tasks\Entity\TaskInterface $entity */
  $entity = $variables['elements']['#gdpr_task'];
  $anonymized_view_mode = str_replace('.', '_', $variables['elements']['#view_mode']);
  $suggestions[] = 'gdpr_task__' . $anonymized_view_mode;
  $suggestions[] = 'gdpr_task__' . $entity
    ->bundle();
  $suggestions[] = 'gdpr_task__' . $entity
    ->bundle() . '__' . $anonymized_view_mode;
  $suggestions[] = 'gdpr_task__' . $entity
    ->id();
  $suggestions[] = 'gdpr_task__' . $entity
    ->id() . '__' . $anonymized_view_mode;
  return $suggestions;
}