<?php
$iubenda_siteId = laniakea_option('iubenda_site_id');
$iubenda_cookiePolicyId = laniakea_option('iubenda_cookie_policy_id');
$iubenda_cookie_position = laniakea_option('iubenda_cookie_button_pos','bottom-left');
if (!empty($iubenda_siteId) && !empty($iubenda_cookiePolicyId)) :
?>

    <!-- iubenda privacy control & cookie solution -->
    <script type="text/javascript">
        var _iub = _iub || [];
        _iub.csConfiguration = {
            "askConsentAtCookiePolicyUpdate": true,
            "floatingPreferencesButtonDisplay": "<?php echo $iubenda_cookie_position; ?>",
            "perPurposeConsent": true,
            "siteId": <?php echo $iubenda_siteId; ?>,
            "whitelabel": false,
            "cookiePolicyId": <?php echo $iubenda_cookiePolicyId;?>,
            "lang": "it",
            "banner": {
                "acceptButtonDisplay": true,
                "closeButtonRejects": true,
                "customizeButtonDisplay": true,
                "explicitWithdrawal": true,
                "listPurposes": true,
                "position": "float-top-center",
                "showTitle": false
            }
        };
    </script>
    <script type="text/javascript" src="https://cs.iubenda.com/autoblocking/<?php echo $iubenda_siteId; ?>.js"></script>
    <script type="text/javascript" src="//cdn.iubenda.com/cs/iubenda_cs.js" charset="UTF-8" async></script>
    <!-- end iubenda privacy control & cookie solution -->

<?php endif; ?>