<?php
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
?>
<?php $instancesList = $this->instancesList->fetchData(); ?>
<div class="objects-details-heading">
    <div class="objects-details-heading-area">
        <div class="toolbar" id="installed-apps-toolbar">
        </div>
        <h3>
            <span><?php echo $this->lmsg('tabTitle') ?></span>
        </h3>
    </div>
</div>
<div class="object-details-hint"><?php echo $this->lmsg('whereAreApps') ?></div>
<div class="objects-content">
    <div class="list-box" id="installed-apps-list"></div>
</div>

<?= $this->requireJs('views/smb/app/installed', [
    'updates' => $this->updatesList,
    'instancesList' => $instancesList,
    'domainIdParam' => $this->domainIdParam,
]) ?>

<?php if (!count($instancesList['data'])): ?>
    <hr>
    <?php if (isset($this->catalogLinks['marketplace']) && isset($this->catalogLinks['apscatalog'])): ?>
    <div class="object-details-hint">
<?php
    foreach ($this->catalogLinks as &$link) {
        $link = $this->baseUrl($link);
    }
    $this->catalogLinks['_escape'] = false;
    echo $this->lmsg('installAppHint', $this->catalogLinks);
?>
    </div>
    <?php endif; ?>
    <?php echo $this->form; ?>
<?php endif; ?>
