<?php
/**
 * @package MatrixAddons
 * @subpackage trainifyframework
 * @since trainifyframework 1.0.0
 * @version 1.0.0
 * @description UPLOAD field for widget
 */
?>
<p class="tff-widget-field-wrapper sub-option widget-upload <?php echo esc_attr($trainify_framework_widget_field_wraper); ?>">
	<label for="<?php echo esc_attr( $trainifyframeworkwidget->get_field_id( $trainify_framework_widget_field_name ) ); ?>"><?php echo esc_html( $trainify_framework_widget_field_title ); ?></label>
	<span class="img-preview-wrap" <?php echo empty( $trainify_framework_widget_field_value ) ? 'style="display:none;"' : ''; ?>>
		<img class="widefat" src="<?php echo esc_url( $trainify_framework_widget_field_value ); ?>" alt="<?php esc_attr_e( 'Image preview', 'trainify' ); ?>"  />
	</span>
	<!-- .img-preview-wrap -->
	<input type="text" class="widefat <?php echo esc_attr($trainify_framework_widget_relation_class); ?>" name="<?php echo esc_attr( $trainifyframeworkwidget->get_field_name( $trainify_framework_widget_field_name ) ); ?>" id="<?php echo esc_attr( $trainifyframeworkwidget->get_field_id( $trainify_framework_widget_field_name ) ); ?>" placeholder="<?php esc_attr_e('Choose file', 'trainify'); ?>" value="<?php echo esc_url( $trainify_framework_widget_field_value ); ?>" data-relations="<?php echo esc_attr($trainify_framework_widget_relation_json) ?>" />
	<input type="button" value="<?php esc_attr_e( 'Upload', 'trainify' ); ?>" class="button media-image-upload" data-title="<?php esc_attr_e( 'Select Image','trainify'); ?>" data-button="<?php esc_attr_e( 'Select Image','trainify'); ?>"/>
	<input type="button" value="<?php esc_attr_e( 'Remove', 'trainify' ); ?>" class="button media-image-remove" />
</p>