Files
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

39 lines
1.3 KiB
PHP

<?php
namespace luckywp\cookieNoticeGdpr\front\widgets\showAgain;
use luckywp\cookieNoticeGdpr\core\base\Widget;
use luckywp\cookieNoticeGdpr\core\Core;
class ShowAgain extends Widget
{
public function run()
{
$label = Core::$plugin->settings->getValue('general', 'showAgainLabel');
if (!$label) {
$label = __('Privacy Policy', 'luckywp-cookie-notice-gdpr');
}
$colorScheme = Core::$plugin->settings->getValue('appearance', 'showAgainColorScheme');
if (!in_array($colorScheme, ['light', 'dark'])) {
$colorScheme = 'light';
}
$position = null;
$position = Core::$plugin->settings->getValue('appearance', 'showAgainPosition');
if (!in_array($position, ['bottomLeft', 'bottomRight'])) {
$position = 'bottomRight';
}
return $this->render('widget', [
'label' => $label,
'show' => Core::$plugin->cookieAccepted || Core::$plugin->cookieRejected,
'colorScheme' => $colorScheme,
'position' => $position,
'marginBottom' => (int)Core::$plugin->settings->getValue('appearance', 'showAgainMarginBottom'),
'marginSide' => (int)Core::$plugin->settings->getValue('appearance', 'showAgainMarginSide'),
]);
}
}