Cheetah
ChStorePageView.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbTwigPageView');
9 
11 {
12  function __construct(&$oMain, &$aDataEntry)
13  {
14  parent::__construct('ch_store_view', $oMain, $aDataEntry);
15  }
16 
17  function getBlockCode_Info()
18  {
19  $sContent = $this->_blockInfo ($this->aDataEntry, $this->_oTemplate->blockFields($this->aDataEntry));
20  return array($sContent, array(), array(), false);
21  }
22 
23  function getBlockCode_Desc()
24  {
25  $sContent = $this->_oTemplate->blockDesc ($this->aDataEntry);
26  return array($sContent, array(), array(), false);
27  }
28 
29  function getBlockCode_Photo()
30  {
31  return $this->_blockPhoto ($this->_oDb->getMediaIds($this->aDataEntry['id'], 'images'), $this->aDataEntry['author_id']);
32  }
33 
34  function getBlockCode_Video()
35  {
36  return $this->_blockVideo ($this->_oDb->getMediaIds($this->aDataEntry['id'], 'videos'), $this->aDataEntry['author_id']);
37  }
38 
39  function getBlockCode_Files()
40  {
41  return $this->_oTemplate->blockFiles ($this->aDataEntry);
42  }
43 
44  function getBlockCode_Rate()
45  {
46  ch_store_import('Voting');
47  $o = new ChStoreVoting ('ch_store', (int)$this->aDataEntry['id']);
48  if (!$o->isEnabled())
49  return '';
50 
51  $sContent = $o->getBigVoting ($this->_oMain->isAllowedRate($this->aDataEntry));
52  return array($sContent, array(), array(), false);
53  }
54 
56  {
57  ch_store_import('Cmts');
58  $o = new ChStoreCmts ('ch_store', (int)$this->aDataEntry['id']);
59  if (!$o->isEnabled()) return '';
60  return $o->getCommentsFirst ();
61  }
62 
64  {
66 
67  if ($this->_oMain->_iProfileId || $this->_oMain->isAdmin()) {
68  $sCode = '';
69 
71  $aSubscribeButton = $oSubscription->getButton($this->_oMain->_iProfileId, 'ch_store', '', (int)$this->aDataEntry['id']);
72  $sCode .= $oSubscription->getData();
73 
74  $aInfo = array (
75  'BaseUri' => $this->_oMain->_oConfig->getBaseUri(),
76  'iViewer' => $this->_oMain->_iProfileId,
77  'ownerID' => (int)$this->aDataEntry['author_id'],
78  'ID' => (int)$this->aDataEntry['id'],
79  'URI' => (int)$this->aDataEntry['uri'],
80  'ScriptSubscribe' => $aSubscribeButton['script'],
81  'TitleSubscribe' => $aSubscribeButton['title'],
82  'TitleEdit' => $this->_oMain->isAllowedEdit($this->aDataEntry) ? _t('_ch_store_action_title_edit') : '',
83  'TitleDelete' => $this->_oMain->isAllowedDelete($this->aDataEntry) ? _t('_ch_store_action_title_delete') : '',
84  'TitleShare' => $this->_oMain->isAllowedShare($this->aDataEntry) ? _t('_ch_store_action_title_share') : '',
85  'TitleBroadcast' => $this->_oMain->isAllowedBroadcast($this->aDataEntry) ? _t('_ch_store_action_title_broadcast') : '',
86  'AddToFeatured' => $this->_oMain->isAllowedMarkAsFeatured($this->aDataEntry) ? ($this->aDataEntry['featured'] ? _t('_ch_store_action_remove_from_featured') : _t('_ch_store_action_add_to_featured')) : '',
87  'TitleActivate' => method_exists($this->_oMain, 'isAllowedActivate') && $this->_oMain->isAllowedActivate($this->aDataEntry) ? _t('_ch_store_admin_activate') : '',
88  );
89 
90  $aInfo['repostCpt'] = $aInfo['repostScript'] = '';
91  if(ChWsbRequest::serviceExists('wall', 'get_repost_js_click')) {
92  $sCode .= ChWsbService::call('wall', 'get_repost_js_script');
93 
94  $aInfo['repostCpt'] = _t('_Repost');
95  $aInfo['repostScript'] = ChWsbService::call('wall', 'get_repost_js_click', array($this->_oMain->_iProfileId, 'ch_store', 'add', (int)$this->aDataEntry['id']));
96  }
97 
98  $sCodeActions = $oFunctions->genObjectsActions($aInfo, 'ch_store');
99  if(empty($sCodeActions))
100  return '';
101 
102  return $sCode . $sCodeActions;
103  }
104 
105  return '';
106  }
107 
108 }
ChStorePageView\getBlockCode_Video
getBlockCode_Video()
Definition: ChStorePageView.php:34
ChStorePageView\getBlockCode_Desc
getBlockCode_Desc()
Definition: ChStorePageView.php:23
ChWsbTwigPageView\_blockInfo
_blockInfo($aData, $sFields='', $sLocation='')
Definition: ChWsbTwigPageView.php:70
ChWsbRequest\serviceExists
static serviceExists($mixedModule, $sMethod, $sClass="Module")
Definition: ChWsbRequest.php:70
ChStorePageView\getBlockCode_Files
getBlockCode_Files()
Definition: ChStorePageView.php:39
ChStorePageView
Definition: ChStorePageView.php:11
ChStorePageView\getBlockCode_Actions
getBlockCode_Actions()
Definition: ChStorePageView.php:63
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChWsbTwigPageView
Definition: ChWsbTwigPageView.php:14
php
ChStorePageView\getBlockCode_Photo
getBlockCode_Photo()
Definition: ChStorePageView.php:29
ChStorePageView\__construct
__construct(&$oMain, &$aDataEntry)
Definition: ChStorePageView.php:12
ChStorePageView\getBlockCode_Rate
getBlockCode_Rate()
Definition: ChStorePageView.php:44
ChWsbSubscription\getInstance
static getInstance()
Definition: ChWsbSubscription.php:67
ch_store_import
ch_store_import($sClassPostfix, $aModuleOverwright=array())
Definition: ChStoreModule.php:8
ChStorePageView\getBlockCode_Info
getBlockCode_Info()
Definition: ChStorePageView.php:17
$oFunctions
$oFunctions
Definition: ChTemplFunctions.php:20
$aInfo
$aInfo
Definition: constants.inc.php:21
ChWsbTwigPageView\_blockPhoto
_blockPhoto(&$aReadyMedia, $iAuthorId, $sPrefix=false)
Definition: ChWsbTwigPageView.php:86
ChStoreCmts
Definition: ChStoreCmts.php:11
ChStorePageView\getBlockCode_Comments
getBlockCode_Comments()
Definition: ChStorePageView.php:55
ChWsbTwigPageView\_blockVideo
_blockVideo($aReadyMedia, $iAuthorId, $sPrefix=false)
Definition: ChWsbTwigPageView.php:118
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
$sContent
$sContent
Definition: bottom_menu_compose.php:169
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
ChWsbTwigPageView\$aDataEntry
$aDataEntry
Definition: ChWsbTwigPageView.php:19
ChStoreVoting
Definition: ChStoreVoting.php:11
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
ChWsbPageView\$sCode
$sCode
Definition: ChWsbPageView.php:102
$oSubscription
$oSubscription
Definition: notifies.php:28