/** * Build the default links (Read more) for a support ticket. * * @param \Drupal\support_ticket\SupportTicketInterface $entity * The support ticket object. * @param string $view_mode * A view mode identifier. * * @return array * An array that can be processed by drupal_pre_render_links(). */ protected static function buildLinks(SupportTicketInterface $entity, $view_mode) { $links = array(); // Always display a read more link on teasers because we have no way // to know when a teaser view is different than a full view. if ($view_mode == 'teaser') { $support_ticket_title_stripped = strip_tags($entity->label()); $links['support_ticket-readmore'] = array('title' => t('Read more<span class="visually-hidden"> about @title</span>', array('@title' => $support_ticket_title_stripped)), 'url' => $entity->urlInfo(), 'language' => $entity->language(), 'attributes' => array('rel' => 'tag', 'title' => $support_ticket_title_stripped)); } return array('#theme' => 'links__support_ticket__support_ticket', '#links' => $links, '#attributes' => array('class' => array('links', 'inline'))); }