You are here

function content_kanban_preprocess_content_calendar_entry in Content Planner 8

Implements hook_preprocess_HOOK().

File

modules/content_kanban/content_kanban.module, line 87
Contains content_kanban.module.

Code

function content_kanban_preprocess_content_calendar_entry(&$variables) {

  /* @var $kanban_workflow_service \Drupal\content_kanban\KanbanWorkflowService */
  $kanban_workflow_service = \Drupal::service('content_kanban.kanban_workflow_service');

  // Fully load node.
  $node = Node::load($variables['node']->nid);

  // Get workflow state label from node.
  $workflow_state_label = $kanban_workflow_service
    ->getCurrentStateLabel($node);

  // Add label to template.
  $variables['workflow_state'] = $workflow_state_label;
}