<?php
// Copyright 1999-2022. Plesk International GmbH. All rights reserved.
?>
<?php  if (!$this->mpcEnabled): ?>
    <p><?php echo $this->lmsg('smb.controllers.mpc.connect.errorMpcDisabledByKey') ?></p>
<?php else: ?>
    <p><?php echo $this->lmsg('smb.controllers.mpc.connect.connecting') ?></p>
    <form action="<?php echo $this->mpcUrl ?>" method="post" id="mpcConnectionForm">
<?php foreach ($this->mpcData as $mpcDataKey => $mpcDataValue): ?>
<?php   if (is_array($mpcDataValue)): ?>
<?php       foreach ($mpcDataValue as $mpcDataSubKey => $mpcDataSubValue): ?>
        <input type="hidden" name="<?php echo $this->escape($mpcDataKey) ?>[<?php echo $this->escape($mpcDataSubKey) ?>]" value="<?php echo $this->escape($mpcDataSubValue) ?>" />
<?php       endforeach; ?>
<?php   else: ?>
        <input type="hidden" name="<?php echo $this->escape($mpcDataKey) ?>" value="<?php echo $this->escape($mpcDataValue) ?>" />
<?php   endif; ?>
<?php endforeach; ?>
    </form>
<script type="text/javascript">
//<![CDATA[
Jsw.onReady(function() {
    document.getElementById('mpcConnectionForm').submit();
});
//]]>
</script>
<?php endif; ?>
