<?php
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
?>
<?php echo $this->partial('partials/tabs.phtml', array('tabs' => $this->tabs, 'renderTo' => 'main')); ?>

<script type="text/javascript">
//<![CDATA[
Jsw.onReady(function() {
    new Jsw.Container({
        renderTo: 'main',
        items: [{
            componentType: 'Jsw.Hint',
            hint: <?php echo $this->jsLmsg('buttonsAreaDescription'); ?>
        }, {
            componentType: 'Jsw.ListContainer',
            cls: 'tools-list',
            itemClass: 'tools-item',
            items: [
                <?php if ($this->webmailUrl): ?>{
                    componentType: 'Smb.ToolButton',
                    icon: '<?php echo $this->skinUrl("/icons/32/plesk/web-mail.png"); ?>',
                    title: <?php echo $this->jsLmsg('buttonWebmail'); ?>,
                    comment: <?php echo $this->jsLmsg('hintWebmail'); ?>,
                    href:  <?php echo $this->jsEscape($this->webmailUrl); ?>,
                    target: '_blank'
                }, <?php endif;?>{
                    componentType: 'Smb.ToolButton',
                    icon: '<?php echo $this->skinUrl("/icons/32/plesk/preferences.png"); ?>',
                    title: <?php echo $this->jsLmsg('buttonEmailAddressSettings'); ?>,
                    comment: <?php echo $this->jsLmsg('hintEmailAddressSettings'); ?>,
                    href: '/email-address/edit/id/' + <?php echo $this->mailnameId; ?> + '/'
                }, {
                    componentType: 'Smb.ToolButton',
                    icon: '<?php echo $this->skinUrl("/icons/32/plesk/manage.png"); ?>',
                    title: <?php echo $this->jsLmsg('buttonConfigureMailApplication'); ?>,
                    comment: <?php echo $this->jsLmsg('hintConfigureMailApplication'); ?>,
                    handler: function() {
                        Plesk.require('app/email-address/configure-client', function (render) {
                            render({
                                mailName: <?= $this->jsEscape($this->mailname); ?>,
                                mailId: <?= $this->mailnameId; ?>,
                                getConfigurationUrl: Jsw.prepareUrl('/email-address/configuration'),
                            });
                        });
                    }
                }]
        }]
    });
});
//]]>
</script>
