You are here

function gdpr_tasks_theme_suggestions_gdpr_task in General Data Protection Regulation 8

Same name and namespace in other branches
  1. 8.2 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 35
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 = strtr($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;
}