app/layout/base/template/default.html.phtml

Summary

Maintainability
Test Coverage
<?php
/* @var $this Ajde_Template_Parser_Phtml_Helper */

// Include some libraries, in reverse order of appearance
$this->requireJsLibrary('jquery/2.1.4/jquery.min.js');

// Twitter Bootstrap
$this->requireCssPublic('core/bootstrap/bootstrap3.min.css', Ajde_Document_Format_Html::RESOURCE_POSITION_TOP);
$this->requireJsPublic('core/bootstrap/bootstrap3.min.js');

// JavaScript i18n
$this->requireJsFirst('i18n.' . Ajde_Lang::getInstance()->getShortLang(), 'html', LAYOUT_DIR . 'admin/');

// Alert bar
$this->requireJsFirst('core.alert', 'html', LAYOUT_DIR . 'admin/');
$this->requireCssFirst('core.alert');

// Lazy images
$this->requireJsPublic('core/jquery.lazyload.min.js');
$this->requireJsFirst('core.lazy', 'html', LAYOUT_DIR . 'admin/');

if (($user = UserModel::getLoggedIn()) && $user->isAdmin()) {
    // Shortcut
    $this->requireCss('core.shortcut', 'html', LAYOUT_DIR . 'admin/');
    $this->requireJs('core.shortcut', 'html', LAYOUT_DIR . 'admin/');
}

?>
<!DOCTYPE html>
<html lang='<?php echo Ajde_Lang::getInstance()->getShortLang(); ?>' id='<?php echo config("app.id"); ?>' data-lifetime='<?php echo (config("session.lifetime") == 0 ? 180 : config("session.lifetime")); ?>' data-alert='<?php echo esc(Ajde_Session_Flash::get('alert')); ?>'>

    <head>

        <!-- UTF-8 please (also in the headers, just to be sure) -->
        <meta charset='utf-8'>

        <!-- Document title -->
        <title><?php echo esc(Ajde::app()->getDocument()->getFullTitle()); ?></title>

        <!-- Some meta tags -->
        <meta name='description' content='<?php echo esc(Ajde::app()->getDocument()->getDescription()); ?>' />
        <meta name='author' content='<?php echo esc(Ajde::app()->getDocument()->getAuthor()); ?>' />
        <?php echo Ajde::app()->getDocument()->getMeta(); ?>

        <!-- And (redundant) open graph tags -->
        <meta property='og:title' content='<?php echo esc(Ajde::app()->getDocument()->getTitle()); ?>' />
        <meta property='og:type' content='website' />
        <?php if (Ajde::app()->hasController()) {
            ?><meta property='og:url' content='<?php echo config("app.rootUrl") . Ajde::app()->getController()->getCanonicalUrl(); ?>' />
        <?php }
        if (Ajde::app()->getDocument()->hasNotEmpty('featuredImage')) {
            ?><meta property='og:image' content='<?php echo config("app.rootUrl") . Ajde::app()->getDocument()->getFeaturedImage(); ?>' />
        <?php }
        ?><meta property='og:description' content='<?php echo esc(Ajde::app()->getDocument()->getDescription()); ?>' />
        <meta property='og:locale' content='<?php echo Ajde_Lang::getInstance()->getShortLang(); ?>' />
        <meta property='og:site_name' content='<?php echo esc(config("app.title")); ?>' />

        <!-- Mobile presentation meta tags -->
        <meta name='viewport' content='width=device-width, initial-scale=1.0'>

        <!-- Define the root of the site -->
        <base href='<?php echo config("i18n.rootUrl"); ?>' />

        <!-- Canonical URL -->
        <?php if (Ajde::app()->hasController()) {
            ?><link rel='canonical' href='<?php echo config("app.rootUrl") . Ajde::app()->getController()->getCanonicalUrl(); ?>' />
        <?php } ?>

        <!-- Language links -->
        <?php echo $this->includeModule('lang/links'); ?>

        <!-- Favicon -->
        <link rel="icon" type="image/png" href="assets/media/favicon.png">

        <!-- Stylesheets -->
        <?php echo $this->getDocument()->getHead('css'); ?>

        <!-- Google Analytics -->
        <script>
            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

            <?php if (! $gap = setting('google_analytics')) $gap = 'UA-XXXXX-Y'; ?>
            ga('create', '<?php echo $gap; ?>', 'auto');
            ga('send', 'pageview');
        </script>

    </head>

    <body class="loading">

        <!-- No JavaScript / No cookies warning -->
        <noscript>
            <div class="no-js-cookie-warning">This site works best with JavaScript enabled</div>
        </noscript>
        <script defer='defer'>
            if (navigator.cookieEnabled === false) {
                document.write('<div class="no-js-cookie-warning">This site works best with cookies enabled</div>');
            }
        </script>

        <?php if ($user && $user->isAdmin()) {
        ?><!-- Admin shortcut -->
        <a class="ajde-shortcut admin" href="admin" target="admin">admin</a>
        <?php } ?>

        <!--  Bootstrap navbar -->
        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="."><?php echo esc(config("app.title")); ?></a>
                </div>
                <div class="collapse navbar-collapse">
                    <ul class="nav navbar-nav">
                        <?php
                        $menu = new MenuModel();
                        $menu->loadByName('mainmenu');
                        foreach($menu->getItems() as $item) { ?>
                            <li class='<?php echo $item['current']; ?>'>
                                <a href='<?php echo esc($item['url']); ?>'>
                                    <?php echo esc($item['name']); ?>
                                </a>
                            </li>
                        <?php } ?>
                    </ul>
                </div>
            </div>
        </div>

        <!-- Page content -->
        <?php echo $this->getDocument()->getBody(); ?>

        <footer class='container'>
            <div class='row'>
                <div class='col-sm-12'>
                    &copy; <?php echo date('Y'); ?> <?php echo config("app.author"); ?>
                </div>
            </div>
        </footer>

        <!-- The scripts -->
        <?php echo $this->getDocument()->getScripts(); ?>

        <!-- updatemybrowser.org widget -->
        <script>
            (function(u) {
                var s = document.createElement('script'); s.async = true; s.src = u;
                var b = document.getElementsByTagName('script')[0]; b.parentNode.insertBefore(s, b);
            })('//updatemybrowser.org/umb.js');
        </script>

    </body>
</html>

<?php if (config("app.debug")) { ?>
<!-- Some debugging info -->
<!--[<pre>
    <?php echo config("app.id") . ', ' . config("app.version"); ?>
    Cache <?php echo Ajde_Cache::getInstance()->isEnabled() ? 'enabled' : 'disabled' ?>
    Last modified on <?php echo date("r", Ajde_Cache::getInstance()->getLastModified()); ?>
</pre><![-->
<?php } ?>