<? global $user; ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
	<title>Panel Administratora</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<link rel="stylesheet" type="text/css" href="../resources/jq_tooltip/tooltip.css">
	<link rel="Stylesheet" type="text/css" href="../resources/jquery-ui-1.10.3.custom/css/flick/jquery-ui-1.10.4.custom.css" />
	<link rel="Stylesheet" type="text/css" href="../resources/jq_impromptu/jquery-impromptu.css">
	<link rel="Stylesheet" type="text/css" href="../resources/jquery.contextMenu/jquery.contextMenu.css">
  <link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Duru+Sans&subset=latin,latin-ext'>
  <link href='http://fonts.googleapis.com/css?family=Titillium+Web:400,200,200italic,300,300italic,400italic,600,600italic,700,700italic,900&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<script type="text/javascript" src="../resources/jquery-ui-1.10.3.custom/js/jquery-1.8.2.min.js"></script>
	<script type="text/javascript" src="../resources/jquery-ui-1.10.3.custom/js/jquery-ui-1.8.24.custom.min.js"></script>
	<script type="text/javascript" src="../resources/jlnav-master/jquery.jlnav.js"></script>
	<script type="text/javascript" src="../resources/jquery.contextMenu/jquery.contextMenu-custom.js"></script>
	<script type="text/javascript" src="../resources/ckeditor-4.0/ckeditor.js"></script>
	<script type="text/javascript" src="../resources/ckeditor-4.0/adapters/jquery.js"></script>
	<script type="text/javascript" src="../resources/jq_impromptu/jquery-impromptu.3.1.min.js"></script>
	<script type="text/javascript" src="../resources/jquery/jquery.ui.datepicker-pl.js"></script>
  <script type="text/javascript" src="../resources/jquery.mjs.nestedSortable.js"></script>
  <script type="text/javascript" src="../resources/jquery/jquery.tinycarousel.min.js"></script>
	<script type="text/javascript" src="../resources/jq_tooltip/tooltip.js"></script>
	<script type="text/javascript" src="../resources/javascript.js"></script>
  <script type="text/javascript">
    String.prototype.escapeDiacritics = function()
    {
        return this.replace(/ą/g, 'a').replace(/Ą/g, 'A')
            .replace(/ć/g, 'c').replace(/Ć/g, 'C')
            .replace(/ę/g, 'e').replace(/Ę/g, 'E')
            .replace(/ł/g, 'l').replace(/Ł/g, 'L')
            .replace(/ń/g, 'n').replace(/Ń/g, 'N')
            .replace(/ó/g, 'o').replace(/Ó/g, 'O')
            .replace(/ś/g, 's').replace(/Ś/g, 'S')
            .replace(/ż/g, 'z').replace(/Ż/g, 'Z')
            .replace(/ź/g, 'z').replace(/Ź/g, 'Z');
    }

    function urlTitleChars(text) {       
      var characters = ['"', "'"];

      for (var i = 0; i < characters.length; i++) {
          var char = String(characters[i]);
          text = text.replace(new RegExp("\\" + char, "g"), '');
      }
      text = text.toLowerCase();
      text = text.escapeDiacritics();
      return text;
    }

    function urlTitle(text) {       
      var characters = [' ', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '+', '=', '_', '{', '}', '[', ']', '|', '/', '<', '>', ',', '.', '?', '--'];

      for (var i = 0; i < characters.length; i++) {
          var char = String(characters[i]);
          text = text.replace(new RegExp("\\" + char, "g"), '-');
      }
      text = text.toLowerCase();
      text = text.escapeDiacritics();
      return text;
    }
  </script>
  <? if ( $user && $user -> _values['admin'] ):?>
    <script type="text/javascript">
      $(document).ready(function() {
        $( "#main-manu-container" ).jlnav(); 
      });
    </script>
    <?
      global $xajax;
      $xajax -> printJavascript( '../resources/xajax/' );
    ?>
  <? endif;?>
</head>
<body>
  <div id='page-header'>
    <a href='./' id="logo">proCMS</a>
    <? if ( $user ):?>
      <a id="logout" href="./?rw=user_logout">wyloguj</a>
    <? endif;?>
  </div>
  <? if ( $user && $user -> _values['admin'] ):?>
    <div id="main-manu-container">
      <ul id="main-menu">
        <li>
          <a href="./?p=page_articles">Zawartość</a>
          <ul>
            <li>
              <a href="./?p=page_definition">lista stron</a>
            </li>
            <li>
              <a href="./?p=page_articles">lista artykułów</a>
            </li>
            <li>
              <a href="./?p=page_article_sort">sortowanie artykułów</a>
            </li>
            <li>
              <a href="./?p=article_archive">archiwum artykułów</a>
            </li>
            <li>
              <a href="./?p=static_containers">zawartość statyczna</a>
            </li>
          </ul>
        </li>
        <li>
          <a href="./?p=filemanager">Pozostałe</a>
          <ul>
            <li>
              <a href="./?p=filemanager">manager plików</a>
            </li>
            <li>
              <a href="./?p=guest_book">księga gości</a>
            </li>
            <li>
              <a href="./?p=banner">banery</a>
            </li>
            <li>
              <a href="./?p=adverts">reklama</a>
            </li>
            <li>
              <a href="./?p=banned_email">zakazane emaile</a>
            </li>
            <li>
              <a href="./?p=banned_login">zakazane loginy</a>
            </li>
            <li>
              <a href="./?p=newsletter_emails">newsletter - emaile</a>
            </li>
          </ul>
        </li>
        <li>
          <a href="./?p=settings">Konfiguracja</a>
          <ul>
            <li>
              <a href="./?p=users">użytkownicy</a>
            </li>
            <li>
              <a href="./?p=admins">administratorzy</a>
            </li>
            <li>
              <a href="./?p=lang">języki</a>
            </li>
            <li>
              <a href="./?p=translation">tłumaczenia</a>
            </li>
            <li>
              <a href="./?p=settings">ustawienia</a>
            </li>
            <li>
              <a href="./?p=layout">szablony</a>
            </li>
          </ul>
        </li>
        <li>
          <a href="/" target="_blank" id="nav-look">Podgląd</a>
        </li>
      </ul>
    </div>
  <? endif;?>  
  <div id="page-main">
    <?
    if ( $this -> _alert )
    {
      \System::deleteSessionVar( 'alert' );
      ?>
      <div id="alert" class="alert">
        <?= $this -> _alert;?>
      </div>
      <?
    }
    echo $this -> _content;
    ?>
  </div>
</body>
</html>