Cheetah
ChEventsPageView.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbTwigPageView');
9 
11 {
12  function __construct(&$oEventsMain, &$aEvent)
13  {
14  parent::__construct('ch_events_view', $oEventsMain, $aEvent);
15  }
16 
17  function getBlockCode_Info()
18  {
19  return array($this->_oTemplate->blockInfo ($this->aDataEntry));
20  }
21 
22  function getBlockCode_Desc()
23  {
24  return array($this->_oTemplate->blockDesc ($this->aDataEntry));
25  }
26 
28  {
29  return $this->_blockPhoto ($this->_oDb->getMediaIds($this->aDataEntry['ID'], 'images'), $this->aDataEntry['ResponsibleID']);
30  }
31 
33  {
34  return $this->_blockVideo ($this->_oDb->getMediaIds($this->aDataEntry['ID'], 'videos'), $this->aDataEntry['ResponsibleID']);
35  }
36 
38  {
39  return $this->_blockSound ($this->_oDb->getMediaIds($this->aDataEntry['ID'], 'sounds'), $this->aDataEntry['ResponsibleID']);
40  }
41 
42  function getBlockCode_Files()
43  {
44  return $this->_blockFiles ($this->_oDb->getMediaIds($this->aDataEntry['ID'], 'files'), $this->aDataEntry['ResponsibleID']);
45  }
46 
47  function getBlockCode_Rate()
48  {
49  ch_events_import('Voting');
50  $o = new ChEventsVoting ('ch_events', (int)$this->aDataEntry['ID']);
51  if (!$o->isEnabled()) return '';
52  return array($o->getBigVoting ($this->_oMain->isAllowedRate($this->aDataEntry)));
53  }
54 
56  {
57  ch_events_import('Cmts');
58  $o = new ChEventsCmts ('ch_events', (int)$this->aDataEntry['ID']);
59  if (!$o->isEnabled())
60  return '';
61  return $o->getCommentsFirst ();
62  }
63 
65  {
67 
68  if ($this->_oMain->_iProfileId || $this->_oMain->isAdmin()) {
69  $sCode = '';
70 
72  $aSubscribeButton = $oSubscription->getButton($this->_oMain->_iProfileId, 'ch_events', '', (int)$this->aDataEntry['ID']);
73  $sCode .= $oSubscription->getData();
74 
75  $isFan = $this->_oDb->isFan((int)$this->aDataEntry['ID'], $this->_oMain->_iProfileId, 0) || $this->_oDb->isFan((int)$this->aDataEntry['ID'], $this->_oMain->_iProfileId, 1);
76 
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') : '',
99  );
100 
101  $this->aInfo['repostCpt'] = $this->aInfo['repostScript'] = '';
102  if(ChWsbRequest::serviceExists('wall', 'get_repost_js_click')) {
103  $sCode .= ChWsbService::call('wall', 'get_repost_js_script');
104 
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']));
107  }
108 
109  $sCodeActions = $oFunctions->genObjectsActions($this->aInfo, 'ch_events');
110  if(empty($sCodeActions))
111  return '';
112 
113  return $sCode . $sCodeActions;
114  }
115 
116  return '';
117  }
118 
120  {
121  return parent::_blockFans ($this->_oDb->getParam('ch_events_perpage_participants'), 'isAllowedViewParticipants', 'getFans');
122  }
123 
125  {
126  return parent::_blockFansUnconfirmed (CH_EVENTS_MAX_FANS);
127  }
128 
129  function getCode()
130  {
131  $this->_oMain->_processFansActions ($this->aDataEntry, CH_EVENTS_MAX_FANS);
132 
133  return parent::getCode();
134  }
135 }
ChEventsVoting
Definition: ChEventsVoting.php:11
ChWsbRequest\serviceExists
static serviceExists($mixedModule, $sMethod, $sClass="Module")
Definition: ChWsbRequest.php:70
ChEventsPageView\getBlockCode_Videos
getBlockCode_Videos()
Definition: ChEventsPageView.php:32
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChEventsPageView\getBlockCode_Files
getBlockCode_Files()
Definition: ChEventsPageView.php:42
ChWsbTwigPageView
Definition: ChWsbTwigPageView.php:14
php
ChEventsCmts
Definition: ChEventsCmts.php:11
ChWsbSubscription\getInstance
static getInstance()
Definition: ChWsbSubscription.php:67
ChEventsPageView\getBlockCode_Desc
getBlockCode_Desc()
Definition: ChEventsPageView.php:22
$oFunctions
$oFunctions
Definition: ChTemplFunctions.php:20
ChWsbTwigPageView\_blockSound
_blockSound($aReadyMedia, $iAuthorId, $sPrefix=false)
Definition: ChWsbTwigPageView.php:199
ChEventsPageView\__construct
__construct(&$oEventsMain, &$aEvent)
Definition: ChEventsPageView.php:12
ChWsbTwigPageView\_blockPhoto
_blockPhoto(&$aReadyMedia, $iAuthorId, $sPrefix=false)
Definition: ChWsbTwigPageView.php:86
ChEventsPageView\getBlockCode_Photos
getBlockCode_Photos()
Definition: ChEventsPageView.php:27
ChEventsPageView
Definition: ChEventsPageView.php:11
ChWsbTwigPageView\_blockVideo
_blockVideo($aReadyMedia, $iAuthorId, $sPrefix=false)
Definition: ChWsbTwigPageView.php:118
ChEventsPageView\getBlockCode_Info
getBlockCode_Info()
Definition: ChEventsPageView.php:17
ch_events_import
ch_events_import($sClassPostfix, $aModuleOverwright=array())
Definition: ChEventsModule.php:8
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
CH_EVENTS_MAX_FANS
const CH_EVENTS_MAX_FANS
Definition: ChEventsModule.php:35
ChEventsPageView\getBlockCode_Actions
getBlockCode_Actions()
Definition: ChEventsPageView.php:64
ChWsbTwigPageView\_blockFiles
_blockFiles($aReadyMedia, $iAuthorId=0)
Definition: ChWsbTwigPageView.php:156
ChEventsPageView\getBlockCode_Rate
getBlockCode_Rate()
Definition: ChEventsPageView.php:47
ChEventsPageView\getBlockCode_ParticipantsUnconfirmed
getBlockCode_ParticipantsUnconfirmed()
Definition: ChEventsPageView.php:124
ChEventsPageView\getBlockCode_Sounds
getBlockCode_Sounds()
Definition: ChEventsPageView.php:37
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
$o
$o
Definition: cmd.php:193
ChWsbService\call
static call($mixed, $sMethod, $aParams=array(), $sClass='Module')
Definition: ChWsbService.php:32
ChEventsPageView\getBlockCode_Comments
getBlockCode_Comments()
Definition: ChEventsPageView.php:55
ChEventsPageView\getCode
getCode()
Definition: ChEventsPageView.php:129
ChWsbPageView\$sCode
$sCode
Definition: ChWsbPageView.php:102
ChEventsPageView\getBlockCode_Participants
getBlockCode_Participants()
Definition: ChEventsPageView.php:119
$oSubscription
$oSubscription
Definition: notifies.php:28