_oModule->_oConfig->CNF; $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT); if ($iContentId) $this->_aContentInfo = $this->_oModule->_oDb->getContentInfoById($iContentId); $sTitle = $sUrl = $sIcon = ""; if ($this->_aContentInfo && CHECK_ACTION_RESULT_ALLOWED === $this->_oModule->checkAllowedView($this->_aContentInfo)) { $sTitle = isset($this->_aContentInfo[$CNF['FIELD_TITLE']]) ? $this->_aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($this->_aContentInfo[$CNF['FIELD_TEXT']], 20, '...'); $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $this->_aContentInfo[$CNF['FIELD_ID']]); $sIcon = $CNF['ICON']; $this->addMarkers($this->_aContentInfo); // every field can be used as marker } $this->addMarkers(array( 'title' => $sTitle, 'entry_link' => $sUrl, )); // select view entry submenu $this->_setSubmenu(array( 'title' => $sTitle, 'link' => $sUrl, 'icon' => $sIcon )); } public function isActive() { $CNF = &$this->_oModule->_oConfig->CNF; if($this->_aContentInfo[$CNF['FIELD_AUTHOR']] == bx_get_logged_profile_id() || $this->_oModule->_isModerator()) return true; if(isset($CNF['FIELD_STATUS']) && $this->_aContentInfo[$CNF['FIELD_STATUS']] != 'active') return false; if(isset($CNF['FIELD_STATUS_ADMIN']) && $this->_aContentInfo[$CNF['FIELD_STATUS_ADMIN']] != 'active') return false; return true; } protected function _setSubmenu($aParams) { $CNF = &$this->_oModule->_oConfig->CNF; $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu'); $oMenuSubmenu->setObjectSubmenu($CNF['OBJECT_MENU_SUBMENU_VIEW_ENTRY'], array_merge(array( 'title' => '', 'link' => '', 'icon' => '', ), $aParams)); } protected function _getBlockService ($aBlock) { $a = parent::_getBlockService ($aBlock); $sTest = '_view_entry_comments'; if (false !== strpos($aBlock['content'], 'entity_comments') && substr_compare($this->_sObject, $sTest, strlen($this->_sObject) - strlen($sTest), strlen($sTest)) === 0) unset($a['title']); return $a; } } /** @} */