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;
91 $tpl =
new ilTemplate(
"tpl.navigation_header.html",
true,
true,
"Services/Calendar");
95 $this->ctrl->setParameterByClass(get_class($this->cmdClass),
'seed', $this->seed->get(
IL_CAL_DATE));
96 $b1 = $ui->factory()->button()->standard(
$lng->txt(
"previous"), $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd));
99 $contains_today =
false;
102 switch ($this->increment) {
107 $contains_today =
true;
113 $start = current($weekday_list);
114 $end = end($weekday_list);
115 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'week') .
' ' . $this->seed->get(
IL_CAL_FKT_DATE,
'W') .
120 $contains_today =
true;
125 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'month_' . $this->seed->get(
IL_CAL_FKT_DATE,
'm') .
'_long') .
128 $contains_today =
true;
133 $this->ctrl->setParameterByClass(get_class($this->cmdClass),
'seed',
'');
134 if ($contains_today) {
135 $b2 = $ui->factory()->button()->standard(
$lng->txt(
"today"), $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd))->withUnavailableAction();
137 $b2 = $ui->factory()->button()->standard(
$lng->txt(
"today"), $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd));
142 $this->ctrl->setParameterByClass(get_class($this->cmdClass),
'seed', $this->seed->get(
IL_CAL_DATE));
143 $b3 = $ui->factory()->button()->standard(
$lng->txt(
"next"), $this->ctrl->getLinkTarget($this->cmdClass, $this->cmd));
144 $this->ctrl->setParameterByClass(get_class($this->cmdClass),
'seed',
'');
147 $toolbar->addStickyItem($ui->factory()->viewControl()->section($b1, $b2, $b3));
148 $toolbar->addSeparator();
155 switch ($this->increment) {
160 $this->seed->increment(
IL_CAL_DAY, (31 - $day) * -1);
164 $this->seed->increment($this->increment, $a_count);
static _numericDayToString($a_day, $a_long=true)
get
static _getInstanceByUserId($a_user_id)
get singleton instance
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
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.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
special template class to simplify handling of ITX/PEAR
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.