19declare(strict_types=1);
39 protected \ILIAS\DI\UIServices
$ui;
45 $this->
lng = $DIC->language();
47 $this->
ctrl = $DIC->ctrl();
49 $this->seed = clone
$seed;
50 $this->increment = $a_increment;
52 $this->
toolbar = $DIC->toolbar();
53 $this->
ui = $DIC->ui();
54 $this->
user = $DIC->user();
61 $tpl =
new ilTemplate(
"tpl.navigation_header.html",
true,
true,
"components/ILIAS/Calendar");
64 $contains_today =
false;
66 $this->
ctrl->setParameterByClass(get_class($this->cmdClass),
'seed', $this->seed->get(
IL_CAL_DATE));
67 $b1 = $this->
ui->factory()->button()->standard(
68 $this->
lng->txt(
"previous"),
69 $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd)
75 switch ($this->increment) {
83 $contains_today =
true;
90 $this->user_settings->getWeekStart()
92 $start = current($weekday_list);
93 $end = end($weekday_list);
99 $contains_today =
true;
110 $contains_today =
true;
115 $this->
ctrl->setParameterByClass(
116 get_class($this->cmdClass),
120 if ($contains_today) {
121 $b2 = $this->
ui->factory()->button()->standard(
122 $this->
lng->txt(
"today"),
123 $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd)
124 )->withEngagedState(
true);
126 $b2 = $this->
ui->factory()->button()->standard(
127 $this->
lng->txt(
"today"),
128 $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd)
133 $this->
ctrl->setParameterByClass(get_class($this->cmdClass),
'seed', $this->seed->get(
IL_CAL_DATE));
134 $b3 = $this->
ui->factory()->button()->standard(
135 $this->
lng->txt(
"next"),
136 $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd)
138 $this->
ctrl->setParameterByClass(get_class($this->cmdClass),
'seed',
'');
139 $this->
toolbar->addStickyItem($this->
ui->factory()->viewControl()->section($b1, $b2, $b3));
140 $this->
toolbar->addSeparator();
147 switch ($this->increment) {
151 $this->seed->increment(
IL_CAL_DAY, (31 - $day) * -1);
155 $this->seed->increment($this->increment, $a_count);
static _getInstanceByUserId(int $a_user_id)
static _numericDayToString(int $a_day, bool $a_long=true, ?ilLanguage $lng=null)
static _buildWeekDayList(ilDate $a_day, int $a_weekstart)
build week day list @access public
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, ?ilObjUser $user=null,)
@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.
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...