<?php
if (!defined('ABSPATH')) exit; // Exit if accessed directly 
?>

<div class="iwbvel-modal" id="iwbvel-modal-yikes-custom-product-tabs">
    <div class="iwbvel-modal-container">
        <div class="iwbvel-modal-box iwbvel-modal-box-lg">
            <div class="iwbvel-modal-content">
                <div class="iwbvel-modal-title">
                    <h2><?php esc_html_e('Yikes Custom tabs', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?> - <span id="iwbvel-modal-yikes-custom-product-tabs-item-title" class="iwbvel-modal-item-title"></span></h2>
                    <button type="button" class="iwbvel-modal-close" data-toggle="modal-close">
                        <i class="iwbvel-icon-x"></i>
                    </button>
                </div>
                <div class="iwbvel-modal-body">
                    <div class="iwbvel-wrap">
                        <form id="yikes-custom-product-tabs-form">
                            <div id="iwbvel-modal-yikes-custom-tabs"></div>
                        </form>
                        <div class="iwbvel-modal-yikes-buttons">
                            <button type="button" class="iwbvel-button iwbvel-button-blue iwbvel-float-right" id="iwbvel-yikes-add-saved-tab"><?php esc_html_e('Add a saved tab', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></button>
                            <button type="button" class="iwbvel-button iwbvel-button-blue iwbvel-float-right" id="iwbvel-yikes-add-tab"><?php esc_html_e('Add a tab', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></button>
                        </div>
                        <div class="iwbvel-hide">
                            <?php
                            if (file_exists(IWBVEL_VIEWS_DIR . 'bulk_edit/columns_modal/yikes_custom_tab_item.php')) {
                                $iwbvel_duplicate_item = 'yes';
                                include IWBVEL_VIEWS_DIR . 'bulk_edit/columns_modal/yikes_custom_tab_item.php';
                            }
                            ?>
                        </div>
                    </div>
                </div>
                <div class="iwbvel-modal-footer">
                    <button type="button" id="iwbvel-modal-yikes-custom-product-tabs-apply" data-item-id="" data-field="" data-content-type="select_files" class="iwbvel-button iwbvel-button-blue" data-toggle="modal-close">
                        <?php esc_html_e('Apply Changes', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>
                    </button>
                    <button type="button" class="iwbvel-button iwbvel-button-gray iwbvel-float-right" data-toggle="modal-close">
                        <?php esc_html_e('Close', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>
                    </button>
                </div>
            </div>
        </div>
    </div>
    <?php
    $iwbvel_saved_tabs = get_option('yikes_woo_reusable_products_tabs');
    if (!empty($iwbvel_saved_tabs)) :
    ?>
        <div class="iwbvel-yikes-saved-tabs">
            <div class="iwbvel-yikes-saved-tabs-box">
                <div class="iwbvel-yikes-saved-tabs-header">
                    <strong><?php esc_html_e('Choose a tab', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></strong>
                    <button type="button" class="iwbvel-yikes-saved-tabs-close-button"><i class="iwbvel-icon-x"></i></button>
                    <hr>
                </div>
                <ul>
                    <?php foreach ($iwbvel_saved_tabs as $iwbvel_saved_tab) :
                        if (!empty($iwbvel_saved_tab['tab_slug'])) :
                    ?>
                            <li>
                                <?php echo esc_html($iwbvel_saved_tab['tab_slug']); ?>
                                <button type="button" data-id="<?php echo esc_attr($iwbvel_saved_tab['tab_id']); ?>" class="iwbvel-yikes-saved-tab-add"><i class="iwbvel-icon-plus1"></i></button>
                            </li>
                    <?php
                        endif;
                    endforeach; ?>
                </ul>
            </div>
        </div>
    <?php endif; ?>
</div>