<!DOCTYPE html>
<html lang="<?= $this->language ?>">
<head>

  <meta charset="<?= $this->charset ?>">
  <title><?= $this->title ?> - Contao Open Source CMS <?= VERSION ?></title>
  <base href="<?= $this->base ?>">
  <meta name="generator" content="Contao Open Source CMS">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <meta name="referrer" content="origin">

  <?php if ($this->loadFonts): ?>
    <link rel="stylesheet" href="<?= TL_ASSETS_URL ?>system/themes/<?= $this->theme ?>/fonts.css">
  <?php endif; ?>
  <link rel="stylesheet" href="<?php
    $objCombiner = new Combiner();
    $objCombiner->add('assets/mootools/colorpicker/'. $GLOBALS['TL_ASSETS']['COLORPICKER'] .'/css/mooRainbow.css', $GLOBALS['TL_ASSETS']['COLORPICKER']);
    $objCombiner->add('assets/mootools/chosen/chosen.css');
    $objCombiner->add('assets/mootools/stylect/css/stylect.css');
    $objCombiner->add('assets/mootools/simplemodal/'. $GLOBALS['TL_ASSETS']['SIMPLEMODAL'] .'/css/simplemodal.css', $GLOBALS['TL_ASSETS']['SIMPLEMODAL']);
    $objCombiner->add('assets/mootools/datepicker/'. $GLOBALS['TL_ASSETS']['DATEPICKER'] .'/datepicker.css', $GLOBALS['TL_ASSETS']['DATEPICKER']);
    $objCombiner->add('system/themes/'. $this->theme .'/basic.css');
    $objCombiner->add('system/themes/'. $this->theme .'/main.css');
    echo $objCombiner->getCombinedFile();
  ?>">
  <!--[if IE]><link rel="stylesheet" href="<?= TL_ASSETS_URL ?>system/themes/<?= $this->theme ?>/iefixes.css"><![endif]-->
  <?= $this->stylesheets ?>

  <script><?= $this->getLocaleString() ?></script>
  <script src="<?php
    $objCombiner = new Combiner();
    $objCombiner->add('assets/mootools/core/' . $GLOBALS['TL_ASSETS']['MOOTOOLS'] . '/mootools.js', $GLOBALS['TL_ASSETS']['MOOTOOLS']);
    $objCombiner->add('assets/mootools/colorpicker/'. $GLOBALS['TL_ASSETS']['COLORPICKER'] .'/js/mooRainbow.js', $GLOBALS['TL_ASSETS']['COLORPICKER']);
    $objCombiner->add('assets/mootools/chosen/chosen.js');
    $objCombiner->add('assets/mootools/stylect/js/stylect.js');
    $objCombiner->add('assets/mootools/simplemodal/'. $GLOBALS['TL_ASSETS']['SIMPLEMODAL'] .'/js/simplemodal.js', $GLOBALS['TL_ASSETS']['SIMPLEMODAL']);
    $objCombiner->add('assets/mootools/datepicker/'. $GLOBALS['TL_ASSETS']['DATEPICKER'] .'/datepicker.js', $GLOBALS['TL_ASSETS']['DATEPICKER']);
    $objCombiner->add('assets/mootools/mootao/Mootao.js');
    $objCombiner->add('assets/contao/js/core.js');
    $objCombiner->add('system/themes/'. $this->theme .'/hover.js');
    echo $objCombiner->getCombinedFile();
  ?>"></script>
  <script><?= $this->getDateString() ?></script>
  <?= $this->javascripts ?>
  <!--[if lt IE 9]><script src="<?= TL_ASSETS_URL ?>assets/html5shiv/<?= $GLOBALS['TL_ASSETS']['HTML5SHIV'] ?>/html5shiv.min.js"></script><![endif]-->

