ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
CalendarStaticURLHandler.php
Go to the documentation of this file.
1<?php
2
20
29
30class CalendarStaticURLHandler extends BaseHandler implements Handler
31{
32 private const CALENDAR_NAMESPACE = 'calendar';
33
34 private const BOOKINGS = 'bookings';
35
36
37 public function buildConsultationHoursURI(): URI
38 {
39 global $DIC;
41 $static_url = $DIC['static_url'];
42 return $static_url->builder()->build(
43 self::CALENDAR_NAMESPACE,
44 null,
45 [
46 self::BOOKINGS
47 ]
48 );
49 }
50
51 public function getNamespace(): string
52 {
54 }
55
56 public function handle(Request $request, Context $context, Factory $response_factory): Response
57 {
58 $additional_params = $request->getAdditionalParameters()[0] ?? '';
59 $uri = match ($additional_params) {
60 self::BOOKINGS => $context->ctrl()->getLinkTargetByClass(
61 [
62 \ilDashboardGUI::class,
63 \ilCalendarPresentationGUI::class,
64 \ilConsultationHoursGUI::class
65 ],
66 'appointments'
67 ),
68 default => $context->ctrl()->getLinkTargetByClass(
69 [
70 \ilDashboardGUI::class
71 ],
72 ''
73 )
74 };
75 return $response_factory->can($uri);
76 }
77}
handle(Request $request, Context $context, Factory $response_factory)
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
Class Services.
Definition: Services.php:38
can(string $uri_path, bool $shift=false)
The Handler successfully resolved the target.
Definition: Factory.php:88
$static_url
Definition: goto.php:29
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26