2019-11-03 15:33:23 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
global $PARAM_AOCCALENDAR;
|
|
|
|
|
2019-11-03 15:44:47 +01:00
|
|
|
$year = $PARAM_AOCCALENDAR['year'];
|
|
|
|
$shownav = $PARAM_AOCCALENDAR['nav'];
|
2019-11-03 15:33:23 +01:00
|
|
|
|
|
|
|
$assocdays = AdventOfCode::listSingleYearAssociative($year);
|
2019-11-03 15:44:47 +01:00
|
|
|
$prev_year = $shownav ? AdventOfCode::getPrevYear($year) : null;
|
|
|
|
$next_year = $shownav ? AdventOfCode::getNextYear($year) : null;
|
2019-11-03 15:33:23 +01:00
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="aoc_calendar_parent">
|
|
|
|
<div class="aoc_calendar">
|
|
|
|
<div class="aoc_calendar_header">
|
|
|
|
<?php
|
|
|
|
if ($prev_year !== null) echo '<a href="' . AdventOfCode::getURLForYear($prev_year) . '" class="aoc_calendar_header_link aoc_prev" ><</a>';
|
|
|
|
else echo '<a href="#" class="aoc_calendar_header_link aoc_prev aoc_link_hidden" ><</a>';
|
|
|
|
|
|
|
|
echo '<span class="aoc_calendar_header_title">'.$year.'</span>';
|
|
|
|
|
|
|
|
if ($next_year !== null) echo '<a href="' . AdventOfCode::getURLForYear($next_year) . '" class="aoc_calendar_header_link aoc_next" >></a>';
|
|
|
|
else echo '<a href="" class="aoc_calendar_header_link aoc_next aoc_link_hidden" >></a>';
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
for ($i=0; $i<5; $i++)
|
|
|
|
{
|
|
|
|
echo '<div class="aoc_calendar_row">'."\n";
|
|
|
|
for ($j=0; $j<5; $j++)
|
|
|
|
{
|
|
|
|
$day = $assocdays[$i*5+$j];
|
|
|
|
if ($day === null) echo '<span class="aoc_calendar_field aoc_disabled">'.($i*5+$j+1).'</span>'."\n";
|
|
|
|
else echo '<a href="'.$day['url'].'" class="aoc_calendar_field aoc_enabled" >'.($i*5+$j+1).'</a>'."\n";
|
|
|
|
}
|
|
|
|
echo '</div>'."\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|