<!doctype html>
<html lang="<?PHP echo \F3::get('language'); ?>">
<head>
    <base href="<?PHP echo $this->base; ?>" /> 

    <meta charset="utf-8">

    <title><?PHP echo trim(\F3::get('html_title')); echo $this->statsUnread>0 ? ' ('.$this->statsUnread.')' : ''; ?></title>
    
    <meta name="description" content="selfoss" />
    <meta name="author" content="Tobias Zeising" />
    <meta name="version" content="<?PHP echo \F3::get('version'); ?>" />
    <meta name="referrer" content="no-referrer" />

    <!--  Mobile viewport optimized: j.mp/bplateviewport -->
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1" />
    
    <!--  Add support for fullscreen Webapp on iPhone 5 -->
    <meta name="viewport" content="initial-scale=1, user-scalable=no, maximum-scale=1" media="(device-height: 568px)" />
    
    <!-- app 'behaviour' when adding link to iDevice springboard -->
    <meta name="apple-mobile-web-app-capable" content="yes" />
    
    <!-- app 'behaviour' when adding link to Android Home  -->
    <meta name="mobile-web-app-capable" content="yes" />

    <!-- app tile and notification when adding link to Windows 8 start screen -->
    <meta name="application-name" content="Selfoss" />
    <meta name="msapplication-TileColor" content="#3d6d69" />
    <meta name="msapplication-square70x70logo" content="<?php echo $this->base; ?>win8-70-icon.png" />
    <meta name="msapplication-square150x150logo" content="<?php echo $this->base; ?>win8-150-icon.png" />
    <meta name="msapplication-wide310x150logo" content="<?php echo $this->base; ?>win8-150-icon.png" />
    <meta name="msapplication-square310x310logo" content="<?php echo $this->base; ?>win8-310-icon.png" />
    <meta name="msapplication-notification" content="cycle=1; frequency=30; polling-uri=<?php echo $this->base; ?>win8notifs" />
    <meta name="msapplication-badge" content="frequency=30; polling-uri=<?php echo $this->base; ?>badge" />

    <!--  RSS Feed -->
    <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="feed" />
    
    <!-- icons -->
    <link rel="apple-touch-icon-precomposed" href="icon-128x128.png" />
    <link rel="icon" type="image/png" href="icon-32x32.png" />
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />

    <!-- Toolbar color from Chrome for Android -->
    <meta name="theme-color" content="#191718" />

    <!-- all css definitions -->
    <?PHP if(\F3::get('use_system_font')!=true) : ?>
        <link rel="stylesheet" href="css/fonts.css" />
    <?PHP endif; ?>
    <link rel="stylesheet" href="<?PHP echo \helpers\View::getGlobalCssFileName(); ?>" />

</head>
<body class="
    <?PHP echo $this->publicMode===true ? "publicmode" : ""; ?>
    <?PHP echo $this->loggedin===true ? "loggedin" : "notloggedin"; ?> 
    <?PHP echo \F3::get('auto_mark_as_read')==1 ? "auto_mark_as_read" : ""; ?>
