Skip to content

Commit

Permalink
Use the original calendar in the breadcrumbs
Browse files Browse the repository at this point in the history
Updates #14
  • Loading branch information
inghamn committed Mar 10, 2021
1 parent d3137a8 commit f113e15
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Breadcrumb/BreadcrumbBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public function build(RouteMatchInterface $route_match): Breadcrumb
}
if ($route == 'calendar.event_view') {
try {
$id = $route_match->getParameter('calendar_id');
$cal = GoogleGateway::calendar($id);
$uri = "https://calendar.google.com/calendar/embed?src=$id&ctz=America/New_York";
$url = Url::fromUri($uri, ['absolute' => true, 'https' => true]);
$breadcrumb->addLink(Link::fromTextAndUrl($cal->summary, $url));

$calendar_id = $route_match->getParameter('calendar_id');
$event_id = $route_match->getParameter( 'event_id');
$event = GoogleGateway::event($calendar_id, $event_id);
$uri = "https://calendar.google.com/calendar/embed?src={$event->organizer->email}&ctz=America/New_York";
$url = Url::fromUri($uri, ['absolute' => true, 'https' => true]);
$breadcrumb->addLink(Link::fromTextAndUrl($event->organizer->displayName, $url));
}
catch (\Exception $e) { }
}
Expand Down

0 comments on commit f113e15

Please sign in to comment.