14 parent::__construct(
'ch_events_view', $oEventsMain, $aEvent);
19 return array($this->_oTemplate->blockInfo ($this->aDataEntry));
24 return array($this->_oTemplate->blockDesc ($this->aDataEntry));
29 return $this->
_blockPhoto ($this->_oDb->getMediaIds($this->aDataEntry[
'ID'],
'images'), $this->aDataEntry[
'ResponsibleID']);
34 return $this->
_blockVideo ($this->_oDb->getMediaIds($this->aDataEntry[
'ID'],
'videos'), $this->aDataEntry[
'ResponsibleID']);
39 return $this->
_blockSound ($this->_oDb->getMediaIds($this->aDataEntry[
'ID'],
'sounds'), $this->aDataEntry[
'ResponsibleID']);
44 return $this->
_blockFiles ($this->_oDb->getMediaIds($this->aDataEntry[
'ID'],
'files'), $this->aDataEntry[
'ResponsibleID']);
51 if (!
$o->isEnabled())
return '';
52 return array(
$o->getBigVoting ($this->_oMain->isAllowedRate($this->aDataEntry)));
61 return $o->getCommentsFirst ();
68 if ($this->_oMain->_iProfileId || $this->_oMain->isAdmin()) {
72 $aSubscribeButton =
$oSubscription->getButton($this->_oMain->_iProfileId,
'ch_events',
'', (
int)$this->aDataEntry[
'ID']);
75 $isFan = $this->_oDb->isFan((
int)$this->aDataEntry[
'ID'], $this->_oMain->_iProfileId, 0) || $this->_oDb->isFan((
int)$this->aDataEntry[
'ID'], $this->_oMain->_iProfileId, 1);
77 $this->aInfo = array (
78 'BaseUri' => $this->_oMain->_oConfig->getBaseUri(),
79 'iViewer' => $this->_oMain->_iProfileId,
80 'ownerID' => (
int)$this->aDataEntry[
'ResponsibleID'],
81 'ID' => (
int)$this->aDataEntry[
'ID'],
82 'URI' => $this->aDataEntry[
'EntryUri'],
83 'ScriptSubscribe' => $aSubscribeButton[
'script'],
84 'TitleSubscribe' => $aSubscribeButton[
'title'],
85 'TitleEdit' => $this->_oMain->isAllowedEdit($this->aDataEntry) ?
_t(
'_ch_events_action_title_edit') :
'',
86 'TitleDelete' => $this->_oMain->isAllowedDelete($this->aDataEntry) ?
_t(
'_ch_events_action_title_delete') :
'',
87 'TitleJoin' => $this->_oMain->isAllowedJoin($this->aDataEntry) ? ($isFan ?
_t(
'_ch_events_action_title_leave') :
_t(
'_ch_events_action_title_join')) :
'',
88 'IconJoin' => $isFan ?
'sign-out' :
'sign-in',
89 'TitleInvite' => $this->_oMain->isAllowedSendInvitation($this->aDataEntry) ?
_t(
'_ch_events_action_title_invite') :
'',
90 'TitleShare' => $this->_oMain->isAllowedShare($this->aDataEntry) ?
_t(
'_ch_events_action_title_share') :
'',
91 'TitleBroadcast' => $this->_oMain->isAllowedBroadcast($this->aDataEntry) ?
_t(
'_ch_events_action_title_broadcast') :
'',
92 'AddToFeatured' => $this->_oMain->isAllowedMarkAsFeatured($this->aDataEntry) ? ($this->aDataEntry[
'Featured'] ?
_t(
'_ch_events_action_remove_from_featured') :
_t(
'_ch_events_action_add_to_featured')) :
'',
93 'TitleManageFans' => $this->_oMain->isAllowedManageFans($this->aDataEntry) ?
_t(
'_ch_events_action_manage_fans') :
'',
94 'TitleUploadPhotos' => $this->_oMain->isAllowedUploadPhotos($this->aDataEntry) ?
_t(
'_ch_events_action_upload_photos') :
'',
95 'TitleUploadVideos' => $this->_oMain->isAllowedUploadVideos($this->aDataEntry) ?
_t(
'_ch_events_action_upload_videos') :
'',
96 'TitleUploadSounds' => $this->_oMain->isAllowedUploadSounds($this->aDataEntry) ?
_t(
'_ch_events_action_upload_sounds') :
'',
97 'TitleUploadFiles' => $this->_oMain->isAllowedUploadFiles($this->aDataEntry) ?
_t(
'_ch_events_action_upload_files') :
'',
98 'TitleActivate' => method_exists($this->_oMain,
'isAllowedActivate') && $this->_oMain->isAllowedActivate($this->aDataEntry) ?
_t(
'_ch_events_admin_activate') :
'',
101 $this->aInfo[
'repostCpt'] = $this->aInfo[
'repostScript'] =
'';
105 $this->aInfo[
'repostCpt'] =
_t(
'_Repost');
106 $this->aInfo[
'repostScript'] =
ChWsbService::call(
'wall',
'get_repost_js_click', array($this->_oMain->_iProfileId,
'ch_events',
'add', (
int)$this->aDataEntry[
'ID']));
109 $sCodeActions =
$oFunctions->genObjectsActions($this->aInfo,
'ch_events');
110 if(
empty($sCodeActions))
113 return $sCode . $sCodeActions;
121 return parent::_blockFans ($this->_oDb->getParam(
'ch_events_perpage_participants'),
'isAllowedViewParticipants',
'getFans');
133 return parent::getCode();