Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/skyweb24.popuppro/lib/ |
Upload File : |
<? namespace Skyweb24\Popuppro; use Bitrix\Main\Localization\Loc; use Bitrix\Main\Web\Cookie; class Popup { use \Skyweb24\Popuppro\Conditions; private $popupId; private $settings; private $name; private $type; public function __construct($popupId) { $this->popupId = $popupId; $this->fetch(); } public function getSettings() { return $this->settings; } public function fetch() { $popup = \Skyweb24\Popuppro\Entity\PopupproTable::getById($this->popupId)->fetch(); $this->settings = $popup['settings']; $this->name = $popup['name']; $this->type = $popup['settings']["view"]['type']; return $this; } public function getName(){ return $this->name; } public function getType(){ return $this->type; } public function filling() { if(!$params = $this->getConditionValue( $this->settings['condition']['rule'], [ "REPEAT_GAME", "REPEAT_SHOW" ] ) ) { return false; } $arTime = [ "HOUR" => 3600, "DAY" => 86400, "WEEK" => 604800, "MONTH" => 2629743, "YEAR" => 31556926 ]; $time = $arTime[$params['values']['type']] * $params['values']['repeat']; $context = \Bitrix\Main\Application::getInstance()->getContext(); $response = $context->getResponse(); $cookie = new \Bitrix\Main\Web\Cookie("skyweb24PopupFilling_" . $this->popupId, 'Y', time() + $time); $cookie->setDomain($context->getServer()->getHttpHost()); $cookie->setHttpOnly(false); $response->addCookie($cookie); } }