<?php
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
    $mailboxQuotaElement = $this->element->getElement('mboxQuotaValue');
?>
<div class="form-row">
    <div class="field-name">
        <?php echo $this->elementPart($this->element->getElement('postbox'))->content()?>
        <?php echo $this->elementPart($this->element->getElement('postbox'))->label()?>
    </div>
    <div class="field-value">
        <div class="text-value">
            <?php echo $this->elementPart($mailboxQuotaElement)->content(); ?>
            <span><label>
                    <input type="radio" class="radio" value="default"
                        id="<?php echo $mailboxQuotaElement->getId(); ?>-default"
                        name="<?php echo $mailboxQuotaElement->getId(); ?>-selector"
                        <?php echo $this->isDefault ? 'checked="checked"' : ''; ?>
                    />
                    <span id="general-generalSection-text-default">
                    <?php echo $this->lmsg('smb.components.forms.email-address.mailBoxQuotaDomainDefaultNew'); ?>
                    </span>
                </label>
            </span><br />
            <span><label>
                    <input type="radio" class="radio" value="specific"
                        id="<?php echo $mailboxQuotaElement->getId(); ?>-specific"
                        name="<?php echo $mailboxQuotaElement->getId(); ?>-selector"
                        <?php echo $this->isDefault ? '' : 'checked="checked"'; ?>
                    />
                    <?php echo $this->lmsg('smb.components.forms.email-address.mailBoxQuotaDomainSpecific'); ?>
                </label>
                <input type="text" class="input-text" size="10"
                       id="<?php echo $mailboxQuotaElement->getId()?>-specific-input"
                       aria-label="<?php echo $this->lmsg('smb.components.forms.email-address.mailBoxQuotaDomainSpecificValue'); ?>"
                >
                <select id="<?php echo $mailboxQuotaElement->getId() ?>-specific-multiplier"   aria-label="<?php echo $this->lmsg('smb.components.forms.email-address.mailBoxQuotaDomainSpecificMultiplier'); ?>">
                    <?php foreach($this->quotaValueUnits as $multiplier => $multiplierDescription): ?>
                        <option value="<?php echo $multiplier?>">
                            <?php echo $this->escape($multiplierDescription)?>
                        </option>
                    <?php endforeach;?>
                </select>
            </span><br />
            <span class="hint"><?php echo $this->lmsg('smb.components.forms.email-address.maxCustomSizeDesc');?></span>
            <span style="display: none;" class="field-errors"></span>
        </div>
    </div>
</div>

<div class="form-row" style="display:none;">
    <div class="field-name">
        <?php echo $this->elementPart($this->element->getElement('reason'))->label() ?>
    </div>
    <div class="field-value">
        <div class='text-value'>
            <?php echo $this->elementPart($this->element->getElement('reason'))->content() ?>
            <?php echo $this->elementPart($this->element->getElement('reason'))->description() ?>
        </div>
    </div>
</div>

<?= $this->requireJs('app/email-address/postbox', [
    'domainLimits' => $this->domainLimits,
    'units' => array_keys($this->quotaValueUnits),
    'quotaValue' => $this->quotaValue,
    'isDefault' => $this->isDefault,
]) ?>
