So, hier mal ein erster Entwurf. Kann man bestimmt noch optimieren und per CSS stylen...
Die erste Tabellenzeile ersetzen durch
PHP-Code:
<tr>
<th colspan="2" class="head previous">
<?php if ($this->prevHref): ?>
<select onChange="window.location.href=this.value">
<?php
$link = utf8_substr($this->prevHref, 0, -6);
$pMonth = utf8_substr($this->prevHref, -2) + 0;
$pYear = utf8_substr($this->prevHref, -6, -2);
for ($i=0; $i<12; $i++)
{
$linkMonth = $pYear;
if ($pMonth < 10)
{
$linkMonth .= '0';
}
$linkMonth .= $pMonth;
$lblMonth = $GLOBALS['TL_LANG']['MONTHS'][($pMonth - 1)].' '.$pYear;
echo '<option value="'.$link.$linkMonth.'">'.$lblMonth.'</option>';
$pMonth--;
if ($pMonth == 0)
{
$pMonth = 12;
$pYear--;
}
}
?>
</select>
<a href="<?php echo $this->prevHref; ?>" title="<?php echo $this->prevTitle; ?>"><</a>
<?php else: ?> <?php endif; ?>
</th>
<th colspan="3" class="head current"><?= $this->current ?></th>
<th colspan="2" class="head next">
<?php if ($this->nextHref): ?>
<a href="<?php echo $this->nextHref; ?>" title="<?php echo $this->nextTitle; ?>">></a>
<select onChange="window.location.href=this.value">
<?php
$link = utf8_substr($this->nextHref, 0, -6);
$pMonth = utf8_substr($this->nextHref, -2) + 0;
$pYear = utf8_substr($this->nextHref, -6, -2);
for ($i=0; $i<12; $i++)
{
$linkMonth = $pYear;
if ($pMonth < 10)
{
$linkMonth .= '0';
}
$linkMonth .= $pMonth;
$lblMonth = $GLOBALS['TL_LANG']['MONTHS'][($pMonth - 1)].' '.$pYear;
echo '<option value="'.$link.$linkMonth.'">'.$lblMonth.'</option>';
$pMonth++;
if ($pMonth > 12)
{
$pMonth = 1;
$pYear++;
}
}
?>
</select>
<?php else: ?> <?php endif; ?>
</th>
</tr>
Das CSS sollte dann vielleicht noch folgendermaßen ergänzt werden:
Code:
th.head
{
white-space: nowrap;
}
Der "Heute"-Knopf ist nicht dabei, aber den hattest du ja schon selbst hinbekommen (falls der jetzt noch nötig sein sollte).
Gruß, folkfreund
Lesezeichen