<?php
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
?>
<?= $this->doctype() ?>
<html <?= $this->htmlDoc() ?>>
<head>
    <?= $this->headMeta() ?>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE">
    <meta name="format-detection" content="telephone=no">
    <meta name="forgery_protection_token" id="forgery_protection_token" content="<?= Session::get()->panel()->forgeryProtectionToken ?>">
    <?= $this->headTitle() ?>
    <link rel="mask-icon" href="<?= \Session::get()->panel()->baseUrl . $this->cacheStamp('/images/favicon.svg') ?>" color="#54bce6">
    <link rel="shortcut icon" href="<?= \Session::get()->panel()->baseUrl . $this->cacheStamp('/favicon.ico') ?>">
    <link rel="manifest" href="<?= \Session::get()->panel()->baseUrl . $this->cacheStamp('/manifest.webmanifest') ?>" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <?= $GLOBALS['skin']->getThemeCssIncludes() ?>
    <?= $this->headStyle() ?>
    <?= $this->headLink() ?>
    <?php $this->jsLoad()->requireJs(); ?>
    <?php $this->jsLoad()->prepend('/javascript/main.js'); ?>
    <?php $this->jsLoad()->prepend('/javascript/vendors.js'); ?>
    <?php $this->jsLoad()->uiLibrary(); ?>
    <?php $this->jsLoad()->prepend('/javascript/externals/ProtoChart.js'); ?>
    <?php $this->jsLoad()->prepend('/javascript/externals/prototype.js'); ?>
    <?= new \Plesk\UserActivityTracking\View($this) ?>
    <?= $this->headScript() ?>
    <?= $this->partial('partials/context_header.phtml') ?>

    <?= $this->layout()->pleskAdditionalHead ?>

    <?= $this->layout()->extensionsAdditionalHead ?>

    <?php if ($this->layout()->googleTagManagerId): ?>
        <?= $this->partial('partials/google-tag-manager.phtml') ?>
    <?php endif; ?>
</head>
<body class="<?=$this->classNames($this->layout()->bodyClass, $this->layout()->integrationClass);?>">
<?php
    $this->plesk()->setData([
        'returnUrl' => $this->returnUrl,
        'showFrames' => Session::get()->panel()->showFrames,
        'pageHeader' => $this->pageHeader(Session::get()->auth()->getUser()),
        'pageSidebar' => $this->leftMenu(Session::get()),
        'pageContentHeader' => $this->pageContentHeader(),
        'withSecondary' => $this->layout()->withSecondary,
        'width' => $this->layout()->width,
        'status' => $this->status->getMessages(),
    ]);
?>
<?=$this->plesk()->run()?>
<?php if ($this->layout()->googleTagManagerId): ?>
    <?= $this->partial('partials/google-tag-manager-noscript.phtml') ?>
<?php endif; ?>
<?= $this->partial('partials/task-progress-bar.phtml') ?>
<?php if (!$this->layout()->isSmb && $this->layout()->helpPrefix || $this->layout()->helpContext): ?>
    <script type="text/javascript">
        //<![CDATA[
        <?php if ($this->layout()->helpPrefix): ?>
        AdminPanel.Help.setPrefix(<?= $this->jsEscape($this->layout()->helpPrefix) ?>);
        <?php endif ?>
        <?php if ($this->layout()->helpContext): ?>
        AdminPanel.Help.setContext(<?= $this->jsEscape($this->layout()->helpContext) ?>);
        <?php endif ?>
        //]]>
    </script>
<?php endif; ?>
<?php if ($this->layout()->content): ?>
    <?= $this->plesk()->renderAsTemplate($this->layout()->content, 'document.getElementById("main")') ?>
<?php endif; ?>
<?php if ($this->layout()->withSecondary && $this->layout()->secondary): ?>
    <?= $this->plesk()->renderAsTemplate($this->layout()->secondary, 'document.querySelector(".b-content-side > div")') ?>
<?php endif; ?>
    <?php $this->plesk()->showModal(); ?>
    <?= $this->layout()->extensionsAdditionalBody; ?>
</body>
</html>
