BxBaseModTextModule.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  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->_oDb->isPollPerformed($iPollId, bx_get_logged_profile_id()))
  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 recently updated entries
  151. * @return HTML string
  152. */
  153. public function serviceBrowseUpdated ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)
  154. {
  155. return $this->_serviceBrowse ('updated', $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
  156. }
  157. /**
  158. * Display entries of the author
  159. * @return HTML string
  160. */
  161. public function serviceBrowseAuthor ($iProfileId = 0, $aParams = array())
  162. {
  163. return $this->_serviceBrowseWithParam ('author', 'profile_id', $iProfileId, $aParams);
  164. }
  165. /**
  166. * Display entries posted into particular context
  167. * @return HTML string
  168. */
  169. public function serviceBrowseContext ($iProfileId = 0, $aParams = array())
  170. {
  171. return $this->_serviceBrowseWithParam ('context', 'profile_id', $iProfileId, $aParams);
  172. }
  173. public function _serviceBrowseWithParam ($sParamName, $sParamGet, $sParamVal, $aParams = array())
  174. {
  175. if(!$sParamVal)
  176. $sParamVal = bx_process_input(bx_get($sParamGet), BX_DATA_INT);
  177. if(!$sParamVal)
  178. return '';
  179. $bEmptyMessage = true;
  180. if(isset($aParams['empty_message'])) {
  181. $bEmptyMessage = (bool)$aParams['empty_message'];
  182. unset($aParams['empty_message']);
  183. }
  184. $bAjaxPaginate = true;
  185. if(isset($aParams['ajax_paginate'])) {
  186. $bAjaxPaginate = (bool)$aParams['ajax_paginate'];
  187. unset($aParams['ajax_paginate']);
  188. }
  189. return $this->_serviceBrowse ($sParamName, array_merge(array($sParamName => $sParamVal), $aParams), BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
  190. }
  191. /**
  192. * Entry author block
  193. */
  194. public function serviceEntityAuthor ($iContentId = 0)
  195. {
  196. return $this->_serviceTemplateFunc ('entryAuthor', $iContentId);
  197. }
  198. /**
  199. * Entry context block
  200. */
  201. public function serviceEntityContext ($iContentId = 0)
  202. {
  203. return $this->_serviceTemplateFunc ('entryContext', $iContentId);
  204. }
  205. /**
  206. * Entry polls block
  207. */
  208. public function serviceEntityPolls ($iContentId = 0)
  209. {
  210. return $this->_serviceTemplateFunc ('entryPolls', $iContentId);
  211. }
  212. public function serviceEntityBreadcrumb ($iContentId = 0)
  213. {
  214. return $this->_serviceTemplateFunc ('entryBreadcrumb', $iContentId);
  215. }
  216. /**
  217. * Delete all content by profile
  218. * @param $iProfileId profile id
  219. * @return number of deleted items
  220. */
  221. public function serviceDeleteEntitiesByAuthor ($iProfileId)
  222. {
  223. $a = $this->_oDb->getEntriesByAuthor((int)$iProfileId);
  224. if (!$a)
  225. return 0;
  226. $iCount = 0;
  227. foreach ($a as $aContentInfo)
  228. $iCount += ('' == $this->serviceDeleteEntity($aContentInfo[$this->_oConfig->CNF['FIELD_ID']]) ? 1 : 0);
  229. return $iCount;
  230. }
  231. // ====== PERMISSION METHODS
  232. /**
  233. * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden. So make sure to make strict(===) checking.
  234. */
  235. public function checkAllowedSetThumb ($iContentId = 0)
  236. {
  237. // check ACL
  238. $aCheck = checkActionModule($this->_iProfileId, 'set thumb', $this->getName(), false);
  239. if ($aCheck[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED)
  240. return $aCheck[CHECK_ACTION_MESSAGE];
  241. return CHECK_ACTION_RESULT_ALLOWED;
  242. }
  243. // ====== COMMON METHODS
  244. public function onPublished($iContentId)
  245. {
  246. parent::onPublished($iContentId);
  247. $CNF = &$this->_oConfig->CNF;
  248. $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
  249. if(!$aContentInfo)
  250. return;
  251. $aParams = $this->_alertParams($aContentInfo);
  252. bx_alert($this->getName(), 'added', $iContentId, $aContentInfo[$CNF['FIELD_AUTHOR']], $aParams);
  253. }
  254. public function onFailed($iContentId)
  255. {
  256. parent::onFailed($iContentId);
  257. $CNF = &$this->_oConfig->CNF;
  258. $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
  259. if(!$aContentInfo)
  260. return;
  261. $aParams = array('object_author_id' => $aContentInfo[$CNF['FIELD_AUTHOR']]);
  262. bx_alert($this->getName(), 'failed', $iContentId, $aContentInfo[$CNF['FIELD_AUTHOR']], $aParams);
  263. }
  264. public function alertAfterAdd($aContentInfo)
  265. {
  266. $CNF = &$this->_oConfig->CNF;
  267. $iId = (int)$aContentInfo[$CNF['FIELD_ID']];
  268. $iAuthorId = (int)$aContentInfo[$CNF['FIELD_AUTHOR']];
  269. $sAction = 'added';
  270. if(isset($CNF['FIELD_STATUS']) && isset($aContentInfo[$CNF['FIELD_STATUS']]) && $aContentInfo[$CNF['FIELD_STATUS']] == 'awaiting')
  271. $sAction = 'deferred';
  272. $aParams = $this->_alertParams($aContentInfo);
  273. bx_alert($this->getName(), $sAction, $iId, $iAuthorId, $aParams);
  274. }
  275. public function alertAfterEdit($aContentInfo)
  276. {
  277. $CNF = &$this->_oConfig->CNF;
  278. $iId = (int)$aContentInfo[$CNF['FIELD_ID']];
  279. $aParams = $this->_alertParams($aContentInfo);
  280. bx_alert($this->getName(), 'edited', $iId, false, $aParams);
  281. }
  282. /**
  283. * Get array of params to be passed in Add/Edit Alert.
  284. */
  285. protected function _alertParams($aContentInfo)
  286. {
  287. $CNF = &$this->_oConfig->CNF;
  288. $iId = (int)$aContentInfo[$CNF['FIELD_ID']];
  289. $iAuthorId = (int)$aContentInfo[$CNF['FIELD_AUTHOR']];
  290. $aParams = array(
  291. 'object_author_id' => $iAuthorId
  292. );
  293. if(isset($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]))
  294. $aParams['privacy_view'] = $aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']];
  295. if(!empty($CNF['OBJECT_METATAGS']))
  296. $aParams['timeline_group'] = array(
  297. 'by' => $this->getName() . '_' . $iAuthorId . '_' . $iId,
  298. 'field' => 'owner_id'
  299. );
  300. return $aParams;
  301. }
  302. public function isEntryActive($aContentInfo)
  303. {
  304. $CNF = &$this->_oConfig->CNF;
  305. if($aContentInfo[$CNF['FIELD_AUTHOR']] == bx_get_logged_profile_id() || $this->_isModerator())
  306. return true;
  307. if(isset($CNF['FIELD_STATUS']) && $aContentInfo[$CNF['FIELD_STATUS']] != 'active')
  308. return false;
  309. if(isset($CNF['FIELD_STATUS_ADMIN']) && $aContentInfo[$CNF['FIELD_STATUS_ADMIN']] != 'active')
  310. return false;
  311. return true;
  312. }
  313. public function getPollForm()
  314. {
  315. $CNF = &$this->_oConfig->CNF;
  316. if(empty($CNF['OBJECT_FORM_POLL']))
  317. return array('code' => 1, 'message' => '_sys_txt_error_occured');
  318. $iProfileId = bx_get_logged_profile_id();
  319. $oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_POLL'], $CNF['OBJECT_FORM_POLL_DISPLAY_ADD'], $this->_oTemplate);
  320. $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'submit_poll_form/';
  321. $oForm->initChecker();
  322. if($oForm->isSubmittedAndValid()) {
  323. $iId = $oForm->insert();
  324. if($iId)
  325. return array('code' => 0, 'id' => $iId, 'item' => $this->_oTemplate->getPollItem($iId, $iProfileId, array(
  326. 'manage' => true
  327. )));
  328. else
  329. return array('code' => 2, 'message' => '_sys_txt_error_entry_creation');
  330. }
  331. return array('form' => $oForm->getCode(), 'form_id' => $oForm->id);
  332. }
  333. // ====== PROTECTED METHODS
  334. protected function _getImagesForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
  335. {
  336. $CNF = &$this->_oConfig->CNF;
  337. $aResults = parent::_getImagesForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams);
  338. if(!$this->_oConfig->isAttachmentsInTimeline() || empty($CNF['OBJECT_STORAGE_PHOTOS']) || empty($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS']))
  339. return $aResults;
  340. $iContentId = (int)$aContentInfo[$CNF['FIELD_ID']];
  341. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE_PHOTOS']);
  342. $aGhostFiles = $oStorage->getGhosts($this->serviceGetContentOwnerProfileId($iContentId), $iContentId);
  343. if(!$aGhostFiles)
  344. return array();
  345. $oTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS']);
  346. foreach ($aGhostFiles as $k => $a) {
  347. $sPhotoSrc = $oTranscoder->getFileUrl($a['id']);
  348. if(empty($sPhotoSrc))
  349. continue;
  350. $aResults[] = array(
  351. 'src' => $sPhotoSrc,
  352. 'src_medium' => $sPhotoSrc,
  353. 'src_orig' => $oStorage->getFileUrlById($a['id']),
  354. );
  355. }
  356. return $aResults;
  357. }
  358. protected function _getVideosForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
  359. {
  360. $CNF = &$this->_oConfig->CNF;
  361. $aResults = parent::_getVideosForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams);
  362. if(!$this->_oConfig->isAttachmentsInTimeline() || empty($CNF['OBJECT_STORAGE_VIDEOS']) || empty($CNF['OBJECT_VIDEOS_TRANSCODERS']))
  363. return $aResults;
  364. $iContentId = (int)$aContentInfo[$CNF['FIELD_ID']];
  365. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE_VIDEOS']);
  366. $aGhostFiles = $oStorage->getGhosts($this->serviceGetContentOwnerProfileId($iContentId), $iContentId);
  367. if(!$aGhostFiles)
  368. return array();
  369. $oTcPoster = BxDolTranscoderVideo::getObjectInstance($CNF['OBJECT_VIDEOS_TRANSCODERS']['poster']);
  370. $oTcMp4 = BxDolTranscoderVideo::getObjectInstance($CNF['OBJECT_VIDEOS_TRANSCODERS']['mp4']);
  371. $oTcMp4Hd = BxDolTranscoderVideo::getObjectInstance($CNF['OBJECT_VIDEOS_TRANSCODERS']['mp4_hd']);
  372. if(!$oTcPoster || !$oTcMp4 || !$oTcMp4Hd)
  373. return array();
  374. $aResults = array();
  375. foreach ($aGhostFiles as $k => $a) {
  376. $sVideoUrl = $oStorage->getFileUrlById($a['id']);
  377. $aVideoSize = $oTcMp4Hd->getVideoSize($sVideoUrl);
  378. $sVideoUrlHd = '';
  379. if(!empty($aVideoSize) && is_array($aVideoSize) && (int)$aVideoSize['h'] >= 720)
  380. $sVideoUrlHd = $oTcMp4Hd->getFileUrl($a['id']);
  381. $aResults[$a['id']] = array(
  382. 'id' => $a['id'],
  383. 'src_poster' => $oTcPoster->getFileUrl($a['id']),
  384. 'src_mp4' => $oTcMp4->getFileUrl($a['id']),
  385. 'src_mp4_hd' => $sVideoUrlHd,
  386. );
  387. }
  388. return $aResults;
  389. }
  390. protected function _getFilesForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
  391. {
  392. $CNF = &$this->_oConfig->CNF;
  393. $aResults = parent::_getFilesForTimelinePostAttach($aEvent, $aContentInfo, $sUrl, $aBrowseParams);
  394. if(!$this->_oConfig->isAttachmentsInTimeline() || empty($CNF['OBJECT_STORAGE_FILES']))
  395. return $aResults;
  396. $iContentId = (int)$aContentInfo[$CNF['FIELD_ID']];
  397. $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE_FILES']);
  398. $aGhostFiles = $oStorage->getGhosts($this->serviceGetContentOwnerProfileId($iContentId), $iContentId);
  399. if(!$aGhostFiles)
  400. return array();
  401. $oTranscoder = null;
  402. if(!empty($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY_FILES']))
  403. $oTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY_FILES']);
  404. foreach ($aGhostFiles as $k => $a) {
  405. $bImage = in_array($a['ext'], array('jpg', 'jpeg', 'png', 'gif'));
  406. $sPhotoSrc = '';
  407. if($bImage && $oTranscoder)
  408. $sPhotoSrc = $oTranscoder->getFileUrl($a['id']);
  409. if(empty($sPhotoSrc) && $oStorage)
  410. $sPhotoSrc = $this->_oTemplate->getIconUrl($oStorage->getIconNameByFileName($a['file_name']));
  411. $sUrl = $oStorage->getFileUrlById($a['id']);
  412. $aResults[] = array(
  413. 'src' => $sPhotoSrc,
  414. 'src_medium' => $sPhotoSrc,
  415. 'src_orig' => $bImage ? $sUrl : '',
  416. 'url' => !$bImage ? $sUrl : ''
  417. );
  418. }
  419. return $aResults;
  420. }
  421. protected function _getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams = array())
  422. {
  423. $aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams);
  424. if(!$this->_oConfig->isAttachmentsInTimeline())
  425. return $aResult;
  426. $CNF = &$this->_oConfig->CNF;
  427. $bDynamic = isset($aBrowseParams['dynamic_mode']) && (bool)$aBrowseParams['dynamic_mode'] === true;
  428. $aPolls = $this->_oDb->getPolls(array('type' => 'content_id', 'content_id' => (int)$aContentInfo[$CNF['FIELD_ID']]));
  429. if(!empty($aPolls) && is_array($aPolls)) {
  430. $sInclude = $this->_oTemplate->addCss(array('polls.css'), $bDynamic);
  431. $aResult['raw'] = ($bDynamic ? $sInclude : '') . $this->_oTemplate->parseHtmlByName('poll_items_embed.html', array(
  432. 'embed_url' => BX_DOL_URL_ROOT . bx_append_url_params($this->_oConfig->getBaseUri() . 'embed_polls/', array(
  433. 'id' => (int)$aContentInfo[$CNF['FIELD_ID']],
  434. 'param_switch_menu' => 0,
  435. 'param_showcase' => 1
  436. ))
  437. ));
  438. /*
  439. if((!empty($aResult['videos']) && is_array($aResult['videos'])) || (!empty($aResult['videos_attach']) && is_array($aResult['videos_attach'])))
  440. $aResult['_cache'] = false;
  441. */
  442. }
  443. return $aResult;
  444. }
  445. protected function _buildRssParams($sMode, $aArgs)
  446. {
  447. $aParams = array ();
  448. $sMode = bx_process_input($sMode);
  449. switch ($sMode) {
  450. case 'author':
  451. $aParams = array('author' => isset($aArgs[0]) ? (int)$aArgs[0] : '');
  452. break;
  453. }
  454. return $aParams;
  455. }
  456. }
  457. /** @} */