<? global $user, $config, $settings;?>
<!DOCTYPE html>
<html>
  <head>
    <title>cmsPro</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="www.project-pro.pl - internetowe rozwiązania dla biznesu">
    <link rel="stylesheet" href="/libraries/framework/admin-tools/admin-forms/css/admin-forms.css">
    <link rel="stylesheet" href="/libraries/framework/vendor/plugins/magnific/magnific-popup.css">
    <link rel="stylesheet" href="/libraries/framework/vendor/plugins/datepicker/css/bootstrap-datetimepicker.css">
    <link rel="Stylesheet" type="text/css" href="/libraries/framework/vendor/jquery/jquery_ui/jquery-ui.structure.min.css">
    <link rel="Stylesheet" type="text/css" href="/libraries/framework/vendor/jquery/jquery_ui/jquery-ui.theme.min.css">
    <link rel="Stylesheet" type="text/css" href="/libraries/framework/vendor/plugins/daterange/daterangepicker.css">
    <link rel="stylesheet" type="text/css" href="/libraries/easy-tabs/css/easy-responsive-tabs.css">
    <link rel="stylesheet" type="text/css" href="/libraries/framework/vendor/plugins/tagmanager/tagmanager.css">
    <link rel="stylesheet" type="text/css" href="/libraries/jquery-confirm/jquery-confirm.min.css">
    <link rel="stylesheet" href="/libraries/framework/skin/default_skin/css/theme.css">
    <script src="/libraries/framework/vendor/jquery/jquery-1.11.1.min.js"></script>
    <script src="/libraries/framework/vendor/jquery/jquery_ui/jquery-ui.min.js"></script>
    <script src="/libraries/framework/vendor/plugins/magnific/jquery.magnific-popup.js"></script>
    <script type="text/javascript" src="/libraries/jquery-confirm/jquery-confirm.min.js"></script>
    <script src="/libraries/easy-tabs/js/easyResponsiveTabs.js"></script>
    <script src="/libraries/framework/vendor/plugins/moment/moment.js"></script>
    <script src="/libraries/framework/vendor/plugins/moment/pl.js"></script>
    <script src="/libraries/framework/vendor/plugins/datepicker/js/bootstrap-datetimepicker.js"></script>
    <script src="/libraries/framework/vendor/plugins/daterange/daterangepicker.js"></script>
    <script src="/libraries/framework/vendor/plugins/tagmanager/tagmanager.js"></script>
    <script src="/libraries/functions.js"></script>
    <link rel="stylesheet" href="/admin/css/custom.css" />
  </head>
  <body class="sb-top sb-top-sm">
    <div class="menu-left">
      <div class="logo sticky-top">
        <a class="logo-cmspro" href="/admin/pages/view_list/">
          <b>cms</b>Pro
        </a>
        <a class="version-cmspro"href="/admin/update/main_view/">
          ver. <?= \S::get_version();?>
        </a>

        <? if ( $settings[ 'update' ] and \S::get_new_version() > \S::get_version() ):?>
          <a href="/admin/update/main_view/" class="update-cmspro">aktualizacja</a>
        <? endif;?>
      </div>
      <div class="menu-content">
        <?
        if ( \admin\factory\Users::check_privileges( 'page_administration', $user[ 'id' ] ) || \admin\factory\Users::check_privileges( 'article_administration', $user[ 'id' ] ) || \admin\factory\Users::check_privileges( 'scontainer_administration', $user[ 'id' ] ) )
        {
          ?>
          <div class="title">
            Zawartość
          </div>
        <? }?>
        <ul>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'page_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/pages/view_list/"><img src="/admin/css/icons/menu-alt.svg">Konfiguracja menu</a>
            <? }?>
          </li>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'article_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/articles/view_list/"><img src="/admin/css/icons/bx-news.svg">Artykuły</a>
            <? }?>
          </li>
          <? if ( \admin\factory\Users::check_privileges( 'article_administration', $user[ 'id' ] ) ):?>
            <li>
              <a href="/admin/articles_archive/view_list/"><img src="/admin/css/icons/news-24-regular.svg">Archiwum artykułów</a>
            </li>
          <? endif;?>
          <? if ( \admin\factory\Users::check_privileges( 'article_administration', $user[ 'id' ] ) ):?>
            <li>
              <a href="/admin/authors/view_list/"><img src="/admin/css/icons/people-fill.svg">Autorzy</a>
            </li>
          <? endif;?>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'scontainers_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/scontainers/view_list/"><img src="/admin/css/icons/container-solid.svg">Zawartość statyczna</a>
            <? }?>
          </li>
        </ul>
        <?
        if ( \admin\factory\Users::check_privileges( 'fileManager_administration', $user[ 'id' ] ) || \admin\factory\Users::check_privileges( 'baners_administration', $user[ 'id' ] ) || \admin\factory\Users::check_privileges( 'emails_administration', $user[ 'id' ] ) )
        {
          ?>
          <div class="title">
            Pozostałe
          </div>
        <? }?>
        <ul>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'fileManager_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/filemanager/draw/"><img src="/admin/css/icons/image.svg">Manadżer plików</a>
            <? }?>
          </li>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'baners_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/banners/view_list/"><img src="/admin/css/icons/photo-video.svg">Banery</a>
            <? }?>
          </li>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'emails_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/emails/view_list/"><img src="/admin/css/icons/email.svg">Skrzynka pocztowa</a>
            <? }?>
          </li>
        </ul>
        <?
        if ( \admin\factory\Users::check_privileges( 'newsletter_administration', $user[ 'id' ] ) )
        {
          ?>

          <div class="title">
            Newsletter
          </div>
          <ul>
            <li>
              <a href="/admin/newsletter/prepare/"><img src="/admin/css/icons/send.svg">Wysyłka - przygotowanie</a>
            </li>
            <li>
              <a href="/admin/newsletter/emails_list/"><img src="/admin/css/icons/bx-at.svg">Baza emaili</a>
            </li>
            <li>
              <a href="/admin/newsletter/email_templates_user/"><img src="/admin/css/icons/template.svg">Szablony użytkownika</a>
            </li>
            <li>
              <a href="/admin/newsletter/email_templates_admin/"><img src="/admin/css/icons/template-2.svg">Szablony administracyjne</a>
            </li>
            <li>
              <a href="/admin/newsletter/settings/"><img src="/admin/css/icons/settings-20-filled.svg">Ustawienia</a>
            </li>

          </ul>
        <? }?>

        <?
        if ( \admin\factory\Users::check_privileges( 'users_administration', $user[ 'id' ] ) || \admin\factory\Users::check_privileges( 'language_administration', $user[ 'id' ] ) || \admin\factory\Users::check_privileges( 'template_administration', $user[ 'id' ] ) || \admin\factory\Users::check_privileges( 'settings_administration', $user[ 'id' ] ) )
        {
          ?>
          <div class="title">
            Konfiguracja
          </div>

        <? }?>
        <ul>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'users_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/users/view_list/"><img src="/admin/css/icons/people-fill.svg">Użytkownicy</a>
            <? }?>
          </li>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'language_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/languages/view_list/"><img src="/admin/css/icons/letter-aa.svg">Jęzki</a>
            <? }?>
          </li>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'language_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/languages/translation_list/"><img src="/admin/css/icons/language.svg">Tłumaczenia</a>
            <? }?>
          </li>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'settings_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/settings/view/"><img src="/admin/css/icons/settings-20-filled.svg">Ustawienia</a>
            <? }?>
          </li>
          <li>
            <?
            if ( \admin\factory\Users::check_privileges( 'template_administration', $user[ 'id' ] ) )
            {
              ?>
              <a href="/admin/layouts/view_list/"><img src="/admin/css/icons/list-settings-line.svg">Szablony</a>
            <? }?>
          </li>
          <li>
            <? if ( \admin\factory\Users::check_privileges( 'backups_administration', $user[ 'id' ] ) ):?>
              <a href="/admin/backups/view_list/"><img src="/admin/css/icons/backup-line.svg">Kopia zapasowa</a>
            <? endif;?>
          </li>
          <li>
            <? if ( \admin\factory\Users::check_privileges( 'seo_administration', $user[ 'id' ] ) ):?>
              <a href="/admin/seo_additional/main_view/">
                <img src="/admin/css/icons/settings-20-filled.svg">Dodatkowe ustawienia SEO
              </a>
            <? endif;?>
          </li>
        </ul>
        <?
          if ( file_exists( 'templates/additional-menu.php' ) )
            include 'templates/additional-menu.php';
        ?>

        <div class="preview">
          <a href="/" target="_blank"><img src="/admin/css/icons/double-right-outlined.svg">Podgląd</a>
        </div>



      </div>

    </div>
    <div class="mobile-menu-btn" id="mobile-menu-btn">
      <i class="fa fa-bars"></i>
    </div>

    <div class="site-content" id="main">
      <header class="navbar navbar-shadow">
        <div class="navbar-branding">
          <a class="navbar-brand" href="/admin/pages/view_list/">
            <b>cms</b>Pro
          </a>


        </div>
        <div class="nav navbar-nav navbar-right">
          <li class="dropdown menu-merge">
            <a href="#" class="dropdown-toggle fw600 p15" data-toggle="dropdown" aria-expanded="false">
              <img src="/admin/css/user-icon.png" alt="avatar" class="mw30 br64 mr15"> <?
              if ( $user[ 'name' ] or $user[ 'surname' ] )
                echo $user[ 'surname' ] . ' ' . $user[ 'name' ];
              else
                echo $user[ 'login' ];
              ?>
              <span class="caret caret-tp hidden-xs"></span>
            </a>
            <ul class="dropdown-menu list-group dropdown-persist w250" role="menu">
              <li class="list-group-item">
                <a href="/admin/?s-action=user-logout" class="animated animated-short fadeInUp">
                  <span class="fa fa-power-off"></span>Wyloguj się
                </a>
              </li>
            </ul>
          </li>

        </div>
      </header>

      <section id="content_wrapper">
        <section id="content">
          <div class="container-fluid">
          <?
          if ( $alert = \S::get_session( 'alert' ) ):
            \S::alert( false );
            ?>
            <div class="row">
              <div class="col col-xs-12">
                <div class="alert alert-primary alert-dismissable">
                  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                  <i class="fa fa-info pr10"></i>
                  <?= $alert;?>
                </div>
              </div>
            </div>
          <? endif;
          ?>
          <?= $this -> content;?>
          </div>
        </section>
      </section>
    </div>

    <div id="overlay"></div>
    <div id="ajax-container"></div>
    <script src="/libraries/framework/js/utility/utility.js"></script>
    <script src="/libraries/framework/js/main.js"></script>
    <script type="text/javascript">
      jQuery(document).ready(function ()
      {
        "use strict";
        Core.init();
      });
    </script>
    <script type="text/javascript">
      $(document).ready(function () {
        var user_agent = navigator.userAgent.toLowerCase();
        var click_event = user_agent.match(/(iphone|ipod|ipad)/) ? "touchend" : "click";
        $('body').on(click_event, '#mobile-menu-btn', function () {

          if ($(this).hasClass('active'))
          {
            $(this).removeClass('active');
            $('.menu-left').removeClass('visible');
            $('#mobile-menu-btn i').addClass('fa-bars').removeClass('fa-times');
            $('.site-content').removeClass('with-menu');

              $('.navbar-branding').removeClass('with-menu');
          } else
          {
            $(this).addClass('active');
            $('.menu-left').addClass('visible');
            $('.site-content').addClass('with-menu');
            $('#mobile-menu-btn i').addClass('fa-times').removeClass('fa-bars');
             $('.navbar-branding').addClass('with-menu');
          }
        });
      });
    </script>
    <link rel='stylesheet' href='//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700'>
  </body>
</html>

