<?php
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.

use Plesk\MigrationLibV8\Plesk\PleskFunctions;

echo $this->renderTabs($this->tabs);
echo $this->serverInfoToolbar;
echo $this->progressStatus;
echo $this->popupMigrate;
echo $this->popupResync;
if ($this->isDNSSwitchSupported) {
    echo $this->popupSwitchDns;
    echo $this->popupRevertDns;
}
echo $this->popupCancel;
echo $this->popupRemove;
echo $this->popupReassignOwner;
echo $this->popupReassignPlan;
echo $this->popupChangeIp;
echo $this->popupSelectNode;
echo $this->popupPostMigrationChecks;
echo $this->popupStatusDetails;
echo $this->popupPreChecks;

$this->passVariablesToJavaScript([
    'URL_GET_MIGRATION_STATUS' => $this->urlGetMigrationStatus,
    'MIGRATION_STATUS_DATA' => $this->migrationStatusData,
    'IS_DNS_SWITCH_SUPPORTED' => $this->isDNSSwitchSupported,
    'URL_RESET_REASSIGN_SUBSCRIPTIONS' => $this->urlResetReassignSubscriptions,
    'SUBSCRIPTIONS_LIST_DATA' => $this->subscriptionsList->fetchData(),
    'URL_SUBSCRIPTIONS_LIST' => $this->subscriptionsList->getDataUrl(),
    'SUBSCRIPTIONS_LIST_FILTER_CONFIG' => $this->subscriptionsList->getSearchFilterConfig(),
    'HAS_IPV6_ADDRESSES' => $this->hasIPv6Addresses,
    'IS_PLESK_MULTISERVER' => PleskFunctions::isPleskMultiserver(),
]);
$this->includeMigratorJavaScript('locale.js');

$this->addJavaScriptLocaleKeys([
    'subscriptionsListStatusQueued',
    'subscriptionsListStatusCancelled',
    'subscriptionsListStatusInProgress',
    'subscriptionsListStatusNotStarted',
    'subscriptionsListStatusDnsSwitched',
    'subscriptionsListStatusFinishedOk',
    'subscriptionsListStatusFinishedWarnings',
    'subscriptionsListStatusFinishedErrors',
    'subscriptionsListOperationMigration',
    'subscriptionsListOperationContentSync',
    'subscriptionsListOperationDnsSwitch',
    'subscriptionsListOperationPostMigrationCheck',
]);

$this->includeMigratorJavaScript('subscription-status.js');

$this->addJavaScriptLocaleKeys([
    'subscriptionsListActionMigrate',
    'subscriptionsListButtonMigrateTitle',
    'subscriptionsListButtonMigrateHint',
    'subscriptionsListActionRestart',
    'subscriptionsListButtonSwitchDnsTitle',
    'subscriptionsListButtonSwitchDnsHint',
    'subscriptionActionSwitchDns',
    'subscriptionsListButtonReassignOwnerTitle',
    'subscriptionsListButtonReassignOwnerHint',
    'subscriptionActionReassignOwner',
    'subscriptionsListButtonReassignPlanTitle',
    'subscriptionsListButtonReassignPlanHint',
    'subscriptionActionReassignPlan',
    'subscriptionsListButtonResetReassignTitle',
    'subscriptionsListButtonResetReassignHint',
    'subscriptionActionReassignReset',
    'subscriptionsListButtonChangeIpMappingTitle',
    'subscriptionsListButtonChangeIpMappingHint',
    'subscriptionActionChangeIpMapping',
    'subscriptionsListButtonSelectNodeTitle',
    'subscriptionsListButtonSelectNodeHint',
    'subscriptionActionSelectNode',
    'subscriptionsListActionResync',
    'subscriptionsListButtonResyncTitle',
    'subscriptionsListButtonResyncHint',
    'subscriptionsListButtonPostMigrationChecksTitle',
    'subscriptionsListButtonPostMigrationChecksHint',
    'subscriptionActionRunPostMigrationChecks',
    'subscriptionsListButtonRevertDnsTitle',
    'subscriptionsListButtonRevertDnsHint',
    'subscriptionActionRevertDns',
    'subscriptionsListActionCancel',
    'subscriptionsListButtonRemoveFromQueueTitle',
    'subscriptionsListButtonRemoveFromQueueHint',
    'subscriptionsListButtonRemoveMigratedTitle',
    'subscriptionsListButtonRemoveMigratedHint',
    'subscriptionActionShowLog',
]);
$this->includeMigratorJavaScript('subscription-operations.js');

$this->addJavaScriptLocaleKeys([
    'subscriptionsListButtonReassignTitle',
    'subscriptionsListButtonIpAddressesTitle',
    'subscriptionsListButtonShowIpMappingTitle',
    'subscriptionsListButtonShowIpMappingHint',
    'subscriptionsListOperationsCanNotBeApplied',
    'subscriptionsListTableSubscription',
    'subscriptionsListTableOwner',
    'hintOwnerByCustomerOwnedByReseller',
    'hintOwnedByReseller',
    'hintOwnerByCustomer',
    'hintOwnedByAdministrator',
    'administratorTitle',
    'reassignedTo',
    'subscriptionsListTablePlan',
    'reassignedTo',
    'subscriptionsListTableIP',
    'ipv4Address',
    'ipv6Address',
    'nodeIP',
    'subscriptionsListTableStatus',
    'actionDetails',
    'subscriptionsListStatusFinishedErrors',
    'subscriptionsListTableActions',
    'issuesPopupTitleSubscription'
]);
$this->includeMigratorJavaScript('subscriptions-list.js');
$this->includeMigratorCss('subscriptions-list.css');
