
<div id="tl_soverview">

  <?php if (!empty($this->messages)): ?>
    <div id="tl_messages">
      <h2><?= $this->systemMessages ?></h2>
      <?= $this->messages ?>
    </div>
  <?php endif; ?>

  <div id="tl_shortcuts">
    <h2><?= $this->shortcuts ?></h2>
    <p><?= $this->shortcutsLink ?></p>
  </div>

  <div id="tl_versions">
    <h2><?= $GLOBALS['TL_LANG']['MSC']['latestChanges'] ?></h2>
    <?php if (!empty($this->versions)): ?>
      <table class="tl_listing">
      <thead>
        <tr>
          <th><?= $GLOBALS['TL_LANG']['MSC']['date'] ?></th>
          <th><?= $GLOBALS['TL_LANG']['MSC']['user'] ?></th>
          <th><?= $GLOBALS['TL_LANG']['MSC']['table'] ?></th>
          <th>ID</th>
          <th><?= $GLOBALS['TL_LANG']['MSC']['description'] ?></th>
          <th><?= $GLOBALS['TL_LANG']['MSC']['version'] ?></th>
          <th>&nbsp;</th>
        </tr>
      </thead>
      <tbody>
        <?php foreach ($this->versions as $version): ?>
          <tr class="<?= $version['class'] ?> click2edit" onmouseover="Theme.hoverRow(this,1)" onmouseout="Theme.hoverRow(this,0)">
            <td><?= $version['date'] ?></td>
            <td><?= $version['username'] ?: '-' ?></td>
            <td><?= $version['shortTable'] ?></td>
            <td><?= $version['pid'] ?></td>
            <td><?= $version['description'] ?: '-' ?></td>
            <td><?= $version['active'] ? '<strong>' . $version['version'] . '</strong>' : $version['version'] ?></td>
            <td>
              <?php if ($version['deleted']): ?>
                <a href="contao/main.php?do=undo" title="<?= specialchars($GLOBALS['TL_LANG']['MSC']['restore']) ?>"><?= Image::getHtml('undo.gif', '', 'class="undo"') ?></a>
              <?php else: ?>
                <?php if ($version['editUrl'] != ''): ?>
                  <a href="<?= $version['editUrl'] ?>" title="<?= $this->editElement ?>" class="edit"><?= Image::getHtml('edit.gif', '', 'style="padding:0 2px"') ?></a>
                <?php else: ?>
                  <?= Image::getHtml('edit_.gif', '', 'style="padding:0 2px"') ?>
                <?php endif; ?>
                <?php if ($version['to'] > 1): ?>
                  <a href="<?= $version['editUrl'] ?>&amp;from=<?= $version['from'] ?>&amp;to=<?= $version['to'] ?>&amp;versions=1&amp;popup=1" title="<?= $this->showDifferences ?>" onclick="Backend.openModalIframe({'width':768,'title':'<?= $this->showDifferences ?>','url':this.href});return false"><?= Image::getHtml('diff.gif') ?></a>
                <?php else: ?>
                  <?= Image::getHtml('diff_.gif') ?>
                <?php endif; ?>
              <?php endif; ?>
            </td>
          </tr>
        <?php endforeach; ?>
      </tbody>
      </table>
      <?= $this->pagination ?>
    <?php else: ?>
      <p><?= $GLOBALS['TL_LANG']['MSC']['noVersions'] ?></p>
    <?php endif; ?>
  </div>

</div>
