<?php
/**
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         0.10.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */

$cakeDescription = 'CakePHP: the rapid development php framework';
?>
<!DOCTYPE html>
<html>
<head>
    <?= $this->Html->charset() ?>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>
        <?= $cakeDescription ?>:
        <?= $this->fetch('title') ?>
    </title>
    <?= $this->Html->meta('icon') ?>

    <?= $this->Html->css('base.css') ?>
    <?= $this->Html->css('cake.css') ?>
    <?= $this->Html->css('default.css') ?>

    <?= $this->fetch('meta') ?>
    <?= $this->fetch('css') ?>
    <?= $this->fetch('script') ?>
</head>
<body>
    <nav class="top-bar expanded" data-topbar role="navigation">
        <ul class="title-area large-3 medium-4 columns">
            <li class="name">
                <h1><a href=""><?= $this->fetch('title') ?></a></h1>
            </li>
        </ul>
        <div class="top-bar-section">
            <ul class="right">
            <?php 
                //echo '<li>' .$this->Html->link('Login','http://10.1.248.54/asd-control/users/users/login') . '</li>';
                //echo '<li>' .$this->Html->link('Logout','http://10.1.248.54/asd-control/users/users/logout') . '</li>';
                //echo '<li>' .$this->User->login() . '</li>';
                echo '<li>' . $this->Html->link('Startseite',['plugin' => null, 'controller' => 'Pages', 'action' => 'home']) . '</li>';
                echo '<li>' . $this->User->logout() . '</li>';
                //echo '<li>' . $this->User->welcome() . '</li>';
                //echo $this->Auth->user('id');
                if (isset($LoggedInUser)) {
                    echo '<li>' . $this->Html->link('Angemeldeter Benutzer: ' . $LoggedInUser, 'http://10.1.248.54/asd-control/users/users/profile') . '</li>';
                }
                else {
                    echo '<li>' .$this->Html->link('Login','http://10.1.248.54/asd-control/users/users/login') . '</li>';
                }
                //$userId = $this->getView()->getRequest()->getSession()->read('Auth.User.id');
                //echo $userId;
                //echo '<li>' .$this->Html->link('Login',['plugin' => 'CakeDC/Users','controller' => 'Users', 'action' => 'login']) . '</li>';
                //echo '<li>' .$this->Html->link('Logout',['plugin' => 'CakeDC/Users','controller' => 'Users', 'action' => 'logout']) . '</li>';
            ?>
            </ul>
        </div>
    </nav>
    <?= $this->Flash->render() ?>
    <div class="container clearfix">
        <?= $this->fetch('content') ?>
    </div>
    <footer>
    </footer>
</body>
</html>
