isClosed(); } private function isClosed() { return '1' == Qs_Request::getCookieValue($this->getCookieName()); } private function getEventId() { return App_Settings_Obj::get('eventPopupEventId'); } private function getCookieName() { return 'e-popup-closed-' . $this->getEventId(); } public function render() { $dialogId = 'event-popup'; $item = [ 'dialogId' => $dialogId, 'content' => App_Settings_Obj::get('eventPopupContent'), 'registrationUrl' => App_Settings_Obj::get('eventPopupRegistrationUrl'), ]; return $this->getDoc() ->assign('item', new Qs_Doc_Item($item)) ->addScript('js/js.cookie.js') ->addScript('js/app/eventPopup/popup.js') ->addInitObject('app.EventPopup.Popup', [[ 'id' => $dialogId, 'cookieName' => $this->getCookieName(), 'delay' => (int) App_Settings_Obj::get('eventPopupDelay'), 'nodes' => [ 'btnRegister' => '[data-btn="register"]', 'btnClose' => '[data-btn="close"]', ], ]]) ->fetchTemplate('EventPopup/popup.tpl'); } /** * @return \Qs_Doc * @throws \Zend_Exception */ private function getDoc() { return Zend_Registry::get('doc'); } }