BxBaseModTextModule.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  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 BaseText Base classes for text modules
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Base module class for text based modules
  13. */
  14. class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolContentInfoService
  15. {
  16. function __construct(&$aModule)
  17. {
  18. parent::__construct($aModule);
  19. }
  20. // ====== ACTIONS METHODS
  21. public function actionEmbedPoll($iPollId = 0)
  22. {
  23. if(empty($iPollId) && bx_get('poll_id') !== false)
  24. $iPollId = (int)bx_get('poll_id');
  25. $aParams = bx_get_with_prefix('param');
  26. array_walk($aParams, function(&$sValue) {
  27. $sValue = bx_process_input($sValue);
  28. });
  29. $this->_oTemplate->embedPollItem($iPollId, $aParams);
  30. }
  31. public function actionEmbedPolls($iId = 0)
  32. {
  33. list($iContentId, $aContentInfo) = $this->_getContent($iId);
  34. if($iContentId === false)
  35. return;
  36. $aParams = bx_get_with_prefix('param');
  37. array_walk($aParams, function(&$sValue) {
  38. $sValue = bx_process_input($sValue);
  39. });
  40. $this->_oTemplate->embedPollItems($aContentInfo, $aParams);
  41. }
  42. public function actionGetPoll()
  43. {
  44. $iPollId = (int)bx_get('poll_id');
  45. $sView = bx_process_input(bx_get('view'));
  46. $sMethod = 'serviceGetBlockPoll' . bx_gen_method_name($sView);
  47. if(!method_exists($this, $sMethod))
  48. return echoJson(array());
  49. $aBlock = $this->$sMethod($iPollId, true);
  50. if(empty($aBlock) || !is_array($aBlock))
  51. return echoJson(array());
  52. return echoJson(array(
  53. 'content' => $aBlock['content']
  54. ));
  55. }
  56. public function actionDeletePoll()
  57. {
  58. $CNF = &$this->_oConfig->CNF;
  59. $iId = bx_process_input(bx_get('id'), BX_DATA_INT);
  60. if(empty($iId))
  61. return echoJson(array());
  62. $aResult = array();
  63. if($this->_oDb->deletePolls(array($CNF['FIELD_POLL_ID'] => $iId)))
  64. $aResult = array('code' => 0);
  65. else
  66. $aResult = array('code' => 1, 'message' => _t($CNF['txt_err_cannot_perform_action']));
  67. echoJson($aResult);
  68. }
  69. public function actionGetPollForm()
  70. {
  71. echo $this->_oTemplate->getPollForm();
  72. }
  73. public function actionSubmitPollForm()
  74. {
  75. echoJson($this->getPollForm());
  76. }
  77. public function actionFileEmbedVideo($iFileId)
  78. {
  79. $this->_oTemplate->embedVideo($iFileId);
  80. }
  81. // ====== SERVICE METHODS
  82. public function serviceGetBlockPollAnswers($iPollId, $bForceDisplay = false)
  83. {
  84. if(!$iPollId)
  85. return false;
  86. if(!$bForceDisplay && $this->isPollPerformed($iPollId))
  87. return $this->serviceGetBlockPollResults($iPollId);
  88. return $this->_serviceTemplateFunc('entryPollAnswers', $iPollId, 'getPollInfoById');
  89. }
  90. public function serviceGetBlockPollResults($iPollId)
  91. {
  92. return $this->_serviceTemplateFunc('entryPollResults', $iPollId, 'getPollInfoById');
  93. }
  94. public function serviceGetThumb ($iContentId, $sTranscoder = '')
  95. {
  96. $CNF = &$this->_oConfig->CNF;
  97. if(empty($sTranscoder) && !empty($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY']))
  98. $sTranscoder = $CNF['OBJECT_IMAGES_TRANSCODER_GALLERY'];
  99. $mixedResult = $this->_getFieldValueThumb('FIELD_THUMB', $iContentId, $sTranscoder);
  100. return $mixedResult !== false ? $mixedResult : '';
  101. }
  102. public function serviceGetMenuAddonManageTools()
  103. {
  104. bx_import('SearchResult', $this->_aModule);
  105. $sClass = $this->_aModule['class_prefix'] . 'SearchResult';
  106. $o = new $sClass();
  107. $o->unsetPaginate();
  108. $iNumTotal = $o->getNum();
  109. $o->fillFilters(array(
  110. 'status' => 'hidden'
  111. ));
  112. $iNum1 = $o->getNum();
  113. $iNum2 = 0;
  114. $CNF = &$this->_oConfig->CNF;
  115. if (isset($CNF['OBJECT_REPORTS'])){
  116. $o->fillFilters(array('status' => ''));
  117. $o->fillFiltersByObjects(array('reported' => array('value' => '0', 'field' => 'reports', 'operator' => '>')));
  118. $iNum2 = $o->getNum();
  119. }
  120. return array('counter1_value' => $iNum1, 'counter2_value' => $iNum2, 'counter3_value' => $iNumTotal );
  121. }
  122. public function serviceGetMenuAddonManageToolsProfileStats()
  123. {
  124. bx_import('SearchResult', $this->_aModule);
  125. $sClass = $this->_aModule['class_prefix'] . 'SearchResult';
  126. $o = new $sClass();
  127. $o->fillFilters(array(
  128. 'author' => bx_get_logged_profile_id()
  129. ));
  130. $o->unsetPaginate();
  131. return $o->getNum();
  132. }
  133. /**
  134. * Display public entries
  135. * @return HTML string
  136. */
  137. public function serviceBrowsePublic ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
  138. {
  139. return $this->_serviceBrowse ('public', $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
  140. }
  141. /**
  142. * Display popular entries
  143. * @return HTML string
  144. */
  145. public function serviceBrowsePopular ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
  146. {
  147. return $this->_serviceBrowse ('popular', $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
  148. }
  149. /**
  150. * Display popular entries
  151. * @return HTML string
  152. */
  153. public function serviceBrowseTop ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
  154. {
  155. return $this->_serviceBrowse ('top', $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
  156. }
  157. /**
  158. * Display recently updated entries
  159. * @return HTML string
  160. */
  161. public function serviceBrowseUpdated ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
  162. {
  163. return $this->_serviceBrowse ('updated', $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
  164. }
  165. /**
  166. * Display entries of the author
  167. * @return HTML string
  168. */
  169. public function serviceBrowseAuthor ($iProfileId = 0, $aParams = array())
  170. {
  171. return $this->_serviceBrowseWithParam ('author', 'profile_id', $iProfileId, $aParams);
  172. }
  173. /**
  174. * Entry author block
  175. */
  176. public function serviceEntityAuthor ($iContentId = 0)
  177. {
  178. return $this->_serviceTemplateFunc ('entryAuthor', $iContentId);
  179. }
  180. /**
  181. * Entry polls block
  182. */
  183. public function serviceEntityPolls ($iContentId = 0)
  184. {
  185. return $this->_serviceTemplateFunc ('entryPolls', $iContentId);
  186. }
  187. public function serviceEntityBreadcrumb ($iContentId = 0)
  188. {
  189. return $this->_serviceTemplateFunc ('entryBreadcrumb', $iContentId);
  190. }
  191. /**
  192. * Delete all content by profile
  193. * @param $iProfileId profile id
  194. * @return number of deleted items
  195. */
  196. public function serviceDeleteEntitiesByAuthor ($iProfileId)
  197. {
  198. $a = $this->_oDb->getEntriesByAuthor((int)$iProfileId);
  199. if (!$a)
  200. return 0;
  201. $iCount = 0;
  202. foreach ($a as $aContentInfo)
  203. $iCount += ('' == $this->serviceDeleteEntity($aContentInfo[$this->_oConfig->CNF['FIELD_ID']]) ? 1 : 0);
  204. return $iCount;
  205. }
  206. /**
  207. * Entry multicategiries block
  208. */
  209. public function serviceCategoriesMultiList($bDisplayEmptyCats = true)
  210. {
  211. $oCategories = BxDolCategories::getInstance();
  212. $aCats = $oCategories->getData(array('type' => 'by_module_with_num', 'module' => $this->getName()));
  213. $aVars = array('bx_repeat:cats' => array());
  214. foreach ($aCats as $oCat) {
  215. $sValue = $oCat['value'];
  216. $iNum = $oCat['num'];
  217. $aVars['bx_repeat:cats'][] = array(
  218. 'url' => $oCategories->getUrl($this->getName(), $sValue),
  219. 'name' => _t($sValue),
  220. 'value' => $sValue,
  221. 'num' => $iNum,
  222. );
  223. }
  224. if (!$aVars['bx_repeat:cats'])
  225. return '';
  226. return $this->_oTemplate->parseHtmlByName('category_list.html', $aVars);
  227. }
  228. // ====== PERMISSION METHODS
  229. /**
  230. * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden. So make sure to make strict(===) checking.
  231. */
  232. public function checkAllowedSetThumb ($iContentId = 0)
  233. {
  234. // check ACL
  235. $aCheck = checkActionModule($this->_iProfileId, 'set thumb', $this->getName(), false);
  236. if ($aCheck[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED)
  237. return $aCheck[CHECK_ACTION_MESSAGE];
  238. return CHECK_ACTION_RESULT_ALLOWED;
  239. }
  240. public function isPollPerformed($iObjectId, $iAuthorId = 0, $iAuthorIp = 0)
  241. {
  242. if(empty($iAuthorId)) {
  243. $iAuthorId = bx_get_logged_profile_id();
  244. $iAuthorIp = ip2long(getVisitorIP());
  245. }
  246. return $this->_oDb->isPollPerformed($iObjectId, $iAuthorId, $iAuthorIp);
  247. }
  248. // ====== COMMON METHODS
  249. public function onPublished($iContentId)
  250. {
  251. parent::onPublished($iContentId);
  252. $CNF = &$this->_oConfig->CNF;
  253. $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
  254. if(!$aContentInfo)
  255. return;
  256. $aParams = $this->_alertParams($aContentInfo);
  257. bx_alert($this->getName(), 'added', $iContentId, $aContentInfo[$CNF['FIELD_AUTHOR']], $aParams);
  258. }
  259. public function onFailed($iContentId)
  260. {
  261. parent::onFailed($iContentId);
  262. $CNF = &$this->_oConfig->CNF;
  263. $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
  264. if(!$aContentInfo)
  265. return;
  266. $aParams = array('object_author_id' => $aContentInfo[$CNF['FIELD_AUTHOR']]);
  267. bx_alert($this->getName(), 'failed', $iContentId, $aContentInfo[$CNF['FIELD_AUTHOR']], $aParams);
  268. }
  269. public function alertAfterAdd($aContentInfo)
  270. {
  271. $CNF = &$this->_oConfig->CNF;
  272. $iId = (int)$aContentInfo[$CNF['FIELD_ID']];
  273. $iAuthorId = (int)$aContentInfo[$CNF['FIELD_AUTHOR']];
  274. $sAction = 'added';
  275. if(isset($CNF['FIELD_STATUS']) && isset($aContentInfo[$CNF['FIELD_STATUS']]) && $aContentInfo[$CNF['FIELD_STATUS']] == 'awaiting')
  276. $sAction = 'deferred';
  277. $aParams = $this->_alertParams($aContentInfo);
  278. bx_alert('system', 'prepare_alert_params', 0, 0, array('unit'=> $this->getName(), 'action' => $sAction, 'object_id' => $iId, 'sender_id' => $iAuthorId, 'extras' => &$aParams));
  279. bx_alert($this->getName(), $sAction, $iId, $iAuthorId, $aParams);
  280. }
  281. public function alertAfterEdit($aContentInfo)
  282. {
  283. $CNF = &$this->_oConfig->CNF;
  284. $iId = (int)$aContentInfo[$CNF['FIELD_ID']];
  285. $aParams = $this->_alertParams($aContentInfo);
  286. bx_alert($this->getName(), 'edited', $iId, false, $aParams);
  287. }
  288. /**
  289. * Get array of params to be passed in Add/Edit Alert.
  290. */
  291. protected function _alertParams($aContentInfo)
  292. {
  293. $CNF = &$this->_oConfig->CNF;
  294. $iId = (int)$aContentInfo[$CNF['FIELD_ID']];
  295. $iAuthorId = (int)$aContentInfo[$CNF['FIELD_AUTHOR']];
  296. $aParams = array(
  297. 'object_author_id' => $iAuthorId
  298. );
  299. if(isset($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]))
  300. $aParams['privacy_view'] = $aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']];
  301. if(!empty($CNF['OBJECT_METATAGS']))
  302. $aParams['timeline_group'] = array(
  303. 'by' => $this->getName() . '_' . $iAuthorId . '_' . $iId,
  304. 'field' => 'owner_id'
  305. );
  306. return $aParams;
  307. }
  308. public function isEntryActive($aContentInfo)
  309. {
  310. $CNF = &$this->_oConfig->CNF;
  311. if($aContentInfo[$CNF['FIELD_AUTHOR']] == bx_get_logged_profile_id() || $this->_isModerator())
  312. return true;
  313. if(isset($CNF['FIELD_STATUS']) && $aContentInfo[$CNF['FIELD_STATUS']] != 'active')
  314. return false;
  315. if(isset($CNF['FIELD_STATUS_ADMIN']) && $aContentInfo[$CNF['FIELD_STATUS_ADMIN']] != 'active')
  316. return false;
  317. return true;
  318. }
  319. public function getPollForm()
  320. {
  321. $CNF = &$this->_oConfig->CNF;
  322. if(empty($CNF['OBJECT_FORM_POLL']))
  323. return array('code' => 1, 'message' => '_sys_txt_error_occured');
  324. $iProfileId = bx_get_logged_profile_id();
  325. $oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_POLL'], $CNF['OBJECT_FORM_POLL_DISPLAY_ADD'], $this->_oTemplate);
  326. $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'submit_poll_form/';
  327. $oForm->initChecker();
  328. if($oForm->isSubmittedAndValid()) {
  329. $iId = $oForm->insert();
  330. if($iId)
  331. return array('code' => 0, 'id' => $iId, 'item' => $this->_oTemplate->getPollItem($iId, $iProfileId, array(
  332. 'manage' => true
  333. )));
  334. else
  335. return array('code' => 2, 'message' => '_sys_txt_error_entry_creation');
  336. }
  337. return array('form' => $oForm->getCode(), 'form_id' => $oForm->id);
  338. }
  339. // ====== PROTECTED METHODS
  340. protected function _getImagesForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
  341. {
  342. $CNF = &$this->_oConfig->CNF;
  343. $aResults = parent::_getImagesForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams);
  344. if(!$this->_oConfig->isAttachmentsInTimeline() || empty($CNF['OBJECT_STORAGE_PHOTOS']) || empty($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS']))
  345. return $aResults;
  346. $iContentId = (int)$aContentInfo[$CNF['FIELD_ID']];
  347. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE_PHOTOS']);
  348. $aGhostFiles = $oStorage->getGhosts($this->serviceGetContentOwnerProfileId($iContentId), $iContentId);
  349. if(!$aGhostFiles)
  350. return array();
  351. $oTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS']);
  352. foreach ($aGhostFiles as $k => $a) {
  353. $sPhotoSrc = $oTranscoder->getFileUrl($a['id']);
  354. if(empty($sPhotoSrc))
  355. continue;
  356. $aResults[] = array(
  357. 'id' => $a['id'],
  358. 'src' => $sPhotoSrc,
  359. 'src_medium' => $sPhotoSrc,
  360. 'src_orig' => $oStorage->getFileUrlById($a['id']),
  361. );
  362. }
  363. return $aResults;
  364. }
  365. protected function _getVideosForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
  366. {
  367. $CNF = &$this->_oConfig->CNF;
  368. $aResults = parent::_getVideosForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams);
  369. if(!$this->_oConfig->isAttachmentsInTimeline() || empty($CNF['OBJECT_STORAGE_VIDEOS']) || empty($CNF['OBJECT_VIDEOS_TRANSCODERS']))
  370. return $aResults;
  371. $iContentId = (int)$aContentInfo[$CNF['FIELD_ID']];
  372. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE_VIDEOS']);
  373. $aGhostFiles = $oStorage->getGhosts($this->serviceGetContentOwnerProfileId($iContentId), $iContentId);
  374. if(!$aGhostFiles)
  375. return array();
  376. $oTcPoster = BxDolTranscoderVideo::getObjectInstance($CNF['OBJECT_VIDEOS_TRANSCODERS']['poster']);
  377. $oTcMp4 = BxDolTranscoderVideo::getObjectInstance($CNF['OBJECT_VIDEOS_TRANSCODERS']['mp4']);
  378. $oTcMp4Hd = BxDolTranscoderVideo::getObjectInstance($CNF['OBJECT_VIDEOS_TRANSCODERS']['mp4_hd']);
  379. if(!$oTcPoster || !$oTcMp4 || !$oTcMp4Hd)
  380. return array();
  381. $aResults = array();
  382. foreach ($aGhostFiles as $k => $a) {
  383. $sVideoUrl = $oStorage->getFileUrlById($a['id']);
  384. $aVideoSize = $oTcMp4Hd->getVideoSize($sVideoUrl);
  385. $sVideoUrlHd = '';
  386. if(!empty($aVideoSize) && is_array($aVideoSize) && (int)$aVideoSize['h'] >= 720)
  387. $sVideoUrlHd = $oTcMp4Hd->getFileUrl($a['id']);
  388. $aResults[$a['id']] = array(
  389. 'id' => $a['id'],
  390. 'src_poster' => $oTcPoster->getFileUrl($a['id']),
  391. 'src_mp4' => $oTcMp4->getFileUrl($a['id']),
  392. 'src_mp4_hd' => $sVideoUrlHd,
  393. );
  394. }
  395. return $aResults;
  396. }
  397. protected function _getFilesForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
  398. {
  399. $CNF = &$this->_oConfig->CNF;
  400. $aResults = parent::_getFilesForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams);
  401. if(!$this->_oConfig->isAttachmentsInTimeline() || empty($CNF['OBJECT_STORAGE_FILES']))
  402. return $aResults;
  403. $iContentId = (int)$aContentInfo[$CNF['FIELD_ID']];
  404. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE_FILES']);
  405. $aGhostFiles = $oStorage->getGhosts($this->serviceGetContentOwnerProfileId($iContentId), $iContentId);
  406. if(!$aGhostFiles)
  407. return array();
  408. $oTranscoder = null;
  409. if(!empty($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY_FILES']))
  410. $oTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY_FILES']);
  411. foreach ($aGhostFiles as $k => $a) {
  412. $bImage = in_array($a['ext'], array('jpg', 'jpeg', 'png', 'gif'));
  413. $sPhotoSrc = '';
  414. if($bImage && $oTranscoder)
  415. $sPhotoSrc = $oTranscoder->getFileUrl($a['id']);
  416. if(empty($sPhotoSrc) && $oStorage)
  417. $sPhotoSrc = $this->_oTemplate->getIconUrl($oStorage->getIconNameByFileName($a['file_name']));
  418. $sUrl = $oStorage->getFileUrlById($a['id']);
  419. $aResults[] = array(
  420. 'id' => $a['id'],
  421. 'src' => $sPhotoSrc,
  422. 'src_medium' => $sPhotoSrc,
  423. 'src_orig' => $bImage ? $sUrl : '',
  424. 'url' => !$bImage ? $sUrl : ''
  425. );
  426. }
  427. return $aResults;
  428. }
  429. protected function _getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams = array())
  430. {
  431. $aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams);
  432. if(!$this->_oConfig->isAttachmentsInTimeline())
  433. return $aResult;
  434. $CNF = &$this->_oConfig->CNF;
  435. $bDynamic = isset($aBrowseParams['dynamic_mode']) && (bool)$aBrowseParams['dynamic_mode'] === true;
  436. $aPolls = $this->_oDb->getPolls(array('type' => 'content_id', 'content_id' => (int)$aContentInfo[$CNF['FIELD_ID']]));
  437. if(!empty($aPolls) && is_array($aPolls)) {
  438. $sInclude = $this->_oTemplate->addCss(array('polls.css'), $bDynamic);
  439. $aResult['raw'] = ($bDynamic ? $sInclude : '') . $this->_oTemplate->parseHtmlByName('poll_items_embed.html', array(
  440. 'embed_url' => BX_DOL_URL_ROOT . bx_append_url_params($this->_oConfig->getBaseUri() . 'embed_polls/', array(
  441. 'id' => (int)$aContentInfo[$CNF['FIELD_ID']],
  442. 'param_switch_menu' => 0,
  443. 'param_showcase' => 1
  444. ))
  445. ));
  446. /*
  447. if((!empty($aResult['videos']) && is_array($aResult['videos'])) || (!empty($aResult['videos_attach']) && is_array($aResult['videos_attach'])))
  448. $aResult['_cache'] = false;
  449. */
  450. }
  451. return $aResult;
  452. }
  453. protected function _buildRssParams($sMode, $aArgs)
  454. {
  455. $aParams = array ();
  456. $sMode = bx_process_input($sMode);
  457. switch ($sMode) {
  458. case 'author':
  459. $aParams = array('author' => isset($aArgs[0]) ? (int)$aArgs[0] : '');
  460. break;
  461. }
  462. return $aParams;
  463. }
  464. }
  465. /** @} */