ltsecurityinc安防产品在线商城代码
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Plumrocket_CookieConsentPro
|
||||
* @copyright Copyright (c) 2025 Plumrocket Inc.
|
||||
* @license https://plumrocket.com/license End-user License Agreement
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/** @var \Magento\Framework\View\Element\Template $block */
|
||||
|
||||
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
|
||||
$cspNonceViewModel = $block->getData('cspNonceViewModel');
|
||||
|
||||
/** @var \Plumrocket\GPC\ViewModel\CookieConsentManagement $globalPrivacyControlViewModel */
|
||||
$globalPrivacyControlViewModel = $block->getData('globalPrivacyControlViewModel');
|
||||
?>
|
||||
|
||||
<script <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
|
||||
(() => {
|
||||
const updateConsents = () => {
|
||||
<?php if ($globalPrivacyControlViewModel->shouldDeclineAllCategories()): ?>
|
||||
if (! Array.isArray(prCookieConsentApi.consent.get()) || prCookieConsentApi.consent.get().length > 0) {
|
||||
prCookieConsentApi.consent.declineAll();
|
||||
}
|
||||
<?php else: ?>
|
||||
let categoriesToDecline = <?= /* @noEscape */ $globalPrivacyControlViewModel->getCategoriesToDeclineJson() ?>,
|
||||
categoriesToAllow = <?= /* @noEscape */ $globalPrivacyControlViewModel->getAllowedCategoriesJson() ?>;
|
||||
|
||||
if (! Array.isArray(prCookieConsentApi.consent.get()) || prCookieConsentApi.isAllCategoriesAllowed()) {
|
||||
prCookieConsentApi.consent.set(categoriesToAllow);
|
||||
}
|
||||
|
||||
for (let i = 0; i < categoriesToDecline.length; i++) {
|
||||
if (prCookieConsentApi.isAllowedCategory(categoriesToDecline[i])) {
|
||||
prCookieConsentApi.consent.set(categoriesToAllow);
|
||||
break;
|
||||
}
|
||||
}
|
||||
<?php endif; ?>
|
||||
}
|
||||
|
||||
prGlobalPrivacyControlApi.signalHandlers.addHandler(updateConsents);
|
||||
})();
|
||||
</script>
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Plumrocket_CookieConsentPro
|
||||
* @copyright Copyright (c) 2025 Plumrocket Inc.
|
||||
* @license https://plumrocket.com/license End-user License Agreement
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/** @var \Magento\Framework\View\Element\Template $block */
|
||||
|
||||
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
|
||||
$cspNonceViewModel = $block->getData('cspNonceViewModel');
|
||||
|
||||
/** @var \Plumrocket\GlobalPrivacyControl\ViewModel\OptOutNotification $optOutNotificationViewModel */
|
||||
$optOutNotificationViewModel = $block->getData('optOutNotificationViewModel');
|
||||
?>
|
||||
|
||||
<script <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
|
||||
(() => {
|
||||
const updateSettingBar = () => {
|
||||
const intervalId = setInterval(() => {
|
||||
const bar = document.getElementById('pr-cookie-setting-bar');
|
||||
if (! bar) {
|
||||
return;
|
||||
}
|
||||
|
||||
clearInterval(intervalId);
|
||||
bar.querySelectorAll('input[type="checkbox"], button.action')
|
||||
.forEach(el => el.disabled = true);
|
||||
|
||||
<?php if ($optOutNotificationViewModel->isEnabled()): ?>
|
||||
let notification = '<?= $optOutNotificationViewModel->getNotificationHtml(true) ?>';
|
||||
bar.querySelector('.pr-cookie-description')
|
||||
.insertAdjacentHTML('beforebegin', notification);
|
||||
<?php endif; ?>
|
||||
}, 400);
|
||||
}
|
||||
|
||||
prGlobalPrivacyControlApi.signalHandlers.addHandler(updateSettingBar);
|
||||
})();
|
||||
</script>
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Plumrocket_CookieConsentPro
|
||||
* @copyright Copyright (c) 2025 Plumrocket Inc.
|
||||
* @license https://plumrocket.com/license End-user License Agreement
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/** @var \Plumrocket\CookieConsent\Block\Html\HeadScripts $block */
|
||||
/** @var \Plumrocket\CookieConsentPro\ViewModel\Integration\MicrosoftAds $microsoftAdsViewModel */
|
||||
$microsoftAdsViewModel = $block->getData('microsoftAdsViewModel');
|
||||
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
|
||||
$cspNonceViewModel = $block->getData('cspNonceViewModel');
|
||||
?>
|
||||
<?php if ($microsoftAdsViewModel->isEnabled()): ?>
|
||||
<script type="text/javascript" <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
|
||||
(function(config) {
|
||||
var defaults = { wait_for_update: 1000 };
|
||||
for (const [consentType, consentConfig] of Object.entries(config)) {
|
||||
defaults[consentType] = consentConfig.default_status;
|
||||
}
|
||||
|
||||
window.uetq = window.uetq || [];
|
||||
window.uetq.push('consent', 'default', defaults);
|
||||
|
||||
document.addEventListener('pr-cookie-consent-api:configured', () => {
|
||||
const updateConsents = () => {
|
||||
let updated = {};
|
||||
for (const [consentType, consentConfig] of Object.entries(config)) {
|
||||
let cookieCategory = consentConfig.cookie_category;
|
||||
updated[consentType] = prCookieConsentApi.isAllowedCategory(cookieCategory) ? 'granted' : 'denied'
|
||||
}
|
||||
window.uetq.push('consent', 'update', updated);
|
||||
}
|
||||
|
||||
updateConsents();
|
||||
prCookieConsentApi.consent.addCallback(updateConsents);
|
||||
});
|
||||
})(JSON.parse("<?= $block->escapeJs($microsoftAdsViewModel->getConsentTypesConfigJson()) ?>"));
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Plumrocket_CookieConsentPro
|
||||
* @copyright Copyright (c) 2025 Plumrocket Inc.
|
||||
* @license https://plumrocket.com/license End-user License Agreement
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/** @var \Plumrocket\CookieConsent\Block\Html\HeadScripts $block */
|
||||
/** @var \Plumrocket\CookieConsentPro\ViewModel\Integration\MicrosoftClarity $microsoftClarityViewModel */
|
||||
$microsoftClarityViewModel = $block->getData('microsoftClarityViewModel');
|
||||
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
|
||||
$cspNonceViewModel = $block->getData('cspNonceViewModel');
|
||||
?>
|
||||
|
||||
<?php if ($microsoftClarityViewModel->isEnabled()): ?>
|
||||
<script type="text/javascript" <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
|
||||
(function(config) {
|
||||
window.clarity = window.clarity || function() {(window.clarity.q = window.clarity.q || []).push(arguments);};
|
||||
|
||||
if (! prCookieService.get('pr-cookie-consent')) {
|
||||
var defaults = {};
|
||||
for (const [consentType, consentConfig] of Object.entries(config)) {
|
||||
defaults[consentType] = consentConfig.default_status;
|
||||
}
|
||||
window.clarity('consentv2', defaults);
|
||||
}
|
||||
|
||||
document.addEventListener('pr-cookie-consent-api:configured', () => {
|
||||
const updateConsents = () => {
|
||||
let updated = {};
|
||||
for (const [consentType, consentConfig] of Object.entries(config)) {
|
||||
let cookieCategory = consentConfig.cookie_category;
|
||||
updated[consentType] = prCookieConsentApi.isAllowedCategory(cookieCategory) ? 'granted' : 'denied'
|
||||
}
|
||||
window.clarity('consentv2', updated);
|
||||
}
|
||||
|
||||
updateConsents();
|
||||
prCookieConsentApi.consent.addCallback(updateConsents);
|
||||
});
|
||||
})(JSON.parse("<?= $block->escapeJs($microsoftClarityViewModel->getConsentTypesConfigJson()) ?>"));
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user