19declare(strict_types=1);
33 protected string $link,
34 protected string $from,
36 protected int $from_ts,
38 protected string $title,
39 protected int $available,
40 protected int $color_nr
44 $this->ui_factory =
$DIC->ui()->factory();
45 $this->ui_renderer =
$DIC->ui()->renderer();
50 $tpl =
new ilTemplate(
'tpl.slot.html',
true,
true,
'components/ILIAS/BookingManager/BookingProcess');
52 $modal = $this->ui_factory->modal()->roundtrip(
'', $this->ui_factory->legacy()->content(
''));
53 $url =
"{$this->link}&replaceSignal={$modal->getReplaceSignal()->getId()}";
54 $modal = $modal->withAsyncRenderUrl($url);
55 $button = $this->ui_factory->button()->shy($this->title,
'#')->withOnClick($modal->getShowSignal());
57 $tpl->
setVariable(
'OBJECT_LINK', $this->ui_renderer->render([$button, $modal]));
58 $tpl->
setVariable(
'TIME', ($this->to_ts - $this->from_ts) !== 86400 ?
"{$this->from}-{$this->to}" :
'');
__construct(protected string $link, protected string $from, protected string $to, protected int $from_ts, protected int $to_ts, protected string $title, protected int $available, protected int $color_nr)
Builds a Color from either hex- or rgb values.
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
readonly ilGlobalTemplateInterface $tpl