You are here

protected function SupportTicketRevisionController::buildMarkdownNavigation in Support Ticketing System 8

Builds a table row with navigation between raw and raw-plain formats.

1 call to SupportTicketRevisionController::buildMarkdownNavigation()
SupportTicketRevisionController::compareSupportTicketRevisions in modules/support_ticket/src/Controller/SupportTicketRevisionController.php
Returns a table which shows the differences between two support ticket revisions.

File

modules/support_ticket/src/Controller/SupportTicketRevisionController.php, line 284
Contains \Drupal\support_ticket\Controller\SupportTicketRevisionController.

Class

SupportTicketRevisionController
Returns responses for Support Ticket Revision routes.

Namespace

Drupal\support_ticket\Controller

Code

protected function buildMarkdownNavigation($stid, $left_vid, $right_vid, $active_filter) {
  $links['raw'] = array(
    'title' => $this
      ->t('Standard'),
    'url' => Url::fromRoute('support_ticket.revisions_diff', array(
      'support_ticket' => $stid,
      'left_vid' => $left_vid,
      'right_vid' => $right_vid,
    )),
  );
  $links['raw_plain'] = array(
    'title' => $this
      ->t('Markdown'),
    'url' => Url::fromRoute('support_ticket.revisions_diff', array(
      'support_ticket' => $stid,
      'left_vid' => $left_vid,
      'right_vid' => $right_vid,
      'filter' => 'raw-plain',
    )),
  );

  // Set as the first element the current filter.
  $filter = $links[$active_filter];
  unset($links[$active_filter]);
  array_unshift($links, $filter);
  $row[] = array(
    'data' => array(
      '#type' => 'operations',
      '#links' => $links,
    ),
    'colspan' => 4,
  );
  return $row;
}