<?php use Orchard\Feature\Feature;
    $socialInsightsEnabled = Feature::isEnabled('social_insights', 'enabled', $this->featureVendorContext);
    $audiencePageEnabled = Feature::isEnabled('audience_page', 'enabled', $this->featureVendorContext);
    $isDeprecateHeatmapFeatureEnabled = Feature::isEnabled('deprecate_heatmap', 'enabled', $this->featureVendorContext);
    $userObj = Zend_Registry::get('UserObj');
?>
<?php if ($this->alwMobileAnalyticsEnabled) { ?>
    <div id="content">
        <?php
            $items = array(
                array($this->translate('Top Charts'), '/analytics/index'),
                array($this->translate('Overview'), '/analytics/overview'),
            );

            array_push($items, array($this->translate('Audience'), '/analytics/audience'));

            if ($userObj->isAllowed(null, null, 'uisource_of_stream')) {
                $tabTitle = $this->translate('Engagement');
                array_push($items, array($tabTitle, '/analytics/engagement'));
            }

            if (!$isDeprecateHeatmapFeatureEnabled) {
                array_push($items, array($this->translate('Heatmap'), '/analytics/heatmap'));
            }
            array_push($items, array($this->translate('Mobile Analytics'), '/analytics/mobileanalytics', true));
            if (
                $userObj->isWorkstationExperienceFilm() &&
                $userObj->isAllowed('', '', 'navfilmtransparency')
            ) {
                array_push($items, array($this->translate('Film Transparency'), '/analytics/filmtransparency'));
            }

            if ($this->workstationPhysicalReportingEnabled) {
                array_push($items, array($this->translate('Physical Reporting'), '/analytics/reporting/physical'));
            }

            if ($this->dataStudioEnabled) {
                array_push(
                    $items, array($this->translate('Data Studio'), '/analytics/datastudio')
                );
            }

            if ($socialInsightsEnabled) {
                array_push($items, array($this->translate('Social Insights'), '/analytics/social'));
            }

            echo $this->partial('partials/sub-nav.phtml', array('items' => $items));
        ?>
        <h1><?=$this->translate('Mobile Analytics Guide')?></h1>
        <div class="mobile-analytics">
            <div class="panel panel-default">
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel-heading">
                            <div class="panel-title">
                                <h3><?=$this->translate('What is Mobile Analytics?')?></h3>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-md-8">
                                    <p>
                                        <?=$this->translate('The Orchard\'s Mobile Analytics offering provides you with all of the essential data from Workstation Analytics. Tailored for an on-the-go experience, you can view label or account level data segmented by channel, including Streams (Subscription and Ad-supported), Downloads and UGC matches (when available).')?>
                                    </p>
                                    <p>
                                        <?=$userObj->isAllowed(null, null, 'uiproject')
                                            ? $this->translate->_('To get more detail, simply use the Search function to view data for a particular product, film or TV show. Each channel displays up to one year of data, viewable in smaller date ranges including weekly, monthly, quarterly, bi-annually and yearly.')
                                            : $this->translate->_('To get more detail, simply use the Search function to view data for a particular release, film or TV show. Each channel displays up to one year of data, viewable in smaller date ranges including weekly, monthly, quarterly, bi-annually and yearly.')?>
                                    </p>
                                </div>
                                <div class="col-md-4 text-center">
                                    <img src="/images/mobile_analytics/header.jpg" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel-heading">
                            <div class="panel-title">
                                <h3><?=$this->translate('How Do I Get Mobile Analytics on my Device?')?></h3>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-md-12">
                                    <p><?=$this->translate('In your mobile browser, navigate to ')?><a href='http://m.workstation.theorchard.com'>m.workstation.theorchard.com</a><?=$this->translate('. You will need to log in with your workstation user and password. We strongly recommend you select "Remember Me" on logging in so you don\'t have to type this information in more than once.')?></p>
                                    <p><?=$this->translate('You can also add the app to your device\'s home screen:')?></p>
                                </div>
                            </div>
                            <div class="row app-instructions text-center">
                                <div class="col-md-6 column">
                                    <h3 class="os-title">
                                        <?=$this->translate('Android')?>
                                    </h3>
                                    <p class="step-guide">
                                        <?=$this->translate('First tap on the three dots in the URL bar')?>
                                    </p>
                                    <img class="app-img" src="/images/mobile_analytics/android1.jpg" />
                                    <p class="step-guide">
                                        <?=$this->translate('Next tap on "Add to Home screen"')?>
                                    </p>
                                    <img class="app-img" src="/images/mobile_analytics/android2.jpg" />
                                    <p class="step-guide">
                                        <?=$this->translate('Rename your app and tap add')?>
                                    </p>
                                    <img class="app-img" src="/images/mobile_analytics/android3.jpg" />
                                    <p class="step-guide">
                                        <?=$this->translate('Quickly access your analytics from your home screen')?>
                                    </p>
                                    <img class="app-img" src="/images/mobile_analytics/android4.jpg" />
                                </div>
                                <div class="col-md-6 column">
                                    <h3 class="os-title">
                                        <?=$this->translate('iOS')?>
                                    </h3>
                                    <p class="step-guide">
                                        <?=$this->translate('First tap the box with an upward arrow')?>
                                    </p>
                                    <img class="app-img" src="/images/mobile_analytics/ios1.jpg" />
                                    <p class="step-guide">
                                        <?=$this->translate('Next tap on "Add to Home screen"')?>
                                    </p>
                                    <img class="app-img" src="/images/mobile_analytics/ios2.jpg" />
                                    <p class="step-guide">
                                        <?=$this->translate('Rename your app and tap add')?>
                                    </p>
                                    <img class="app-img" src="/images/mobile_analytics/ios3.jpg" />
                                    <p class="step-guide">
                                        <?=$this->translate('Quickly access your analytics from your home screen')?>
                                    </p>
                                    <img class="app-img" src="/images/mobile_analytics/ios4.jpg" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php } ?>
