<table border="0" cellspacing="0" cellpadding="1" width="100%" class="item0">
<tr class="header">
  <td class="header" align="center" colspan="<?php echo $this->totalspan + 3 + count($this->days) ?>">
    <?php echo (!$print_view) ? Horde::link($this->link(-1), _("Last week")) . Horde::img('nav/left.gif', _("Last week"), 'hspace="2"', $GLOBALS['registry']->getParam('graphics', 'horde')) . '</a>' : '' ?>
    <b><?php echo $this->days[$this->startDay]->getTime($prefs->getValue('date_format')) . ' - ' . $this->days[$this->endDay]->getTime($prefs->getValue('date_format')) ?></b>
    <?php echo (!$print_view) ? Horde::link($this->link(1), _("Next week")) . Horde::img('nav/right.gif', _("Next week"), 'hspace="2"', $GLOBALS['registry']->getParam('graphics', 'horde')) . '</a>' : '' ?>
  </td>
</tr>
<tr class="control">
  <td class="control" width="1%" align="center" colspan="3" nowrap="nowrap">&nbsp;</td>

<?php foreach ($this->days as $day): ?>
  <td class="control" width="1%">&nbsp;</td>
  <td class="<?php echo ($day->isToday() ? 'selected' : 'control') ?>" width="<?php echo round(90 / count($this->days)) ?>%" colspan="<?php echo $day->_totalspan ?>" align="center" nowrap="nowrap">
    <?php if (Auth::getAuth()) : ?>
    <?php 
        if (!$print_view) {
            $addurl = Horde::addParameter('addevent.php', 'month', $day->month);
            $addurl = Horde::addParameter($addurl, 'year', $day->year);
            $addurl = Horde::addParameter($addurl, 'mday', $day->mday);
            $addurl = Horde::addParameter($addurl, 'url', Horde::selfURL(true));
            echo Horde::link(Horde::applicationUrl($addurl), _("Create a New Event"));
            echo Horde::img('new.gif', _("Create a New Event"), 'align="left"') . '</a>';
        } ?>
    <?php endif; ?>
    <b><?php echo Horde::link($day->link(), $day->getTime('%A'), 'widget') . $day->getTime('%A, %d.') ?></a></b>
  </td>
<?php endforeach; ?>
</tr>
<tr class="control">
  <td width="1%" align="center" colspan="3" nowrap="nowrap">&nbsp;</td>
<?php foreach ($this->days as $day): ?>
    <td width="1%">&nbsp;</td>
    <?php foreach ($this->_currentCalendars as $cid => $cal): ?>
    <td width="<?php echo floor((90/count($this->days)) / count($this->_currentCalendars)); ?>%" align="center" colspan="<?php echo $day->_span[$cid]; ?>">
      <?php echo $cal->getShareName(); ?>
    </td>
    <?php endforeach; ?>
<?php endforeach; ?>
</tr>
