<?php
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
?>
<?php if ($this->showDnsHelper): ?>
<div id="dns-helper-placeholder"></div>
<?= $this->plesk()->addWidget('app/dns-helper', [
    'id' => $this->ownerId,
    'isAlias' => $this->ownerType === 'alias',
], 'document.getElementById("dns-helper-placeholder")') ?>
<?php endif; ?>
<?= $this->partial('partials/tabs.phtml', array('tabs' => $this->tabs, 'renderTo' => 'main')) ?>
<?= $this->requireJs('views/smb/dns-zone/records-list', [
    'name' => $this->name,
    'dnsRecordsList' => [
        'data' => $this->dnsRecordsList->fetchData(),
        'dataUrl' => "/dns-zone/records-list-data/id/{$this->ownerId}/type/{$this->ownerType}",
    ],
    'urls' => [
        'update' => "/dns-zone/update/id/{$this->ownerId}/type/{$this->ownerType}",
        'revert' => "/dns-zone/revert/id/{$this->ownerId}/type/{$this->ownerType}",
        'edit-record' => "/dns-zone/edit-record/id/{$this->ownerId}/type/{$this->ownerType}/recordId/%%id%%",
        'check' => "/dns-zone/check/id/{$this->ownerId}/type/{$this->ownerType}/recordId/%%id%%",
        'turn-on' => "/dns-zone/turn-on/id/{$this->ownerId}/type/{$this->ownerType}",
        'turn-off' => "/dns-zone/turn-off/id/{$this->ownerId}/type/{$this->ownerType}",
        'add-record' => "/dns-zone/add-record/id/{$this->ownerId}/type/{$this->ownerType}",
        'toggle-type' => "/dns-zone/toggle-type/id/{$this->ownerId}/type/{$this->ownerType}",
        'restore-default' => "/dns-zone/restore-default/id/{$this->ownerId}/type/{$this->ownerType}",
        'sync-zone' => "/dns-zone/sync-zone/id/{$this->ownerId}/type/{$this->ownerType}",
        'delete' => "/dns-zone/delete/id/{$this->ownerId}/type/{$this->ownerType}",
    ],
    'applyButton' => $this->applyButton,
    'manageDns' => $this->manageDns,
    'dnsZoneStatus' => $this->dnsRecordsList->getDnsZoneStatus(),
    'isZoneCreated' => $this->isZoneCreated,
    'syncZone' => $this->syncZone,
]) ?>
