ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
CalendarStaticURLHandler.php
Go to the documentation of this file.
1 <?php
19 
26 use ILIAS\Data\URI;
28 
30 {
31  private const CALENDAR_NAMESPACE = 'calendar';
32 
33  private const BOOKINGS = 'bookings';
34 
35 
36  public function buildConsultationHoursURI(): URI
37  {
38  global $DIC;
40  $static_url = $DIC['static_url'];
41  return $static_url->builder()->build(
42  self::CALENDAR_NAMESPACE,
43  null,
44  [
45  self::BOOKINGS
46  ]
47  );
48  }
49 
50  public function getNamespace(): string
51  {
52  return self::CALENDAR_NAMESPACE;
53  }
54 
55  public function handle(Request $request, Context $context, Factory $response_factory): Response
56  {
57  $additional_params = $request->getAdditionalParameters()[0] ?? '';
58  $uri = match ($additional_params) {
59  self::BOOKINGS => $context->ctrl()->getLinkTargetByClass(
60  [
61  \ilDashboardGUI::class,
62  \ilCalendarPresentationGUI::class,
63  \ilConsultationHoursGUI::class
64  ],
65  'appointments'
66  ),
67  default => $context->ctrl()->getLinkTargetByClass(
68  [
69  \ilDashboardGUI::class
70  ],
71  ''
72  )
73  };
74  return $response_factory->can($uri);
75  }
76 }
handle(Request $request, Context $context, Factory $response_factory)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$context
Definition: webdav.php:31
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$static_url
Definition: goto.php:29
global $DIC
Definition: shib_login.php:26
Builds data types.
Definition: Factory.php:35