<?php
defined('ABSPATH') or die('No script kiddies please!!');
?>
<div class="std-form-each-component">
    <?php include(STD_PATH . '/inc/views/backend/js-templates/custom-fields/tmpl-custom-field-head.php'); ?>
    <div class="std-component-body" style="display: block;">
        <div class="std-field-wrap">
            <label><?php esc_html_e('Label', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <input type="text" name="form_details[form][custom_fields][{{data.field_key}}][label]" value="{{data.label}}">
                <p class="description"><?php esc_html_e('This label is just for recognizing the field. This field won\'t show in the form.', 'subscribe-to-download'); ?></p>
            </div>
        </div>
        <div class="std-field-wrap">
            <label><?php esc_html_e('Hidden Field Type', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <select name="form_details[form][custom_fields][hidden_field_type]" class="std-toggle-trigger" data-toggle-class="std-hidden-field-ref">

                    <option value="current_page_url"><?php esc_html_e('Current Page URL', 'subscribe-to-download'); ?></option>
                    <option value="user_ip"><?php esc_html_e('User Public IP', 'subscribe-to-download'); ?></option>
                    <option value="request"><?php esc_html_e('URL/$_REQUEST Parameter', 'subscribe-to-download'); ?></option>
                    <option value="prefilled"><?php esc_html_e('Pre Filled Value', 'subscribe-to-download'); ?></option>
                </select>
            </div>
        </div>
        <div class="std-field-wrap std-hidden-field-ref <?php echo ($hidden_field_type != 'request') ? 'std-display-none' : ''; ?>" data-toggle-ref="request">
            <label><?php esc_html_e('URL/$_REQUEST Parameter Key', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <input type="text" name="form_details[form][custom_fields][url_parameter_key]" />
            </div>
        </div>
        <div class="std-field-wrap std-hidden-field-ref std-display-none" data-toggle-ref="prefilled">
            <label><?php esc_html_e('Pre Filled Value', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <input type="text" name="form_details[form][custom_fields][pre_filled_value]" />
            </div>
        </div>
    </div>
</div>