BxMarketModule.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Market Market
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. define('BX_MARKET_LICENSE_TYPE_SINGLE', 'single'); //--- one-time payment license
  12. define('BX_MARKET_LICENSE_TYPE_RECURRING', 'recurring'); //--- recurring payment license
  13. define('BX_MARKET_FILE_TYPE_VERSION', 'version');
  14. define('BX_MARKET_FILE_TYPE_UPDATE', 'update');
  15. /**
  16. * Market module
  17. */
  18. class BxMarketModule extends BxBaseModTextModule
  19. {
  20. function __construct(&$aModule)
  21. {
  22. parent::__construct($aModule);
  23. $CNF = &$this->_oConfig->CNF;
  24. $this->_aSearchableNamesExcept = array_merge($this->_aSearchableNamesExcept, array(
  25. $CNF['FIELD_NAME'],
  26. $CNF['FIELD_PRICE_SINGLE'],
  27. $CNF['FIELD_PRICE_RECURRING'],
  28. $CNF['FIELD_DURATION_RECURRING'],
  29. $CNF['FIELD_TRIAL_RECURRING'],
  30. $CNF['FIELD_ALLOW_PURCHASE_TO'],
  31. $CNF['FIELD_ALLOW_COMMENT_TO'],
  32. $CNF['FIELD_ALLOW_VOTE_TO']
  33. ));
  34. }
  35. public function actionCheckName()
  36. {
  37. $CNF = &$this->_oConfig->CNF;
  38. $sTitle = strtolower(bx_process_input(bx_get('title')));
  39. if(empty($sTitle))
  40. return echoJson(array());
  41. echoJson(array(
  42. 'title' => $sTitle,
  43. 'name' => uriGenerate($sTitle, $CNF['TABLE_ENTRIES'], $CNF['FIELD_NAME'])
  44. ));
  45. }
  46. public function actionGetSubentries()
  47. {
  48. $CNF = &$this->_oConfig->CNF;
  49. $sTerm = bx_get('term');
  50. $iLimit = (int)bx_get('limit');
  51. if(empty($iLimit))
  52. $iLimit = 10;
  53. $aResult = array();
  54. $aEntries = $this->_oDb->searchByAuthorTerm($this->_iProfileId, $sTerm, $iLimit);
  55. foreach ($aEntries as $aEntry)
  56. $aResult[] = array('value' => $aEntry[$CNF['FIELD_ID']], 'label' => $aEntry[$CNF['FIELD_TITLE']]);
  57. // sort result
  58. usort($aResult, function($r1, $r2) {
  59. return strcmp($r1['label'], $r2['label']);
  60. });
  61. echoJson(array_slice($aResult, 0, $iLimit));
  62. }
  63. public function serviceGetSearchableFields ()
  64. {
  65. $CNF = &$this->_oConfig->CNF;
  66. $aResult = parent::serviceGetSearchableFields();
  67. unset($aResult[$CNF['FIELD_PRICE_SINGLE']]);
  68. return $aResult;
  69. }
  70. public function serviceEntityCreate ()
  71. {
  72. $oPayments = BxDolPayments::getInstance();
  73. if(!$oPayments->isActive())
  74. return MsgBox(_t('_bx_market_err_no_payments'));
  75. if(!$oPayments->isAcceptingPayments($this->_iProfileId))
  76. return MsgBox(_t('_bx_market_err_not_accept_payments', $oPayments->getDetailsUrl()));
  77. $this->_oTemplate->addJs(array('entry.js'));
  78. return $this->_oTemplate->getJsCode('entry') . parent::serviceEntityCreate();
  79. }
  80. public function serviceEntityDownload ($iContentId = 0)
  81. {
  82. $CNF = &$this->_oConfig->CNF;
  83. if(!$iContentId)
  84. $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
  85. if(!$iContentId)
  86. return false;
  87. $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
  88. if(empty($aContentInfo) || !is_array($aContentInfo))
  89. return MsgBox(_t('_sys_txt_error_occured'));
  90. if($this->checkAllowedDownload($aContentInfo) !== CHECK_ACTION_RESULT_ALLOWED)
  91. return MsgBox(_t('_bx_market_err_access_denied'));
  92. return $this->_oTemplate->entryAttachmentsByStorage($CNF['OBJECT_STORAGE_FILES'], $aContentInfo);
  93. }
  94. public function serviceEntityRating($iContentId = 0)
  95. {
  96. return $this->_serviceTemplateFunc ('entryRating', $iContentId);
  97. }
  98. public function serviceEntityAuthorEntities($iContentId = 0)
  99. {
  100. $CNF = &$this->_oConfig->CNF;
  101. $aContentInfo = $this->_getContentInfo($iContentId);
  102. if($aContentInfo === false)
  103. return false;
  104. $oProfile = BxDolProfile::getInstance($aContentInfo[$CNF['FIELD_AUTHOR']]);
  105. if (!$oProfile)
  106. $oProfile = BxDolProfileUndefined::getInstance();
  107. $aBlock = $this->_serviceBrowse ('author', array('author' => $aContentInfo[$CNF['FIELD_AUTHOR']], 'except' => array($iContentId), 'per_page' => 2), BX_DB_PADDING_DEF, true);
  108. $aBlock['title'] = _t('_bx_market_page_block_title_entry_author_entries', $oProfile->getDisplayName());
  109. return $aBlock;
  110. }
  111. /**
  112. * Licenses
  113. */
  114. public function serviceBlockLicenses()
  115. {
  116. $sGrid = $this->_oConfig->getGridObject('licenses');
  117. $oGrid = BxDolGrid::getObjectInstance($sGrid);
  118. if(!$oGrid)
  119. return '';
  120. $this->_oDb->updateLicense(array('new' => 0), array('profile_id' => bx_get_logged_profile_id(), 'new' => 1));
  121. $this->_oTemplate->addJs(array('licenses.js'));
  122. return array(
  123. 'content' => $this->_oTemplate->getJsCode('licenses', array('sObjNameGrid' => $sGrid)) . $oGrid->getCode(),
  124. );
  125. }
  126. public function serviceBlockLicensesNote()
  127. {
  128. return MsgBox(_t('_bx_market_page_block_content_licenses_note'));
  129. }
  130. /**
  131. * Get number of unused licenses for some profile. It can be used in menus with "alert" counters.
  132. *
  133. * @param $iProfileId - profile to get unused licenses for, if omitted then currently logged in profile is used
  134. * @return integer
  135. */
  136. public function serviceGetUnusedLicensesNum ($iProfileId = 0)
  137. {
  138. if(!$iProfileId)
  139. $iProfileId = bx_get_logged_profile_id();
  140. $aLicenses = $this->_oDb->getLicense(array('type' => 'new', 'profile_id' => (int)$iProfileId));
  141. return !empty($aLicenses) && is_array($aLicenses) ? count($aLicenses) : 0;
  142. }
  143. public function serviceHasLicense ($iProfileId, $iProductId, $sDomain = '')
  144. {
  145. return $this->_oDb->hasLicense($iProfileId, $iProductId, $sDomain);
  146. }
  147. public function serviceGetLicense ($aParams)
  148. {
  149. return $this->_oDb->getLicense($aParams);
  150. }
  151. public function serviceUpdateLicense ($aSet, $aWhere)
  152. {
  153. return $this->_oDb->updateLicense($aSet, $aWhere);
  154. }
  155. public function serviceGetEntryBy($sType, $mixedValue)
  156. {
  157. return $this->_oDb->getContentInfoBy(array('type' => $sType, 'value' => $mixedValue));
  158. }
  159. public function serviceGetEntriesBy($aParams)
  160. {
  161. return $this->_oDb->getContentInfoBy($aParams);
  162. }
  163. public function serviceGetThumbnail($iPhotoId)
  164. {
  165. $CNF = &$this->_oConfig->CNF;
  166. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
  167. $oImagesTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY']);
  168. return array(
  169. 'small' => $oImagesTranscoder ? $oImagesTranscoder->getFileUrl($iPhotoId) : '',
  170. 'big' => $oStorage ? $oStorage->getFileUrlById($iPhotoId) : ''
  171. );
  172. }
  173. public function serviceGetCover($iPhotoId)
  174. {
  175. $CNF = &$this->_oConfig->CNF;
  176. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
  177. $oImagesTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_COVER']);
  178. return array(
  179. 'small' => $oImagesTranscoder ? $oImagesTranscoder->getFileUrl($iPhotoId) : '',
  180. 'big' => $oStorage ? $oStorage->getFileUrlById($iPhotoId) : ''
  181. );
  182. }
  183. public function serviceGetFile($iFileId)
  184. {
  185. $CNF = &$this->_oConfig->CNF;
  186. $aFile = $this->_oDb->getFile(array(
  187. 'type' => 'file_id_ext',
  188. 'file_id' => $iFileId
  189. ));
  190. if(!empty($aFile) && is_array($aFile)) {
  191. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE_FILES']);
  192. $aFile['file_url'] = $oStorage ? $oStorage->getFileUrlById($iFileId) : '';
  193. }
  194. return $aFile;
  195. }
  196. public function serviceGetUpdates($iContentId, $sVersion = '')
  197. {
  198. $CNF = &$this->_oConfig->CNF;
  199. $aFile = $this->_oDb->getFile(array(
  200. 'type' => 'content_id_and_type',
  201. 'content_id' => $iContentId,
  202. 'file_type' => 'update',
  203. 'version' => $sVersion
  204. ));
  205. if(!empty($aFile) && is_array($aFile)) {
  206. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE_FILES']);
  207. $aFile['file_url'] = $oStorage ? $oStorage->getFileUrlById($aFile['file_id']) : '';
  208. }
  209. return $aFile;
  210. }
  211. public function serviceGetScreenshots($iItemId)
  212. {
  213. $CNF = &$this->_oConfig->CNF;
  214. if(!$iItemId)
  215. return array();
  216. $aData = $this->_oDb->getContentInfoById($iItemId);
  217. $aPhotos = $this->_oDb->getPhoto(array('type' => 'content_id', 'content_id' => $aData[$CNF['FIELD_ID']], 'except' => array($aData[$CNF['FIELD_THUMB']], $aData[$CNF['FIELD_COVER']])));
  218. if(empty($aPhotos) || !is_array($aPhotos))
  219. return array();
  220. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
  221. $oImagesTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_SCREENSHOT']);
  222. $aResult = array();
  223. foreach($aPhotos as $aPhoto)
  224. $aResult[] = array(
  225. 'id' => $aPhoto['file_id'],
  226. 'url_sm' => $oImagesTranscoder ? $oImagesTranscoder->getFileUrl($aPhoto['file_id']) : '',
  227. 'url_bg' => $oStorage ? $oStorage->getFileUrlById($aPhoto['file_id']) : ''
  228. );
  229. return $aResult;
  230. }
  231. /**
  232. * Integration with Payment based modules.
  233. */
  234. public function serviceGetPaymentData()
  235. {
  236. return $this->_aModule;
  237. }
  238. public function serviceGetCartItem($iItemId)
  239. {
  240. $CNF = &$this->_oConfig->CNF;
  241. if(!$iItemId)
  242. return array();
  243. $aItem = $this->_oDb->getContentInfoById($iItemId);
  244. if(empty($aItem) || !is_array($aItem))
  245. return array();
  246. return array (
  247. 'id' => $aItem[$CNF['FIELD_ID']],
  248. 'author_id' => $aItem[$CNF['FIELD_AUTHOR']],
  249. 'name' => $aItem[$CNF['FIELD_NAME']],
  250. 'title' => $aItem[$CNF['FIELD_TITLE']],
  251. 'description' => $aItem[$CNF['FIELD_TEXT']],
  252. 'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=view-product&id=' . $aItem[$CNF['FIELD_ID']]),
  253. 'price_single' => $aItem[$CNF['FIELD_PRICE_SINGLE']],
  254. 'price_recurring' => $aItem[$CNF['FIELD_PRICE_RECURRING']],
  255. 'trial_recurring' => $aItem[$CNF['FIELD_TRIAL_RECURRING']]
  256. );
  257. }
  258. public function serviceGetCartItems($iSellerId)
  259. {
  260. $CNF = &$this->_oConfig->CNF;
  261. $iSellerId = (int)$iSellerId;
  262. if(empty($iSellerId))
  263. return array();
  264. $aItems = $this->_oDb->getEntriesByAuthor($iSellerId);
  265. $aResult = array();
  266. foreach($aItems as $aItem)
  267. $aResult[] = array(
  268. 'id' => $aItem[$CNF['FIELD_ID']],
  269. 'author_id' => $aItem[$CNF['FIELD_AUTHOR']],
  270. 'name' => $aItem[$CNF['FIELD_NAME']],
  271. 'title' => $aItem[$CNF['FIELD_TITLE']],
  272. 'description' => $aItem[$CNF['FIELD_TEXT']],
  273. 'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=view-product&id=' . $aItem[$CNF['FIELD_ID']]),
  274. 'price_single' => $aItem[$CNF['FIELD_PRICE_SINGLE']],
  275. 'price_recurring' => $aItem[$CNF['FIELD_PRICE_RECURRING']],
  276. 'trial_recurring' => $aItem[$CNF['FIELD_TRIAL_RECURRING']]
  277. );
  278. return $aResult;
  279. }
  280. public function serviceRegisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  281. {
  282. return $this->_serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_MARKET_LICENSE_TYPE_SINGLE);
  283. }
  284. public function serviceRegisterSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  285. {
  286. return $this->_serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_MARKET_LICENSE_TYPE_RECURRING);
  287. }
  288. public function serviceUnregisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  289. {
  290. return $this->_serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_MARKET_LICENSE_TYPE_SINGLE);
  291. }
  292. public function serviceUnregisterSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  293. {
  294. return $this->_serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_MARKET_LICENSE_TYPE_RECURRING);
  295. }
  296. public function serviceCancelSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder)
  297. {
  298. //TODO: Do something if it's necessary.
  299. return true;
  300. }
  301. protected function _serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, $sType)
  302. {
  303. $aItem = $this->serviceGetCartItem($iItemId);
  304. if(empty($aItem) || !is_array($aItem))
  305. return array();
  306. $iTrial = 0;
  307. $sDuration = '';
  308. if($sType == BX_MARKET_LICENSE_TYPE_RECURRING) {
  309. $aProduct = $this->_oDb->getContentInfoById($iItemId);
  310. $iTrial = $aProduct[$this->_oConfig->CNF['FIELD_TRIAL_RECURRING']];
  311. $sDuration = $aProduct[$this->_oConfig->CNF['FIELD_DURATION_RECURRING']];
  312. }
  313. $sAction = $this->_oDb->hasLicenseByOrder($iClientId, $iItemId, $sOrder) ? 'prolong' : 'register';
  314. if(!$this->_oDb->{$sAction . 'License'}($iClientId, $iItemId, $iItemCount, $sOrder, $sLicense, $sType, $sDuration, $iTrial))
  315. return array();
  316. bx_alert($this->getName(), 'license_' . $sAction, 0, false, array(
  317. 'product_id' => $iItemId,
  318. 'profile_id' => $iClientId,
  319. 'order' => $sOrder,
  320. 'license' => $sLicense,
  321. 'type' => $sType,
  322. 'count' => $iItemCount,
  323. 'duration' => $sDuration,
  324. 'trial' => $iTrial
  325. ));
  326. return $aItem;
  327. }
  328. protected function _serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, $sType)
  329. {
  330. if(!$this->_oDb->unregisterLicense($iClientId, $iItemId, $sOrder, $sLicense, $sType))
  331. return false;
  332. bx_alert($this->getName(), 'license_unregister', 0, false, array(
  333. 'product_id' => $iItemId,
  334. 'profile_id' => $iClientId,
  335. 'order' => $sOrder,
  336. 'license' => $sLicense,
  337. 'type' => $sType,
  338. 'count' => $iItemCount
  339. ));
  340. return true;
  341. }
  342. public function getGhostTemplateVars($aFile, $iProfileId, $iContentId, $oStorage, $oImagesTranscoder)
  343. {
  344. $CNF = &$this->_oConfig->CNF;
  345. $sMethod = '';
  346. $sStorage = $oStorage->getObject();
  347. switch($sStorage) {
  348. case $CNF['OBJECT_STORAGE']:
  349. $sMethod = 'getPhoto';
  350. break;
  351. case $CNF['OBJECT_STORAGE_FILES']:
  352. $sMethod = 'getFile';
  353. break;
  354. }
  355. $aFileInfo = $this->_oDb->$sMethod(array('type' => 'file_id', 'file_id' => $aFile['id']));
  356. $bFileInfo = !empty($aFileInfo) && is_array($aFileInfo);
  357. $bFileInfoTitle = $bFileInfo && isset($aFileInfo['title']);
  358. $aTmplVars = array(
  359. 'file_title' => $bFileInfoTitle ? $aFileInfo['title'] : '',
  360. 'file_title_attr' => $bFileInfoTitle ? bx_html_attribute($aFileInfo['title']) : '',
  361. );
  362. if($sStorage == $CNF['OBJECT_STORAGE'])
  363. return $aTmplVars;
  364. $bFileInfoVersion = $bFileInfo && isset($aFileInfo['version']);
  365. $bFileInfoTypeVersion = !$bFileInfo || ($bFileInfo && isset($aFileInfo['type']) && $aFileInfo['type'] == BX_MARKET_FILE_TYPE_VERSION);
  366. $bFileInfoTypeUpdate = $bFileInfo && isset($aFileInfo['type']) && $aFileInfo['type'] == BX_MARKET_FILE_TYPE_UPDATE;
  367. $aVersions = $this->_oDb->$sMethod(array('type' => 'content_id', 'content_id' => $iContentId));
  368. $aTmplVars = array_merge($aTmplVars, array(
  369. 'file_version' => $bFileInfoVersion ? $aFileInfo['version'] : '',
  370. 'file_version_attr' => $bFileInfoVersion ? bx_html_attribute($aFileInfo['version']) : '',
  371. 'file_type_version_selected' => $bFileInfoTypeVersion ? ' selected="selected"' : '',
  372. 'file_type_update_selected' => $bFileInfoTypeUpdate ? ' selected="selected"' : '',
  373. 'file_type_version_elements' => !$bFileInfoTypeVersion ? ' style="display:none;"' : '',
  374. 'file_type_update_elements' => !$bFileInfoTypeUpdate ? ' style="display:none;"' : '',
  375. 'file_version_from_options' => $this->_oTemplate->getGhostTemplateFileOptions('version', $aFileInfo, $aVersions),
  376. 'file_version_to_options' => $this->_oTemplate->getGhostTemplateFileOptions('version_to', $aFileInfo, $aVersions)
  377. ));
  378. return $aTmplVars;
  379. }
  380. public function checkAllowedSetCover ()
  381. {
  382. $aCheck = checkActionModule($this->_iProfileId, 'set cover', $this->getName(), false);
  383. if($aCheck[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED)
  384. return $aCheck[CHECK_ACTION_MESSAGE];
  385. return CHECK_ACTION_RESULT_ALLOWED;
  386. }
  387. public function checkAllowedSetSubentries ()
  388. {
  389. $aCheck = checkActionModule($this->_iProfileId, 'set subentries', $this->getName(), false);
  390. if($aCheck[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED)
  391. return $aCheck[CHECK_ACTION_MESSAGE];
  392. return CHECK_ACTION_RESULT_ALLOWED;
  393. }
  394. public function checkAllowedDownload($aDataEntry, $isPerformAction = false)
  395. {
  396. $CNF = &$this->_oConfig->CNF;
  397. // moderator and owner always have access
  398. if ($aDataEntry[$CNF['FIELD_AUTHOR']] == $this->_iProfileId || $this->_isModerator($isPerformAction))
  399. return CHECK_ACTION_RESULT_ALLOWED;
  400. // check ACL
  401. $aCheck = checkActionModule($this->_iProfileId, 'download entry', $this->getName(), $isPerformAction);
  402. if($aCheck[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED)
  403. return $aCheck[CHECK_ACTION_MESSAGE];
  404. if((float)$aDataEntry[$CNF['FIELD_PRICE_SINGLE']] == 0 && (float)$aDataEntry[$CNF['FIELD_PRICE_RECURRING']] == 0)
  405. return CHECK_ACTION_RESULT_ALLOWED;
  406. if(!$this->_oDb->hasLicense($this->_iProfileId, $aDataEntry[$CNF['FIELD_ID']]))
  407. return CHECK_ACTION_RESULT_NOT_ALLOWED;
  408. return CHECK_ACTION_RESULT_ALLOWED;
  409. }
  410. protected function _getContentInfo($iContentId = 0)
  411. {
  412. if(!$iContentId)
  413. $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
  414. if(!$iContentId)
  415. return false;
  416. $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
  417. if(!$aContentInfo)
  418. return false;
  419. return $aContentInfo;
  420. }
  421. protected function _entitySocialSharing ($iId, $aParams = array())
  422. {
  423. $CNF = &$this->_oConfig->CNF;
  424. return parent::_entitySocialSharing($iId, array_merge($aParams, array(
  425. 'object_vote' => ''
  426. )));
  427. }
  428. }
  429. /** @} */