<?php declare(strict_types=1); ?>

<!doctype html>
<html lang="<?php echo $tfPreference->escapeForXss('defaultLanguage'); ?>">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">    
    <meta name="description" content="<?php echo $tfMetadata->description; ?>">
    <meta name="author" content="<?php echo $tfMetadata->author; ?>">
    <meta name="dcterms.rights" content="<?php echo $tfMetadata->copyright; ?>">
    <meta name="robots" content="<?php echo $tfMetadata->robots; ?>">
    <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo TFISH_URL . 'rss.php'; ?>" />
    <link rel="schema.dcterms" href="http://purl.org/dc/terms/">
    
    <!-- Favicons -->
    <link rel="apple-touch-icon" sizes="180x180" href="<?php echo TFISH_URL . 'apple-touch-icon.png'; ?>">
    <link rel="icon" type="image/png" sizes="32x32" href="<?php echo TFISH_URL . 'favicon-32x32.png'; ?>">
    <link rel="icon" type="image/png" sizes="16x16" href="<?php echo TFISH_URL . 'favicon-16x16.png'; ?>">
    <link rel="manifest" href="<?php echo TFISH_URL . 'site.webmanifest'; ?>">
    <link rel="mask-icon" href="<?php echo TFISH_URL . 'safari-pinned-tab.svg'; ?>" color="#5bbad5">
    <meta name="msapplication-TileColor" content="#da532c">
    <meta name="theme-color" content="#ffffff">

    <title><?php echo $tfMetadata->title; ?></title>
    
    <!-- jQuery -->
    <script src="<?php echo TFISH_JS_URL . 'jquery/jquery.min.js'; ?>"></script>
    
    <!-- Popper -->
    <script src="<?php echo TFISH_JS_URL . 'popper/popper.min.js'; ?>"></script>
    
    <!-- Bootstrap -->
    <link href="<?php echo TFISH_JS_URL . 'bootstrap/css/bootstrap.min.css'; ?>" rel="stylesheet">
    <script src="<?php echo TFISH_JS_URL . 'bootstrap/js/bootstrap.min.js'; ?>"></script>
    
    <!-- Font Awesome -->
    <script defer src="<?php echo TFISH_JS_URL . 'fontawesome/fontawesome-all.min.js'; ?>"></script>

    <!-- Custom styles for this template -->
    <link href="<?php echo TFISH_THEMES_URL . 'default/style.css'; ?>" rel="stylesheet">
  </head>

  <body>

    <!-- Navigation -->
    <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
      <a class="navbar-brand" href="<?php echo TFISH_URL; ?>"><?php echo $tfPreference->escapeForXss('siteName'); ?></a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>

      <div class="collapse navbar-collapse" id="navbarsExampleDefault">
        <ul class="navbar-nav mr-auto">
          <?php if (TfSession::isAdmin()): ?>
          <li class="nav-item active"><a class="nav-link"  href="<?php echo TFISH_ADMIN_URL . 'admin.php'; ?>"><?php echo TFISH_ADMIN; ?></a></li>
          <?php endif; ?>
          <li class="nav-item">
            <a class="nav-link" href="<?php echo TFISH_URL . 'gallery.php'; ?>"><?php echo TFISH_IMAGE_GALLERY; ?></a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Link</a>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="http://example.com" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
            <div class="dropdown-menu" aria-labelledby="dropdown01">
              <a class="dropdown-item" href="#">Action</a>
              <a class="dropdown-item" href="#">Another action</a>
              <a class="dropdown-item" href="#">Something else here</a>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="<?php echo TFISH_RSS_URL; ?>"><i class="fas fa-rss"></i></a>
          </li>
        </ul>
          <form class="form-inline my-2 my-lg-0" method="post" accept-charset="UTF-8" action="<?php echo TFISH_URL . 'search.php'; ?>">
            <input class="form-control mr-sm-2" id="searchTerms" name="searchTerms" type="text" placeholder="<?php echo TFISH_KEYWORDS; ?>" aria-label="<?php echo TFISH_KEYWORDS; ?>">
            <input type="hidden" name="op" value="search" />
            <input type="hidden" name="searchType" value="AND" />
          <button class="btn btn-outline-success my-2 my-sm-0" type="submit"><?php echo TFISH_SEARCH; ?></button>
        </form>
      </div>
    </nav>

    <main role="main" class="container">

      <div class="starter-template">

        <!-- Main page -->
        <?php echo $tfTemplate->render('main'); ?>
        
        <!-- Footer -->
        <div class="row">
          <div class="col">
            <hr>
            <footer class="clearfix">
              <p class="copyright">Copyright &copy; <?php echo $tfPreference->escapeForXss('siteAuthor'); ?> 2018 | <?php echo TfSession::getLoginLink(); ?></p>
            </footer>
          </div>
        </div>
        
      </div>
        
    </main><!-- /.container -->
    
  </body>
</html>
