function support_ticket_is_page in Support Ticketing System 8
Checks whether the current page is the full page view of the passed-in support ticket.
Parameters
\Drupal\support_ticket\SupportTicketInterface $support_ticket: A support ticket entity.
Return value
The ID of the support ticket if this is a full page view, otherwise FALSE.
1 call to support_ticket_is_page()
- template_preprocess_support_ticket in modules/
support_ticket/ support_ticket.module - Prepares variables for support ticket templates.
File
- modules/
support_ticket/ support_ticket.module, line 424 - Enables use of support tickets with optional time tracking.
Code
function support_ticket_is_page(SupportTicketInterface $support_ticket) {
$route_match = \Drupal::routeMatch();
if ($route_match
->getRouteName() == 'entity.support_ticket.canonical') {
$page_support_ticket = $route_match
->getParameter('support_ticket');
}
return !empty($page_support_ticket) ? $page_support_ticket
->id() == $support_ticket
->id() : FALSE;
}