_oModule->_oConfig->CNF; $this->_sCoverClass = 'bx-base-group-cover-wrapper ' . $this->_oModule->getName() . '_cover'; $bLoggedOwner = isset($this->_aContentInfo[$CNF['FIELD_AUTHOR']]) && $this->_aContentInfo[$CNF['FIELD_AUTHOR']] == bx_get_logged_profile_id(); $bLoggedModerator = $this->_oModule->checkAllowedEditAnyEntry() === CHECK_ACTION_RESULT_ALLOWED; $aInformers = array (); $oInformer = BxDolInformer::getInstance($this->_oTemplate); if($oInformer && ($bLoggedOwner || $bLoggedModerator)) { $sStatus = isset($CNF['FIELD_STATUS']) && isset($this->_aContentInfo[$CNF['FIELD_STATUS']]) ? $this->_aContentInfo[$CNF['FIELD_STATUS']] : ''; //--- Display 'scheduled' informer if an item wasn't published yet. if(isset($CNF['FIELD_PUBLISHED'])) { if(!empty($CNF['INFORMERS']['scheduled']) && isset($CNF['INFORMERS']['scheduled']['map'][$sStatus])) { $this->addMarkers(array( 'date_publish_uf' => bx_time_js((int)$this->_aContentInfo[$CNF['FIELD_PUBLISHED']], BX_FORMAT_DATE, true) )); $aInformer = $CNF['INFORMERS']['scheduled']; $aInformers[] = array ('name' => $aInformer['name'], 'msg' => _t($aInformer['map'][$sStatus]['msg']), 'type' => $aInformer['map'][$sStatus]['type']); } } if($aInformers) foreach($aInformers as $aInformer) $oInformer->add($aInformer['name'], $this->_replaceMarkers($aInformer['msg']), $aInformer['type']); } } protected function _processPermissionsCheck () { $CNF = &$this->_oModule->_oConfig->CNF; $oPrivacy = BxDolPrivacy::getObjectInstance($CNF['OBJECT_PRIVACY_VIEW']); $mixedAllowView = $this->_oModule->checkAllowedView($this->_aContentInfo); if (!$oPrivacy->isPartiallyVisible($this->_aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]) && CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $mixedAllowView)) { $this->_oTemplate->displayAccessDenied($sMsg); exit; } elseif ($oPrivacy->isPartiallyVisible($this->_aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]) && $CNF['OBJECT_PAGE_VIEW_ENTRY'] == $this->_sObject && CHECK_ACTION_RESULT_ALLOWED !== $mixedAllowView) { // replace current page with different set of blocks $aObject = BxDolPageQuery::getPageObject($CNF['OBJECT_PAGE_VIEW_ENTRY_CLOSED']); $this->_sObject = $aObject['object']; $this->_aObject = $aObject; $this->_oQuery = new BxDolPageQuery($this->_aObject); } $this->_oModule->checkAllowedView($this->_aContentInfo, true); } public function getCode () { $CNF = &$this->_oModule->_oConfig->CNF; $sInvitation = ''; if(!empty($CNF['TABLE_INVITES'])) { $sKey = ''; $iProfileId = bx_get_logged_profile_id(); $iGroupProfileId = $this->_oProfile->id(); if(($sKey = bx_get('key')) !== false) { $sKey = bx_process_input($sKey); $mixedInvited = $this->_oModule->isInvited($sKey, $iGroupProfileId); } else if($iProfileId !== false) $mixedInvited = $this->_oModule->isInvitedByProfileId($iProfileId, $iGroupProfileId); if ($mixedInvited === true) { $sId = $this->_oModule->getName() . '_popup_invite'; if(empty($sKey)) { $aInvite = $this->_oModule->_oDb->getInviteByInvited($iProfileId, $iGroupProfileId); if(!empty($aInvite) && is_array($aInvite)) $sKey = $aInvite['key']; } $this->_oTemplate->addJs(array('invite_popup.js')); $sInvitation .= $this->_oModule->_oTemplate->getJsCode('invite_popup', array( 'sPopupId' => $sId, 'sKey' => $sKey, 'sAcceptUrl' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $this->_aProfileInfo['content_id']), 'sDeclineUrl' => BX_DOL_URL_ROOT, 'iGroupProfileId' => $this->_oProfile->id(), )); $sInvitation .= BxTemplFunctions::getInstance()->popupBox($sId, _t($CNF['T']['txt_invitation_popup_title']), $this->_oModule->_oTemplate->parseHtmlByName('popup_invite.html', array( 'popup_id' => $sId, 'text' => _t($CNF['T']['txt_invitation_popup_text']), 'button_accept' => _t($CNF['T']['txt_invitation_popup_accept_button']), 'button_decline' => _t($CNF['T']['txt_invitation_popup_decline_button']), )), true); } } return $sInvitation . parent::getCode(); } } /** @} */