3declare(strict_types=1);
45 protected \ILIAS\DI\UIServices
$ui;
51 $this->
lng = $DIC->language();
53 $this->
ctrl = $DIC->ctrl();
55 $this->seed = clone
$seed;
56 $this->increment = $a_increment;
58 $this->
toolbar = $DIC->toolbar();
59 $this->
ui = $DIC->ui();
60 $this->
user = $DIC->user();
67 $tpl =
new ilTemplate(
"tpl.navigation_header.html",
true,
true,
"Services/Calendar");
70 $contains_today =
false;
72 $this->
ctrl->setParameterByClass(get_class($this->cmdClass),
'seed', $this->seed->get(
IL_CAL_DATE));
73 $b1 = $this->
ui->factory()->button()->standard(
74 $this->
lng->txt(
"previous"),
75 $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd)
81 switch ($this->increment) {
89 $contains_today =
true;
96 $this->user_settings->getWeekStart()
98 $start = current($weekday_list);
99 $end = end($weekday_list);
105 $contains_today =
true;
116 $contains_today =
true;
121 $this->
ctrl->setParameterByClass(
122 get_class($this->cmdClass),
126 if ($contains_today) {
127 $b2 = $this->
ui->factory()->button()->standard(
128 $this->
lng->txt(
"today"),
129 $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd)
130 )->withEngagedState(
true);
132 $b2 = $this->
ui->factory()->button()->standard(
133 $this->
lng->txt(
"today"),
134 $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd)
139 $this->
ctrl->setParameterByClass(get_class($this->cmdClass),
'seed', $this->seed->get(
IL_CAL_DATE));
140 $b3 = $this->
ui->factory()->button()->standard(
141 $this->
lng->txt(
"next"),
142 $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd)
144 $this->
ctrl->setParameterByClass(get_class($this->cmdClass),
'seed',
'');
145 $this->
toolbar->addStickyItem($this->
ui->factory()->viewControl()->section($b1, $b2, $b3));
146 $this->
toolbar->addSeparator();
153 switch ($this->increment) {
157 $this->seed->increment(
IL_CAL_DAY, (31 - $day) * -1);
161 $this->seed->increment($this->increment, $a_count);
static _getInstanceByUserId(int $a_user_id)
static _buildWeekDayList(ilDate $a_day, int $a_weekstart)
build week day list @access public
static _numericDayToString(int $a_day, bool $a_long=true)
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
static _within(ilDateTime $dt, ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
Check whether an date is within a date duration given by start and end.
special template class to simplify handling of ITX/PEAR
static now()
Return current timestamp in Y-m-d H:i:s format.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.