You are here

function template_preprocess_support_ticket_add_list in Support Ticketing System 8

Prepares variables for list of available support ticket type templates.

Default template: support-ticket-add-list.html.twig.

Parameters

array $variables: An associative array containing:

  • content: An array of content types.

File

modules/support_ticket/support_ticket.module, line 441
Enables use of support tickets with optional time tracking.

Code

function template_preprocess_support_ticket_add_list(&$variables) {
  $variables['types'] = array();
  if (!empty($variables['content'])) {
    foreach ($variables['content'] as $type) {
      $variables['types'][$type
        ->id()] = array(
        'type' => $type
          ->id(),
        'add_link' => \Drupal::l($type
          ->label(), new Url('support_ticket.add', array(
          'support_ticket_type' => $type
            ->id(),
        ))),
        'description' => array(
          '#markup' => $type
            ->getDescription(),
        ),
      );
    }
  }
}