<?php

/**
 * Enable SVG upload related code goes in this page
 */

if (!defined('ABSPATH')) {
    exit;
}

// Only admins can enable/disable
$sapmfly_is_admin = current_user_can('administrator');
?>

<div class="svg-upload-wrap toggle-block-bg">

    <label class="sapmfly-switch-update">
        <div class="svg-upload-header toggle-header" <?php if (!$sapmfly_is_admin) echo 'onclick="sapmflySvgShowPopup();"' ?>>
            <?php echo esc_html__('Enable SVG Images', 'minifly'); ?>

            <input type="checkbox" class="sapmfly-setting-toggle" name="sapmfly_enable_svg_images"
                <?php checked($enable_svg_images, 'yes'); ?>
                <?php echo $sapmfly_is_admin ? '' : 'disabled'; ?> />

            <span class="sapmfly-slider"></span>
        </div>
    </label>

    <div class="sapmfly-toggle-resource-body">
        <div class="sapmfly-docs">
            <p>
                <a href="#" target="_blank">
                    <?php echo esc_html__('Docs', 'minifly'); ?>
                </a>
            </p>
        </div>
        <div class="sapmfly-tags">
            <p><?php echo esc_html__('New Feature', 'minifly'); ?></p>
        </div>
    </div>

</div>


<!-- Hidden Modal Popup for SVG -->
<div id="sapmfly-svg-popup" class="minifly-pro-popup">
    <p>
        <?php echo esc_html__('For security reasons, only the main admin can enable or disable this feature', 'minifly'); ?>
    </p>
    <button type="button" onclick="sapmflySvgClosePopup()">
        <?php echo esc_html__('Close', 'minifly'); ?>
    </button>
</div>

<!-- Overlay -->
<div id="sapmfly-svg-overlay" class="minifly-pro-overlay" onclick="sapmflySvgClosePopup()"></div>