<?php
// Copyright 1999-2023. Plesk International GmbH. All Rights Reserved.
?>
<div class="form-row" id="<?php echo $this->id ? $this->id : $this->element->getId() . '-form-row'; ?>">
    <div class="field-name"><label for="<?php echo $this->element->getId(); ?>">
            <?php echo $this->element->getLabel(); ?>
            <?php if ($this->element->isRequired()): ?>
                <span class="required">*</span>
            <?php endif; ?></label></div>
    <div class="field-value">
        <div class="migrate-by-mode-selector">
            <?php foreach ($this->element->getMultiOptions() as $optionName => $optionTitle): ?>
                <div class="migrate-by-mode-selector-item">
                    <label class="migrate-by-mode-selector-radio <?php echo ($optionName == $this->element->getValue()) ? 'checked' : ''; ?>">
                        <input type="radio" id="<?php echo $this->element->getId() . "-$optionName"; ?>" name="<?php
                        echo $this->element->getBelongsTo()
                            ? $this->element->getBelongsTo() . '[' . $this->element->getName() . ']'
                            : $this->element->getName();
                        ?>" class="migrate-by-mode-selector-radio-input" <?php echo ($optionName == $this->element->getValue()) ? 'checked="checked"' : ''; ?> <?php echo ($this->element->disable === true
                            || (is_array($this->element->disable) && in_array($optionName, $this->element->disable)))
                            ? 'disabled="disabled"' : ''; ?> value="<?php echo $optionName; ?>">
                        &nbsp;<img style="max-width: 32px; max-height: 32px;" src="<?php echo $this->migratorImage($this->element->getImage($optionName)); ?>"><span class="migrate-by-mode-selector-radio-label"><?php echo false === $this->element->escape ? $optionTitle : $this->escape($optionTitle); ?></span>
                    </label>
                </div>
            <?php endforeach;?>
        </div>

        <div style="padding-top: 5px; padding-bottom: 5px;">
            <label for="show-existing-subscriptions">
                <input type="checkbox" id="show-existing-subscriptions">
                <?php echo $this->lmsg('selectObjectsFormShowExistingSubscriptions') ?>
            </label>
        </div>

        <?php if ($this->element->getHintText()) { ?>
        <span class="hint"><?php echo htmlspecialchars($this->element->getHintText()); ?></span>
        <?php } ?>
    </div>
</div>
<?php
$this->includeMigratorJavaScript('radio-mode-selector.js');
?>
