<?php
use Orchard\Feature\Feature;
use Orchard\Service\SegmentAnalyticsTracking;
use Orchard\FeatureFlags\FeatureService;
use Orchard\FeatureFlags\Context\AccountContext;

$sessionData = new Zend_Session_Namespace('Alw');

$alwCxt = AccountContext::fromLegacy((string)$sessionData->S_VEND_CONTACT_ID, 'alw', $sessionData->S_VENDOR_ID);
$owsFeatureClient = new FeatureService();
$isBrandingEnabled = $owsFeatureClient->isFeatureVariantActive('orchard_suite_use_branding', 'enabled', $alwCxt);
$isColorV2Enabled = $owsFeatureClient->isFeatureVariantActive('workstation_solfege_color_scheme_v2', 'enabled', $alwCxt);

?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/images/icons/favicon.ico" type="image/x-icon">
    <title></title>
<?php
    /*
     * These styles will be moved to the controller for the redesign
     */
echo $this->headLink();

echo $this->partial('partials/segment-analytics.phtml', array(
    'configs' => SegmentAnalyticsTracking::getTraitsFromSession($_SESSION, 'workstation')
));
?>
</head>
<body class="<?php echo ($isBrandingEnabled ? 'branded' : '') .($isColorV2Enabled ? ' SuiteColorSchemeV2' : '') ?>">
<?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="user_data">
    <?php echo json_encode($this->user); ?>
</script>
<script type="text/json" id="features">
    <?php echo json_encode($this->features); ?>
</script>
<script type="text/json" id="genre_data">
    <?php echo json_encode($this->genres); ?>
</script>
<script type="text/json" id="subgenre_data">
    <?php echo json_encode($this->subgenres); ?>
</script>
<script type="text/json" id="imprints_data">
    <?php echo json_encode($this->imprints); ?>
</script>
<script type="text/json" id="language_data">
    <?php echo json_encode($this->languages); ?>
</script>
<script type="text/json" id="country_data">
    <?php echo json_encode($this->countries); ?>
</script>
<script type="text/json" id="territory_data">
    <?php echo json_encode($this->territories); ?>
</script>
<script type="text/json" id="itunes_pricing_data">
    <?php echo json_encode($this->iTunesPricingData); ?>
</script>
<script type="text/json" id="amazon_pricing_data">
    <?php echo json_encode($this->amazonPricingData); ?>
</script>
<script type="text/json" id="itunes_track_pricing_data">
    <?php echo json_encode($this->iTunesTrackPricingData); ?>
</script>
<script type="text/json" id="amazon_track_pricing_data">
    <?php echo json_encode($this->amazonTrackPricingData); ?>
</script>
<script type="text/json" id="i18n">
    <?php echo json_encode($this->i18n); ?>
</script>
<?php
// javascript apps
echo $this->bottomScripts();
?>
</body>

<div class='loading-overlay text-center hidden'>
    <div class='ellipsis-animated ellipsis-white'>Saving</div>
</div>

</html>
