<?php
$translate = $this->plugin('translate');
$escape = $this->plugin('escapeHtml');
$label = isset($data['label']) && '' !== trim($data['label']) ? $data['label'] : null;
$url = isset($data['url']) && '' !== trim($data['url']) ? $data['url'] : null;
$targetBlank = isset($data['target_blank']) ? (bool) $data['target_blank'] : false;
?>
<label><?php echo $translate('Type'); ?> <input type="text" value="<?php echo $escape($translate($link->getName())); ?>" disabled></label>
<label class="required"><?php echo $translate('Label'); ?> <input type="text" data-name="label" value="<?php echo $escape($label); ?>" required></label>
<label class="required"><?php echo $translate('URL'); ?> <input type="text" data-name="url" value="<?php echo $escape($url); ?>" required></label>
<label>
    <?php echo $translate('Open in new tab'); ?>
    <select data-name="target_blank">
        <option value="0"<?php echo $targetBlank ? '' : ' selected'; ?>><?php echo $translate('No'); ?></option>
        <option value="1"<?php echo $targetBlank ? 'selected' : ''; ?>><?php echo $translate('Yes'); ?></option>
    </select>
</label>
