24 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
65 $this->lng = $DIC->language();
67 $this->ctrl = $DIC->ctrl();
69 $this->seed = clone
$seed;
70 $this->increment = $a_increment;
72 $this->toolbar = $DIC->toolbar();
73 $this->ui = $DIC->ui();
74 $this->
user = $DIC->user();
89 $toolbar = $this->toolbar;
93 $tpl =
new ilTemplate(
"tpl.navigation_header.html",
true,
true,
"Services/Calendar");
97 $this->ctrl->setParameterByClass(get_class($this->cmdClass),
'seed', $this->seed->get(
IL_CAL_DATE));
98 $b1 = $ui->factory()->button()->standard(
$lng->txt(
"previous"), $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd));
101 $contains_today =
false;
104 switch ($this->increment) {
109 $contains_today =
true;
115 $start = current($weekday_list);
116 $end = end($weekday_list);
117 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'week') .
' ' . $this->seed->get(
IL_CAL_FKT_DATE,
'W') .
122 $contains_today =
true;
127 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'month_' . $this->seed->get(
IL_CAL_FKT_DATE,
'm') .
'_long') .
130 $contains_today =
true;
135 $this->ctrl->setParameterByClass(
136 get_class($this->cmdClass),
140 if ($contains_today) {
141 $b2 = $ui->factory()->button()->standard(
143 $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd)
144 )->withUnavailableAction();
146 $b2 = $ui->factory()->button()->standard(
148 $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd)
154 $this->ctrl->setParameterByClass(get_class($this->cmdClass),
'seed', $this->seed->get(
IL_CAL_DATE));
155 $b3 = $ui->factory()->button()->standard(
$lng->txt(
"next"), $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd));
156 $this->ctrl->setParameterByClass(get_class($this->cmdClass),
'seed',
'');
159 $toolbar->addStickyItem($ui->factory()->viewControl()->section($b1, $b2, $b3));
160 $toolbar->addSeparator();
167 switch ($this->increment) {
172 $this->seed->increment(
IL_CAL_DAY, (31 - $day) * -1);
176 $this->seed->increment($this->increment, $a_count);
static _numericDayToString($a_day, $a_long=true)
get
static _getInstanceByUserId($a_user_id)
get singleton instance
static setUseRelativeDates($a_status)
set use relative dates
static _buildWeekDayList($a_day, $a_weekstart)
build week day list
static now()
Return current timestamp in Y-m-d H:i:s format.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
special template class to simplify handling of ITX/PEAR
get($a_format, $a_format_str='', $a_tz='')
get formatted date
static _within(ilDateTime $dt, ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check whether an date is within a date duration given by start and end.