| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 3 |
|
| 4 |
$disabled_class = $data['checkbox_selected'] ? ' disabled' : ''; |
| 5 |
|
| 6 |
if ( $data['checkbox_selected'] ) { |
| 7 |
// translators: %s is a folder path. |
| 8 |
$button_title = sprintf( esc_attr__( 'The folder "%s" is already selected.', 'imagify' ), $data['relative_path'] ); |
| 9 |
// translators: %s is a folder path. |
| 10 |
$folder_title = sprintf( esc_attr__( 'The folder "%s" is already selected.', 'imagify' ), $data['relative_path'] ); |
| 11 |
} else { |
| 12 |
// translators: %s is a folder path. |
| 13 |
$button_title = sprintf( esc_attr__( 'Open/Close the folder "%s".', 'imagify' ), $data['relative_path'] ); |
| 14 |
// translators: %s is a folder path. |
| 15 |
$folder_title = sprintf( esc_attr__( 'Select the folder "%s".', 'imagify' ), $data['relative_path'] ); |
| 16 |
} |
| 17 |
?> |
| 18 |
|
| 19 |
<li <?php echo $data['checkbox_selected'] ? ' class="imagify-folder-already-selected"' : ''; ?>> |
| 20 |
<?php if ( empty( $data['no_button'] ) ) : ?> |
| 21 |
<button type="button" class="imagify-folder" data-folder="<?php echo esc_attr( $data['relative_path'] ); ?>"<?php disabled( true, $data['checkbox_selected'] ); ?> title="<?php echo esc_attr( $button_title ); ?>"> |
| 22 |
<?php if ( ! $data['checkbox_selected'] ) { ?> |
| 23 |
<span class="imagify-loader"><img alt="<?php esc_attr_e( 'Loading...', 'imagify' ); ?>" src="<?php echo esc_url( IMAGIFY_ASSETS_IMG_URL . 'spinner.gif' ); ?>" width="20" height="20"/></span> |
| 24 |
<?php } ?> |
| 25 |
<span class="imagify-folder-icon"><svg width="20px" height="17px" viewBox="0 0 20 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-608.000000, -318.000000)" stroke-linecap="round" stroke-linejoin="round"><g transform="translate(609.000000, 319.000000)" stroke="#000000" stroke-width="2"><path d="M0,14.1428571 L18,14.1428571 L18,1.92857143 L7.71428571,1.92857143 L5.14285714,0 L0,0 L0,14.1428571 Z M18,5.14285714 L0,5.14285714 L18,5.14285714 Z"></path></g></g></svg></span> |
| 26 |
</button> |
| 27 |
<?php else : ?> |
| 28 |
<span class="imagify-folder<?php echo esc_attr( $disabled_class ); ?>"> |
| 29 |
<span class="imagify-folder-icon"><svg width="20px" height="17px" viewBox="0 0 20 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-608.000000, -318.000000)" stroke-linecap="round" stroke-linejoin="round"><g transform="translate(609.000000, 319.000000)" stroke="#000000" stroke-width="2"><path d="M0,14.1428571 L18,14.1428571 L18,1.92857143 L7.71428571,1.92857143 L5.14285714,0 L0,0 L0,14.1428571 Z M18,5.14285714 L0,5.14285714 L18,5.14285714 Z"></path></g></g></svg></span> |
| 30 |
</span> |
| 31 |
<?php endif; ?> |
| 32 |
|
| 33 |
<input type="checkbox" name="imagify-custom-files[]" value="<?php echo esc_attr( $data['checkbox_value'] ); ?>" id="imagify-custom-folder-<?php echo esc_attr( $data['checkbox_id'] ); ?>" class="screen-reader-text" <?php disabled( true, $data['checkbox_selected'] ); ?> /> |
| 34 |
|
| 35 |
<label for="imagify-custom-folder-<?php echo esc_attr( $data['checkbox_id'] ); ?>" title="<?php echo esc_attr( $folder_title ); ?>"> |
| 36 |
<?php echo esc_html( $data['label'] ); ?> |
| 37 |
|
| 38 |
<span class="imagify-add-ed-folder"> |
| 39 |
<?php |
| 40 |
if ( $data['checkbox_selected'] ) { |
| 41 |
esc_html_e( 'Folder Added', 'imagify' ); |
| 42 |
} else { |
| 43 |
echo esc_html_x( 'Add Folder', 'checkbox label', 'imagify' ); |
| 44 |
} |
| 45 |
?> |
| 46 |
<span class="imagify-fake-checkbox"></span> |
| 47 |
</span> |
| 48 |
</label> |
| 49 |
</li> |
| 50 |
|