14 parent::__construct(
'ch_groups_view', $oMain,
$aDataEntry);
19 return array($this->
_blockInfo ($this->aDataEntry, $this->_oTemplate->blockFields($this->aDataEntry), $this->_oMain->_formatLocation($this->aDataEntry,
false,
true)));
24 return array($this->_oTemplate->blockDesc ($this->aDataEntry));
29 return $this->
_blockPhoto ($this->_oDb->getMediaIds($this->aDataEntry[
'id'],
'images'), $this->aDataEntry[
'author_id']);
34 return $this->
_blockVideo ($this->_oDb->getMediaIds($this->aDataEntry[
'id'],
'videos'), $this->aDataEntry[
'author_id']);
39 return $this->
_blockSound ($this->_oDb->getMediaIds($this->aDataEntry[
'id'],
'sounds'), $this->aDataEntry[
'author_id']);
44 return $this->
_blockFiles ($this->_oDb->getMediaIds($this->aDataEntry[
'id'],
'files'), $this->aDataEntry[
'author_id']);
51 if (!
$o->isEnabled())
return '';
52 return array(
$o->getBigVoting ($this->_oMain->isAllowedRate($this->aDataEntry)));
59 if (!
$o->isEnabled())
return '';
60 return $o->getCommentsFirst ();
67 if ($this->_oMain->_iProfileId || $this->_oMain->isAdmin()) {
71 $aSubscribeButton =
$oSubscription->getButton($this->_oMain->_iProfileId,
'ch_groups',
'', (
int)$this->aDataEntry[
'id']);
74 $isFan = $this->_oDb->isFan((
int)$this->aDataEntry[
'id'], $this->_oMain->_iProfileId, 0) || $this->_oDb->isFan((
int)$this->aDataEntry[
'id'], $this->_oMain->_iProfileId, 1);
77 'BaseUri' => $this->_oMain->_oConfig->getBaseUri(),
78 'iViewer' => $this->_oMain->_iProfileId,
79 'ownerID' => (
int)$this->aDataEntry[
'author_id'],
80 'ID' => (
int)$this->aDataEntry[
'id'],
81 'URI' => $this->aDataEntry[
'uri'],
82 'ScriptSubscribe' => $aSubscribeButton[
'script'],
83 'TitleSubscribe' => $aSubscribeButton[
'title'],
84 'TitleEdit' => $this->_oMain->isAllowedEdit($this->aDataEntry) ?
_t(
'_ch_groups_action_title_edit') :
'',
85 'TitleDelete' => $this->_oMain->isAllowedDelete($this->aDataEntry) ?
_t(
'_ch_groups_action_title_delete') :
'',
86 'TitleJoin' => $this->_oMain->isAllowedJoin($this->aDataEntry) ? ($isFan ?
_t(
'_ch_groups_action_title_leave') :
_t(
'_ch_groups_action_title_join')) :
'',
87 'IconJoin' => $isFan ?
'sign-out' :
'sign-in',
88 'TitleInvite' => $this->_oMain->isAllowedSendInvitation($this->aDataEntry) ?
_t(
'_ch_groups_action_title_invite') :
'',
89 'TitleShare' => $this->_oMain->isAllowedShare($this->aDataEntry) ?
_t(
'_ch_groups_action_title_share') :
'',
90 'TitleBroadcast' => $this->_oMain->isAllowedBroadcast($this->aDataEntry) ?
_t(
'_ch_groups_action_title_broadcast') :
'',
91 'AddToFeatured' => $this->_oMain->isAllowedMarkAsFeatured($this->aDataEntry) ? ($this->aDataEntry[
'featured'] ?
_t(
'_ch_groups_action_remove_from_featured') :
_t(
'_ch_groups_action_add_to_featured')) :
'',
92 'TitleManageFans' => $this->_oMain->isAllowedManageFans($this->aDataEntry) ?
_t(
'_ch_groups_action_manage_fans') :
'',
93 'TitleUploadPhotos' => $this->_oMain->isAllowedUploadPhotos($this->aDataEntry) ?
_t(
'_ch_groups_action_upload_photos') :
'',
94 'TitleUploadVideos' => $this->_oMain->isAllowedUploadVideos($this->aDataEntry) ?
_t(
'_ch_groups_action_upload_videos') :
'',
95 'TitleUploadSounds' => $this->_oMain->isAllowedUploadSounds($this->aDataEntry) ?
_t(
'_ch_groups_action_upload_sounds') :
'',
96 'TitleUploadFiles' => $this->_oMain->isAllowedUploadFiles($this->aDataEntry) ?
_t(
'_ch_groups_action_upload_files') :
'',
97 'TitleActivate' => method_exists($this->_oMain,
'isAllowedActivate') && $this->_oMain->isAllowedActivate($this->aDataEntry) ?
_t(
'_ch_groups_admin_activate') :
'',
104 $aInfo[
'repostCpt'] =
_t(
'_Repost');
105 $aInfo[
'repostScript'] =
ChWsbService::call(
'wall',
'get_repost_js_click', array($this->_oMain->_iProfileId,
'ch_groups',
'add', (
int)$this->aDataEntry[
'id']));
109 if(
empty($sCodeActions))
112 return $sCode . $sCodeActions;
120 return parent::_blockFans ($this->_oDb->getParam(
'ch_groups_perpage_view_fans'),
'isAllowedViewFans',
'getFans');
132 return parent::getCode();