<?php
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
?>
<script type="text/javascript">
//<![CDATA[
Jsw.onReady(Jsw.priority.low, function() {
    new Jsw.Popup({
        popupCls: 'popup-panel popup-panel-lg',
        id: 'eula-update-popup',
        hideOnBgClick: false,
        title: <?php echo $this->isUpdate ? $this->jsLmsg('admin.controllers.index.eula.updatePopupTitle')
        : $this->jsLmsg('admin.controllers.index.eula.popupTitle'); ?>,
        content: '<h4>' + <?php echo $this->isUpdate ? $this->jsLmsg('admin.controllers.index.eula.updatePopupDescription')
            : $this->jsLmsg('admin.controllers.index.eula.popupDescription'); ?> + '</h4>' +
        '<div class="eula">' + <?php echo json_encode($this->license); ?> + '</div>',
        buttons: [{
            id: 'eula-update-accept',
            title: <?php echo $this->jsLmsg('admin.controllers.index.eula.buttonAccept'); ?>,
            handler: function (event, popup) {
                Jsw.api.post(Jsw.prepareUrl(<?php echo $this->jsEscape($this->baseUrl('/admin/index/accept-eula')); ?>));
                popup.hide();
            }
        }, {
            id: 'eula-update-decline',
            title: <?php echo $this->jsLmsg('admin.controllers.index.eula.buttonDecline'); ?>,
            handler: function (event, popup) {
                document.location.href = '/logout.php';
                popup.hide();
            }
        }]
    });
});
//]]>
</script>
