<?php
$attributes = '';
if ($args['id']) {
    $attributes .= ' id="' . $args['id'] . '" ';
}

if ($args['name']) {
    $attributes .= ' name="' . $args['name'] . '" ';
}

if ($args['value']) {
    $attributes .= ' value="' . $args['value'] . '"';
}

if ($args['required']) {
    $attributes .= ' required';
}

$conditional = salesloo_field_get_conditional_data($args);

?>
<div class="salesloo-field <?php echo $args['direction']; ?>" <?php echo implode(' ', $conditional); ?>>
    <div class="salesloo-field-label">
        <label><?php echo $args['label']; ?></label>
    </div>
    <div class="salesloo-field-input">
        <div class="salesloo-field__file">
            <?php echo $args['before']; ?>
            <input type="text" class="regular-text" <?php echo $attributes; ?>>
            <a href="#" class="button" data-choose="Choose File" data-update="Insert file URL">Choose File</a>
            <?php echo $args['after']; ?>
        </div>
        <p class="description"><?php echo $args['description']; ?></p>
    </div>
</div>