<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
?>
<?php
$is_basic_tier = class_exists( 'SftcyWordformFeatures' ) && 'basic' === SftcyWordformFeatures::wordform_get_product_tier();
$upload_limits = class_exists( 'SftcyWordformFeatures' ) ? SftcyWordformFeatures::wordform_get_feature_limits( 'upload' ) : array();
$wordform_upgrade_url = class_exists( 'SftcyWordformFeatures' ) ? SftcyWordformFeatures::wordform_get_upgrade_url() : 'https://softcoy.com/products/wordform-pro/checkout';
?>

<div id="<?php echo esc_attr( $element_wrapper_id ); ?>" class="wordform-upload-field-options-wrapper show-hide-common-class-all-options-wrapper-element" data-wrapper-element-type = "upload" data-element-index-val="<?php echo esc_attr( $element_index ); ?>" >	

	<h4><?php esc_html_e( 'Field Required:', 'wordform-pro' ); ?></h4>
	<ul class="wordform-required-ul">
		<li>            
			<input class="required-checkbox" type="checkbox" /><?php esc_html_e( 'Required', 'wordform-pro' ); ?>
			<small>( <?php esc_html_e( 'Check if Required', 'wordform-pro' ); ?> )</small>
		</li>
	</ul>
	<hr/>

	<h4><?php esc_html_e( 'Upload Label:', 'wordform-pro' ); ?></h4>
	<ul class="wordform-input-label">	
		<li>				    
			<input class="wordform-upload-label-name" type="text" placeholder="Upload Label" />            
		</li>
	</ul>	
	<hr/>

	<h4><?php esc_html_e( 'Select File Label:', 'wordform-pro' ); ?></h4>
	<ul class="wordform-input-label">	
		<li>				    
			<input class="wordform-upload-select-file-label-name" type="text" placeholder="Select File Label" />            
		</li>
	</ul>	
	<hr/>

	<h4><?php esc_html_e( 'Allow Upload File Types:', 'wordform-pro' ); ?><br/><small>(<?php esc_html_e( 'Check file types you want to allow to upload', 'wordform-pro' ); ?>  )</small></h4>		
	<ul class="wordform-field-options">				
		<li> 
			<input type="checkbox" id="wordformUploadAllowAllImageTypes" class="wordform-upload-allow-file-type-name-checkbox" value="image" checked />
            <label for="wordformUploadAllowAllImageTypes"><?php esc_html_e( 'Image', 'wordform-pro' );?></label>			
		</li> 		
        <li class="<?php echo $is_basic_tier ? 'wordform-tier-option-locked' : ''; ?>">
            <input type="checkbox" id="wordformUploadAllowPdfTypes" class="wordform-upload-allow-file-type-name-checkbox" value="pdf" <?php disabled( $is_basic_tier ); ?> />
            <label for="wordformUploadAllowPdfTypes"><?php esc_html_e( 'Pdf', 'wordform-pro' );?></label>			
        </li>
        <li class="<?php echo $is_basic_tier ? 'wordform-tier-option-locked' : ''; ?>">
            <input type="checkbox" id="wordformUploadAllowWordTypes" class="wordform-upload-allow-file-type-name-checkbox" value="word" <?php disabled( $is_basic_tier ); ?> />
            <label for="wordformUploadAllowWordTypes"><?php esc_html_e( 'Word', 'wordform-pro' );?></label>			
        </li>
        <li class="<?php echo $is_basic_tier ? 'wordform-tier-option-locked' : ''; ?>">
            <input type="checkbox" id="wordformUploadAllowExcelTypes" class="wordform-upload-allow-file-type-name-checkbox" value="excel" <?php disabled( $is_basic_tier ); ?> />
            <label for="wordformUploadAllowExcelTypes"><?php esc_html_e( 'Excel/Spreadsheet', 'wordform-pro' );?></label>			
        </li>
        <li class="<?php echo $is_basic_tier ? 'wordform-tier-option-locked' : ''; ?>">
            <input type="checkbox" id="wordformUploadAllowCsvTypes" class="wordform-upload-allow-file-type-name-checkbox" value="csv" <?php disabled( $is_basic_tier ); ?> />
            <label for="wordformUploadAllowCsvTypes"><?php esc_html_e( 'CSV', 'wordform-pro' );?></label>			
        </li>
        <li class="<?php echo $is_basic_tier ? 'wordform-tier-option-locked' : ''; ?>">
            <input type="checkbox" id="wordformUploadAllowTextTypes" class="wordform-upload-allow-file-type-name-checkbox" value="text" <?php disabled( $is_basic_tier ); ?> />
            <label for="wordformUploadAllowTextTypes"><?php esc_html_e( 'Text', 'wordform-pro' );?></label>			
        </li>
        <li class="<?php echo $is_basic_tier ? 'wordform-tier-option-locked' : ''; ?>">
            <input type="checkbox" id="wordformUploadAllowAudioTypes" class="wordform-upload-allow-file-type-name-checkbox" value="audio" <?php disabled( $is_basic_tier ); ?> />
            <label for="wordformUploadAllowAudioTypes"><?php esc_html_e( 'Audio', 'wordform-pro' );?></label>			
        </li>
        <li class="<?php echo $is_basic_tier ? 'wordform-tier-option-locked' : ''; ?>">
            <input type="checkbox" id="wordformUploadAllowVideoTypes" class="wordform-upload-allow-file-type-name-checkbox" value="video" <?php disabled( $is_basic_tier ); ?> />
            <label for="wordformUploadAllowVideoTypes"><?php esc_html_e( 'Video', 'wordform-pro' );?></label>			
        </li>

	</ul>
	<?php if ( $is_basic_tier ) { ?>
	<small class="wordform-tier-option-hint">
		<em><?php echo esc_html( ! empty( $upload_limits['label'] ) ? $upload_limits['label'] : __( 'Image uploads only in the free version.', 'wordform' ) ); ?></em>
		<a class="button button-small wordform-pro-locked-button" href="<?php echo esc_url( $wordform_upgrade_url ); ?>" target="_blank" rel="noopener" data-upgrade-url="<?php echo esc_url( $wordform_upgrade_url ); ?>" title="<?php esc_attr_e( 'Get Pro', 'wordform' ); ?>"><?php esc_html_e( 'Get Pro', 'wordform' ); ?></a>
	</small>
	<?php } ?>
	<hr/>

	<h4><?php esc_html_e( 'Allow Multiple Upload:', 'wordform-pro' ); ?><br/><small>( <?php esc_html_e( 'Check if users require to upload multiple files', 'wordform-pro' ); ?> )</small></h4>
	<ul class="wordform-multiple-ul">
		<li class="<?php echo $is_basic_tier ? 'wordform-tier-option-locked' : ''; ?>">            
			<input id="wordformMultipleUploadAllowLabel" class="multiple-checkbox" type="checkbox" <?php disabled( $is_basic_tier ); ?> />
			<label for="wordformMultipleUploadAllowLabel" ><?php esc_html_e( 'Multiple Upload', 'wordform-pro' );?></label>			
		</li>
	</ul>	
	<?php if ( $is_basic_tier ) { ?>
	<small class="wordform-tier-option-hint"><em><?php esc_html_e( 'WordForm free keeps upload fields to a single file. Upgrade to Pro for multi-file uploads and broader file types.', 'wordform' ); ?></em></small>
	<?php } ?>


</div><!-- /.wordform-upload-field-options-wrapper -->
