<?php

/**
 * Contao Repository :: Template to uninstall an extension
 * @copyright  Peter Koch 2008-2010
 * @author     Peter Koch, IBK Software AG
 * @license    See accompaning file LICENSE.txt
 */

$rep = &$this->rep;
$theme = &$rep->theme;
$text = &$GLOBALS['TL_LANG']['tl_repository'];

?>

<div id="tl_buttons">
  <a href="<?= $rep->homeLink ?>" class="header_back" title="<?= $text['goback'] ?>" accesskey="b" onclick="Backend.getScrollOffset()"><?= $text['goback'] ?></a>
</div>

<h2 class="sub_headline"><?= $text['uninstallextension'] ?></h2>

<div class="mod_repository">
  <form action="<?= $rep->f_link ?>" id="repository_editform" method="post">
    <div class="tl_formbody_edit">
      <input type="hidden" name="repository_action" value="<?= $rep->f_action ?>">
      <input type="hidden" name="repository_stage" value="<?= $rep->f_stage ?>">
      <input type="hidden" name="repository_extension" value="<?= $rep->f_extension ?>">
      <input type="hidden" name="REQUEST_TOKEN" value="<?= REQUEST_TOKEN ?>">
      <div class="tl_tbox">
        <?= $theme->createImage('stop128', 'STOP!') ?>
        <?php if (count($rep->deps)): ?>
          <div class="warning">
            <?= sprintf($text['dependentsdel'], $rep->f_extension) ?>
          </div>
          <table class="autowidth">
            <tr>
              <th><?= $text['name'][0] ?></th>
              <th><?= $text['version'][0] ?></th>
              <th><?= $text['build'] ?></th>
            </tr>
            <?php foreach ($rep->deps as $dep): ?>
              <tr>
                <td><?= $dep->extension ?></td>
                <td><?= Repository::formatVersion($dep->version) ?></td>
                <td><?= $dep->build ?></td>
              </tr>
            <?php endforeach; ?>
          </table>
        <?php endif; ?>
        <?php if ($rep->f_stage==$rep->uist_confirm): ?>
          <div class="question">
            <?= sprintf($text['okuninstextension'], $rep->f_extension) ?>
          </div>
        <?php endif; ?>
      </div>
      <?php if ($rep->f_stage>=$rep->uist_showlog): ?>
        <div class="installlog">
          <?= $rep->log ?>
        </div>
      <?php endif; ?>
    </div>
    <div class="mod_repository_submit tl_formbody_submit">
      <div class="tl_submit_container">
        <?php if (property_exists($rep, 'f_submit')): ?>
          <input type="submit" name="repository_submitbutton" class="tl_submit" value="<?= $text[$rep->f_submit] ?>">
        <?php endif; ?>
        <input type="submit" name="repository_cancelbutton" class="tl_submit" value="<?= $text['cancel'] ?>">
      </div>
    </div>
  </form>
</div>
