- Home controller with hero and services sections - Nav rebuilt on install: Home, Services, About, FAQ, Contact (CTA), Book An Appointment (CTA) - Entrypoint uses IS_SETUP check so failed installs retry on restart - Gitea Actions workflow builds and pushes multi-arch image to forge.quinefoundation.com Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
39 lines
1.3 KiB
Text
39 lines
1.3 KiB
Text
<?php
|
||
|
||
use Drupal\Core\Breadcrumb\Breadcrumb;
|
||
use Drupal\Core\Link;
|
||
use Drupal\Core\Routing\RouteMatchInterface;
|
||
|
||
function riverside_pt_page_attachments(array &$attachments): void {
|
||
$attachments['#attached']['library'][] = 'riverside_pt/navigation';
|
||
}
|
||
|
||
function riverside_pt_system_breadcrumb_alter(Breadcrumb &$breadcrumb, RouteMatchInterface $route_match, array $context): void {
|
||
if ($route_match->getRouteName() === 'riverside_pt.booking') {
|
||
$breadcrumb = new Breadcrumb();
|
||
$breadcrumb->addLink(Link::createFromRoute('← Back', 'riverside_pt.schedule'));
|
||
$breadcrumb->addCacheContexts(['route']);
|
||
}
|
||
}
|
||
|
||
function riverside_pt_mail(string $key, array &$message, array $params): void {
|
||
if ($key !== 'booking_request') {
|
||
return;
|
||
}
|
||
|
||
$start = new \DateTime($params['start']);
|
||
$end = new \DateTime($params['end']);
|
||
|
||
$message['subject'] = 'Booking request — ' . $start->format('M j, Y g:i A');
|
||
$lines = [
|
||
'Name: ' . $params['first_name'] . ' ' . $params['last_name'],
|
||
'Phone: ' . $params['phone'],
|
||
'Slot: ' . $start->format('l, F j, Y') . ', ' . $start->format('g:i A') . '–' . $end->format('g:i A'),
|
||
];
|
||
|
||
if (!empty($params['comments'])) {
|
||
$lines[] = 'Comments: ' . $params['comments'];
|
||
}
|
||
|
||
$message['body'][] = implode("\n", $lines);
|
||
}
|