'unit.html', 'gallery' => 'unit_gallery.html', 'full' => 'unit_full.html'); protected $sUnitViewDefault = 'gallery'; protected $sUnitViewParamName = 'unit_view'; function __construct($sMode = '', $aParams = array()) { parent::__construct($sMode, $aParams); if (!empty($aParams['unit_view'])) $this->sUnitViewDefault = $aParams['unit_view']; $this->aGetParams = array($this->sUnitViewParamName); $this->sUnitTemplate = $this->aUnitViews[$this->sUnitViewDefault]; if (isset($this->aUnitViews[bx_get($this->sUnitViewParamName)])) $this->sUnitTemplate = $this->aUnitViews[bx_get($this->sUnitViewParamName)]; if ('unit_gallery.html' == $this->sUnitTemplate) $this->addContainerClass (array('bx-def-margin-sec-neg', 'bx-base-text-unit-gallery-wrapper')); } protected function processReplaceableMarkers($oProfileAuthor) { if ($oProfileAuthor) { $this->addMarkers($oProfileAuthor->getInfo()); // profile info is replaceable $this->addMarkers(array('profile_id' => $oProfileAuthor->id())); // profile id is replaceable $this->addMarkers(array('display_name' => $oProfileAuthor->getDisplayName())); // profile display name is replaceable } $this->sBrowseUrl = $this->_replaceMarkers($this->sBrowseUrl); $this->aCurrent['title'] = $this->_replaceMarkers($this->aCurrent['title']); } protected function addConditionsForPrivateContent($CNF, $oProfileAuthor) { // add conditions for private content $oPrivacy = BxDolPrivacy::getObjectInstance($CNF['OBJECT_PRIVACY_VIEW']); $a = $oPrivacy ? $oPrivacy->getContentPublicAsCondition($oProfileAuthor ? $oProfileAuthor->id() : 0) : array(); if (isset($a['restriction'])) $this->aCurrent['restriction'] = array_merge($this->aCurrent['restriction'], $a['restriction']); if (isset($a['join'])) $this->aCurrent['join'] = array_merge($this->aCurrent['join'], $a['join']); $this->setProcessPrivateContent(false); } protected function getCurrentOnclick($aAdditionalParams = array(), $bReplacePagesParams = true) { // always add UnitView as additional param $sUnitView = bx_process_input(bx_get($this->sUnitViewParamName)); if ($sUnitView && isset($this->aUnitViews[$sUnitView])) $aAdditionalParams = array_merge(array($this->sUnitViewParamName => $sUnitView), $aAdditionalParams); return parent::getCurrentOnclick($aAdditionalParams, $bReplacePagesParams); } function _getPseud () { return array( 'id' => 'id', 'title' => 'title', 'text' => 'text', 'added' => 'added', 'author' => 'author', 'photo' => 'photo', ); } } /** @} */