<?php
// Copyright 1999-2022. Plesk International GmbH. All rights reserved.
?>
<script type="text/javascript">
//<![CDATA[
    Jsw.namespace('Smb.Views.Web');

    Smb.Views.Web.getSitebuilderAction =  function(url, legacyUrl)
    {
        if (legacyUrl)
            return "Smb.Views.Web.showSelectSitebuilderDialog('" + url + "', '" + legacyUrl + "');return false;";
        return "window.open('" + url + "');return false;";
    };

    Smb.Views.Web.showSelectSitebuilderDialog =  function (url, legacyUrl)
    {
        Jsw.messageBox.show({
            'type': Jsw.messageBox.TYPE_YESNO,
            'subtype': 'delete',
            'text': <?php echo $this->jsLmsg('components.sitebuilder.oldSitebuilderSiteExistsConfirmation') ?>,
            'description': <?php echo $this->jsLmsg('components.sitebuilder.oldSitebuilderSiteExistsConfirmationDescription') ?>,
            'onYesClick': function() {
                window.open(legacyUrl);
            },
            'onNoClick': function() {
                window.open(url);
            },
            'buttonTitles': {
                'yes': <?php echo $this->jsLmsg('components.sitebuilder.redirectToLegacySitebuilderButton') ?>,
                'no': <?php echo $this->jsLmsg('components.sitebuilder.redirectToNewSitebuilderButton') ?>
            }
        });
    }
////]]>
</script>