</head>
<body id="top" class="<?= $this->ua ?><?php if ($this->isPopup) echo ' popup'; ?>">

  <?php if (!$this->isPopup): ?>
    <div id="header" class="collapsible<?php if ($this->isCoreOnlyMode || $this->isMaintenanceMode || $this->needsCacheBuild) echo ' xpnd'; ?>">
      <h1>Contao Open Source CMS <?= VERSION . '.' . BUILD ?></h1>
      <div class="collapsible_area">
        <div id="tmenu">
          <span class="header_user_container"><a href="<?= $this->base ?>contao/main.php?do=login&amp;ref=<?= TL_REFERER_ID ?>" class="header_user" title="<?= $this->account ?>"><?= $this->username ?></a></span>
          <span class="header_preview_container"><a href="contao/preview.php<?= $this->frontendFile ?>" target="_blank" class="header_preview" title="<?= $this->previewTitle ?>" accesskey="f"><?= $this->preview ?></a></span>
          <span class="header_home_container"><a href="<?= $this->base ?>contao/main.php" class="header_home" title="<?= $this->homeTitle ?>" accesskey="h"><?= $this->home ?></a></span>
          <span class="header_logout_container"><a href="<?= $this->base ?>contao/" class="header_logout" title="<?= $this->logoutTitle ?>" accesskey="q"><?= $this->logout ?></a></span>
        </div>
        <?php if ($this->isCoreOnlyMode): ?>
          <p class="tl_error tl_permalert"><?php if ($this->isAdmin): ?><a href="<?= $this->coreOnlyHref ?>" class="tl_submit"><?= $this->coreOnlyOff ?></a><?php endif; ?><?= $this->coreOnlyMode ?></p>
        <?php endif; ?>
        <?php if ($this->isMaintenanceMode): ?>
          <p class="tl_error tl_permalert"><?php if ($this->isAdmin): ?><a href="<?= $this->maintenanceHref ?>" class="tl_submit"><?= $this->maintenanceOff ?></a><?php endif; ?><?= $this->maintenanceMode ?></p>
        <?php endif; ?>
        <?php if ($this->needsCacheBuild): ?>
          <p class="tl_error tl_permalert"><?php if ($this->isAdmin): ?><a href="<?= $this->buildCacheHref ?>" class="tl_submit"><?= $this->buildCacheLink ?></a><?php endif; ?><?= $this->buildCacheText ?></p>
        <?php endif; ?>
      </div>
    </div>
  <?php endif; ?>

  <div id="container">

    <?php if (!$this->isPopup): ?>
      <div id="left">
        <div id="tl_navigation" class="collapsible">
          <h1><?= $this->backendModules ?></h1>
          <a href="<?= $this->request ?>#skipNavigation" class="invisible"><?= $this->skipNavigation ?></a>
          <ul class="tl_level_1 collapsible_area">
            <?php foreach ($this->modules as $strGroup=>$arrModules): ?>
              <li class="tl_level_1_group<?= $arrModules['class'] ?>"><a href="<?= $arrModules['href'] ?>" title="<?= $arrModules['title'] ?>" onclick="return AjaxRequest.toggleNavigation(this,'<?= $strGroup ?>')"><?= Image::getHtml($arrModules['icon']) ?><?= $arrModules['label'] ?></a></li>
              <?php if ($arrModules['modules']): ?>
                <li class="tl_parent" id="<?= $strGroup ?>">
                  <ul class="tl_level_2">
                    <?php foreach ($arrModules['modules'] as $arrConfig): ?>
                      <li><a href="<?= $arrConfig['href'] ?>" class="<?= $arrConfig['class'] ?>" title="<?= $arrConfig['title'] ?>"<?= $arrConfig['icon'] ?>><?= $arrConfig['label'] ?></a></li>
                    <?php endforeach; ?>
                  </ul>
                </li>
              <?php endif; ?>
            <?php endforeach; ?>
          </ul>
          <a id="skipNavigation" class="invisible">&nbsp;</a>
        </div>
      </div>
    <?php endif; ?>

    <div id="main">
      <h1 class="main_headline"><?= $this->headline ?></h1>
      <?php if ($this->managerHref): ?>
        <div id="manager">
          <a href="<?= $this->managerHref ?>" class="close" title="<?= specialchars($this->manager) ?>"><?= $this->manager ?></a>
        </div>
      <?php endif; ?>
      <?php if ($this->error): ?>
        <p class="tl_gerror"><?= $this->error ?></p>
      <?php endif; ?>
      <?= $this->main ?>
    </div>

    <div class="clear"></div>

  </div>

  <?php if (!$this->isPopup): ?>
    <div id="footer">
      <div>
        <span class="footer_top_container"><a href="<?= $this->request ?>#top" class="footer_top" title="<?= $this->backToTop ?>" accesskey="t"><?= $this->top ?></a></span>
        <span class="footer_preview_container"><a href="contao/preview.php<?= $this->frontendFile ?>" target="_blank" class="footer_preview" title="<?= $this->previewTitle ?>"><?= $this->preview ?></a></span>
      </div>
    </div>

    <?php if ($this->pageOffset): ?>
      <script>Backend.vScrollTo($('paste_hint') ? <?= $this->pageOffset + 20 ?> : <?= $this->pageOffset ?>)</script>
      <?php System::setCookie('BE_PAGE_OFFSET', 0, 0); ?>
    <?php endif; ?>
  <?php endif; ?>

  <?= $this->mootools ?>

</body>
</html>