<?php
    require_once APPLICATION_PATH . '/modules/alw/views/helpers/Loadjs.php';

    use Orchard\Service\SegmentAnalyticsTracking;
    use Orchard\Feature\Feature;

    $sessionData = new Zend_Session_Namespace('Alw');
    $alwBannerDisplay = Feature::isEnabled('alw_banner_display', 'enabled');
?>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <link rel="shortcut icon" href="/images/icons/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css">
    <title>The Orchard</title>
    <?php echo $this->headLink(); ?>

    <link href="https://fonts.googleapis.com/css?family=Rubik:400,500" media="screen" rel="stylesheet" type="text/css">
    <?php if ($alwBannerDisplay) { ?>
        <?php
            $loadjs = new Zend_View_Helper_loadjs();
            echo $this->headScript()->appendFile($loadjs->getCdnJsPath('jquery-1.8.2.min.js', 'workstation')); ?>
        <script type="text/javascript" src="/scripts/alw/top-banner.js"></script>
    <?php }

    echo $this->partial('partials/segment-analytics.phtml', array(
        'configs' => SegmentAnalyticsTracking::getTraitsFromSession($_SESSION, 'workstation')
    ));
    ?>
</head>
<body>
<?php
    echo $this->partial('partials/subaccount_impersonation_banner.phtml', ['session', $_SESSION]);
?>
<noscript>Javascript appears to be turned off. In order to use this page, you must have it turned on.</noscript>
<script type="text/json" id="appRoot">
    <?php echo json_encode($this->appRoot); ?>
</script>
<script type="text/json" id="features">
    <?php echo json_encode($this->features); ?>
</script>
<script type="text/json" id="user_data">
    <?php echo json_encode($this->user); ?>
</script>
<script type="text/json" id="i18n">
    <?php echo json_encode($this->i18n); ?>
</script>
<?php
    echo $this->render('_header_redesign.phtml');
    echo $this->render('_chaplin_container.phtml');
    echo $this->render('_footer_redesign.phtml');
    echo $this->bottomScripts() . "\n";
?>
</body>
</html>