">
    
    <div id="error"></div>
    
    <!-- language settings for jQuery -->
    <span id="lang"
        data-mark="<?PHP echo \F3::get('lang_mark'); ?>"
        data-unmark="<?PHP echo \F3::get('lang_unmark'); ?>"
        data-star="<?PHP echo \F3::get('lang_star'); ?>"
        data-unstar="<?PHP echo \F3::get('lang_unstar'); ?>"
        data-source_warn="<?PHP echo \F3::get('lang_source_warn'); ?>"
        data-source_saved="<?PHP echo \F3::get('lang_source_saved'); ?>"
        data-source_edit="<?PHP echo \F3::get('lang_source_edit'); ?>"></span>

    <!-- other settings -->
    <span id="config"
        data-anonymizer="<?PHP echo \helpers\Anonymizer::getAnonymizer(); ?>"
        data-share="<?PHP echo \F3::get('share'); ?>"
        data-wallabag="<?PHP echo \F3::get('wallabag'); ?>"
        data-wordpress="<?PHP echo \F3::get('wordpress'); ?>"
        data-auto_mark_as_read="<?PHP echo \F3::get('auto_mark_as_read'); ?>"
        data-auto_collapse="<?PHP echo \F3::get('auto_collapse'); ?>"
        data-auto_stream_more="<?PHP echo \F3::get('auto_stream_more'); ?>"
        data-load_images_on_mobile="<?PHP echo \F3::get('load_images_on_mobile'); ?>"
        data-items_perpage="<?PHP echo \F3::get('items_perpage'); ?>"
        data-auto_hide_read_on_mobile="<?PHP echo \F3::get('auto_hide_read_on_mobile'); ?>"
        data-html_title="<?PHP echo trim(\F3::get('html_title')); ?>"></span>

    <!-- menue open for smartphone -->
    <div id="nav-mobile">
        <div id="nav-mobile-logo"><span class="unread-count<?PHP echo $this->statsUnread>0 ? ' unread' : ''; ?>"><?PHP echo $this->statsUnread; ?></span></div>
        <div id="nav-mobile-settings"></div>
    </div>
    
    <!-- navigation -->
    <div id="nav" role="navigation">
        <div id="nav-logo"></div>
        <button id="nav-mark"><?PHP echo \F3::get('lang_markread')?></button>

        <?PHP $active = (\F3::get('homepage')) ? \F3::get('homepage') : 'newest' ?>
        <h2 id="nav-filter-title"><?PHP echo \F3::get('lang_filter') ?></h2>
        <ul id="nav-filter">
            <li id="nav-filter-newest" class="nav-filter-newest<?PHP if($active=='newest') : ?> active<?PHP endif; ?>" role="link" tabindex="0"><?PHP echo \F3::get('lang_newest')?> <span><?PHP echo $this->statsAll; ?></span></li>
            <li id="nav-filter-unread" class="nav-filter-unread<?PHP if($active=='unread') : ?> active<?PHP endif; ?>" role="link" tabindex="0"><?PHP echo \F3::get('lang_unread')?> <span class="unread-count<?PHP echo $this->statsUnread>0 ? ' unread' : ''; ?>"><?PHP echo $this->statsUnread; ?></span></li>
            <li id="nav-filter-starred" class="nav-filter-starred<?PHP if($active=='starred') : ?> active<?PHP endif; ?>" role="link" tabindex="0"><?PHP echo \F3::get('lang_starred') ?> <span><?PHP echo $this->statsStarred; ?></span></li>
        </ul>

        <hr>

        <div id="nav-tags-wrapper">
        <h2 id="nav-tags-title" class="nav-tags-expanded" tabindex="0" aria-haspopup="true" aria-expanded="true"><?PHP echo \F3::get('lang_tags') ?></h2>
        <ul id="nav-tags">
            <li class="active nav-tags-all" role="link" tabindex="0"><?PHP echo \F3::get('lang_alltags')?></li>
            <?PHP echo $this->tags; ?>
        </ul>
        <h2 id="nav-sources-title" class="nav-sources-collapsed" tabindex="0" aria-haspopup="true" aria-expanded="false"><?PHP echo \F3::get('lang_sources') ?></h2>
        <ul id="nav-sources">
            <?PHP echo $this->sources; ?>
        </ul>
        </div>
        
        <hr>
        
        <!-- navigation search input just for smartphone version -->
        <div id="nav-search" role="search">
            <input type="search" id="nav-search-term"> <input type="button" id="nav-search-button" value="<?PHP echo \F3::get('lang_searchbutton')?>">
            <hr>
        </div>
        
        <?PHP if($this->loggedin===true && \F3::get('auth')->enabled()===false) : ?>
        <button id="nav-refresh" title="<?PHP echo trim(\F3::get('lang_refreshbutton')); ?>" class="nologin"></button>
        <button id="nav-settings" title="<?PHP echo trim(\F3::get('lang_settingsbutton')); ?>" class="nologin"></button>
        <?PHP endif; ?>
        
        <?PHP if($this->loggedin===true && \F3::get('auth')->enabled()===true) : ?>
        <button id="nav-refresh" title="<?PHP echo trim(\F3::get('lang_refreshbutton')); ?>"></button>
        <button id="nav-settings" title="<?PHP echo trim(\F3::get('lang_settingsbutton')); ?>"></button>
        <button id="nav-logout" title="<?PHP echo trim(\F3::get('lang_logoutbutton')); ?>"></button>
        <?PHP endif; ?>
        
        <?PHP if($this->loggedin===false) : ?>
        <button id="nav-login" title="<?PHP echo trim(\F3::get('lang_loginbutton')); ?>"></button>
        <?PHP endif; ?>
        
        <a id="nav-copyright" href="http://selfoss.aditu.de" target="_blank">selfoss <?PHP echo \F3::get('version'); ?></a>
    </div>
    
    <!-- search -->
    <div id="search" role="search">
        <input type="search" id="search-term">
        <button id="search-remove" title="<?PHP echo \F3::get('lang_searchremove')?>"><img src="public/images/remove.png" alt=""></button>
        <button id="search-button" title="<?PHP echo \F3::get('lang_searchbutton')?>"><img src="public/images/search.png" alt=""></button>
    </div>
    
    <ul id="search-list">
    </ul>
    
    <!-- unread count below the fold -->
    <div id="floating-unread" aria-hidden="true">
        <span class="floating-unread-count"></span>
        <div class="bottom-triangle"></div>
    </div>

    <!-- content -->
    <div id="content" role="main">
        <?PHP echo $this->content; ?>
    </div>
    
    <div class="stream-error"><?PHP echo trim(\F3::get('lang_streamerror')); ?></div>

    <!-- fullscreen popup -->
    <div id="fullscreen-entry"></div>
    
    <script src="<?PHP echo \helpers\View::getGlobalJsFileName(); ?>"></script>
</body>
</html>
