Kalender: Ganzes Jahr darstellen
Hallo zusammen,
ich habe mir aus diversen Posts u.a. https://community.contao.org/de/show...ate-darstellen und https://community.contao.org/de/show...ne-Erweiterung einen Belegungskalender erstellt.
Leider funktioniert das Ganze seit dem Update auf 4.13.16 nicht mehr.
Da ich kein Programmierer bin, kann mir hier jemand helfen?
Vielen Dank für Eure Unterstützung!
VG
Thomas
PHP-Code:
<?php
// current year and month
$nowDate = date('Y',strtotime("01 January now"));
$actualDate1 = $nowDate;
// given year and month
if ($inputMonth = \Input::get('month')) {
$actualDate1 = $inputMonth;
}
$currentYear = intval(substr($actualDate1, 0, 4));
echo '<div class="nav_cal"><ul>';
for ($i=$nowDate;$i<$nowDate+3;$i++) {
if ($i!=$currentYear) {
echo '<li><a href="'.$this->replaceInsertTags('{{link_url::{{page::id}}}}').'?month='.$i.'01">'.$i.'</a></li>';
} else {
echo '<li><span>'.$i.'</span></li>';
}
}
echo '</ul></div>';
// ID of calendar module
$intModuleId = 19;
// current year and month
$actualDate = date('Ym',strtotime("01 January now"));
// given year and month
if ($inputMonth = \Input::get('month'))
{
$actualDate = $inputMonth;
}
// extract year and month
$currentYear = intval(substr($actualDate, 0, 4));
$currentMonth = intval(substr($actualDate, -2));
for( $i = 0; $i <= 11; ++$i )
{
$nextYear = $currentYear;
$nextMonth = $currentMonth + $i;
// next month output
if ($i%3 == 0) echo '<div class="row">';
echo '<div class="col-xs-12 col-sm-4">';
\Input::setGet('month', $nextYear.str_pad($nextMonth, 2, '0', STR_PAD_LEFT));
echo \Controller::getFrontendModule($intModuleId);
echo '</div>';
if ($i%3 == 2) echo '</div>';
}
echo '<div class="nav_cal_mobile"><ul>';
for ($i=$nowDate;$i<$nowDate+3;$i++) {
if ($i!=$currentYear) {
echo '<li><a href="'.$this->replaceInsertTags('{{link_url::{{page::id}}}}').'?month='.$i.'01">'.$i.'</a></li>';
} else {
echo '<li><span>'.$i.'</span></li>';
}
}
echo '</ul></div>';
?>