<?php
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
?>
<?php
$homeElement = $this->element->getElement('home');
?>
<script type="text/javascript">
//<![CDATA[
    Jsw.namespace('Smb.Ftp');

    Smb.Ftp.showHomePathPopup = function (event) {
        event.preventDefault();

        new Jsw.DirectoryBrowser({
            cls: 'popup-panel',
            locale: {
                title: <?php echo $this->jsLmsg('smb.components.forms.ftp-user.popupTitle') ?>,
                buttonOk: <?php echo $this->jsLmsg('components.buttons.ok') ?>,
                buttonCancel: <?php echo $this->jsLmsg('components.buttons.cancel') ?>
            },
            pathElementId: '<?php echo $homeElement->getId() ?>',
            subscriptionId: '<?php echo $this->subscriptionId ?>'
        });
    };
//]]>
</script>
<div class='form-row' id="<?php echo $homeElement->getId(); ?>-form-row">
    <div class='field-name'>
        <?php echo $this->elementPart($homeElement)->label(); ?>
    </div>
    <div class='field-value'>
        <?php echo $this->elementPart($homeElement)->content(); ?>
        <a href="#" class="btn btn-icon-only input-btn" onClick="Smb.Ftp.showHomePathPopup(event);"><i class="icon-folder"></i></a>
        <span class="field-errors" style="display: none;"></span>
        <span class="hint"><?php echo $this->elementPart($homeElement)->description(); ?></span>
    </div>
</div>
