BxCnlModule.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  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. * @defdroup Channels Channels
  7. * @indroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Channels profiles module.
  13. */
  14. class BxCnlModule extends BxBaseModGroupsModule
  15. {
  16. function __construct(&$aModule)
  17. {
  18. parent::__construct($aModule);
  19. }
  20. public function _modGroupsCheckAllowedSubscribeAdd(&$aDataEntry, $isPerformAction = false)
  21. {
  22. return parent::_modProfileCheckAllowedSubscribeAdd($aDataEntry, $isPerformAction);
  23. }
  24. /**
  25. * Process Hash Tag
  26. *
  27. * @param string $sHashtag - hashtag to be processed.
  28. * @param string $sModuleName - module name.
  29. * @param integer $iContentId - ID of the content which has the hashtag.
  30. * @param integer $iAuthorId - action's author id.
  31. */
  32. function processHashtag($sHashtag, $sModuleName, $iContentId, $iAuthorId)
  33. {
  34. $CNF = &$this->_oConfig->CNF;
  35. /*
  36. * Note! For now metatag object name is used here as module name, because usually it's equal to module's name. This should be changed in Ticket #1596
  37. * For now if module cannot be created then a channel for such tag shouldn't be created too.
  38. */
  39. $oModule = BxDolModule::getInstance($sModuleName);
  40. if(empty($oModule) && $sModuleName != 'sys_cmts')
  41. return;
  42. /*
  43. * Use content's author profile when Author ID wasn't provided.
  44. * Usually it happens when tags were processed with cron.
  45. */
  46. if(empty($iAuthorId))
  47. $iAuthorId = BxDolService::call($sModuleName, 'get_author', array($iContentId));
  48. $aCheck = checkActionModule($this->_iProfileId, 'create channel auto', $this->getName(), false);
  49. $mixedCnlId = $this->_oDb->getChannelIdByName($sHashtag);
  50. if(empty($mixedCnlId) && ($aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED)) {
  51. $iProfileId = (int)$this->_oDb->getParam($CNF['PARAM_DEFAULT_AUTHOR']);
  52. if(empty($iProfileId)) {
  53. $aOperators = BxDolAccountQuery::getInstance()->getOperators();
  54. if(count($aOperators) > 0)
  55. $iProfileId = BxDolProfile::getInstanceByAccount(array_shift($aOperators))->id();
  56. }
  57. $aContent = $this->serviceEntityAdd($iProfileId, array($CNF['FIELD_NAME'] => $sHashtag));
  58. checkActionModule($this->_iProfileId, 'create channel auto', $this->getName(), true);
  59. if(isset($aContent['content']) && isset($aContent['content']['id']))
  60. $mixedCnlId = $aContent['content']['id'];
  61. }
  62. if(empty($mixedCnlId) || (int)$this->_oDb->checkContentInChannel($iContentId, $mixedCnlId, $sModuleName, $iAuthorId) != 0)
  63. return;
  64. $iId = (int)$this->_oDb->addContentToChannel($iContentId, $mixedCnlId, $sModuleName, $iAuthorId);
  65. if($iId == 0)
  66. return;
  67. $oCnlProfile = BxDolProfile::getInstanceByContentAndType($mixedCnlId, $this->_oConfig->getName());
  68. if(!$oCnlProfile)
  69. return;
  70. $iCnlProfileId = $oCnlProfile->id();
  71. bx_alert($this->_aModule['name'], 'hashtag_added', $iId, $iCnlProfileId, array(
  72. 'object_author_id' => $iAuthorId,
  73. 'privacy_view' => -$iCnlProfileId,
  74. 'timeline_group' => array(
  75. 'by' => $sModuleName . '_' . $iAuthorId . '_' . $iContentId,
  76. 'field' => 'owner_id'
  77. )
  78. ));
  79. $aParams = array(
  80. 'object_author_id' => $iAuthorId,
  81. 'privacy_view' => -$iCnlProfileId,
  82. 'subobject_id' => $iId,
  83. 'content_module' => $sModuleName,
  84. 'content_id' => $iContentId,
  85. 'content_author_id' => $iAuthorId
  86. );
  87. bx_alert('system', 'prepare_alert_params', 0, 0, array('unit'=> $this->_aModule['name'], 'action' => 'hashtag_added_notif', 'object_id' => $mixedCnlId, 'sender_id' => $iCnlProfileId, 'extras' => &$aParams));
  88. bx_alert($this->_aModule['name'], 'hashtag_added_notif', $mixedCnlId, $iCnlProfileId, $aParams);
  89. }
  90. function removeContentFromChannel($iContentId, $sModuleName)
  91. {
  92. $oDolProfileQuery = BxDolProfileQuery::getInstance();
  93. $aData = $this->_oDb->getDataByContent($iContentId, $sModuleName);
  94. foreach ($aData as $aRow) {
  95. $iProfileInfo = $oDolProfileQuery->getProfileByContentAndType($aRow['cnl_id'], $this->_aModule['name']);
  96. if(is_array($iProfileInfo)){
  97. bx_alert($this->_aModule['name'], 'hashtag_deleted', $aRow['id'], $iProfileInfo['id']);
  98. bx_alert($this->_aModule['name'], 'hashtag_deleted_notif', $aRow['cnl_id'], $iProfileInfo['id'], array('subobject_id' => $aRow['id']));
  99. }
  100. }
  101. return $this->_oDb->removeContentFromChannel($iContentId, $sModuleName);
  102. }
  103. public function serviceGetSafeServices()
  104. {
  105. $a = parent::serviceGetSafeServices();
  106. unset($a['GetCreatePostForm']);
  107. unset($a['EntityCreate']);
  108. return array_merge($a, array (
  109. 'EntityBreadcrumb' => '',
  110. 'EntityParent' => '',
  111. 'EntityChilds' => '',
  112. 'SearchResultByHashtag' => '',
  113. ));
  114. }
  115. public function serviceGetWidgetNotices()
  116. {
  117. $CNF = &$this->_oConfig->CNF;
  118. $iResult = 0;
  119. if(empty($this->_oDb->getParam($CNF['PARAM_DEFAULT_AUTHOR'])))
  120. $iResult += 1;
  121. return $iResult;
  122. }
  123. public function serviceGetOptionsDefaultAuthor()
  124. {
  125. $aResult = array(
  126. array('key' => '', 'value' => _t('_Select_one'))
  127. );
  128. $aAccountsIds = BxDolAccountQuery::getInstance()->getOperators();
  129. foreach($aAccountsIds as $iAccountId) {
  130. $aProfilesIds = BxDolAccount::getInstance($iAccountId)->getProfilesIds();
  131. foreach($aProfilesIds as $iProfileId)
  132. $aResult[] = array(
  133. 'key' => $iProfileId,
  134. 'value' => BxDolProfile::getInstance($iProfileId)->getDisplayName()
  135. );
  136. }
  137. return $aResult;
  138. }
  139. /**
  140. * @page service Service Calls
  141. * @section bx_channels Channels
  142. * @subsection bx_channels-page_blocks Page Blocks
  143. * @subsubsection bx_channels-entity_breadcrumb entity_breadcrumb
  144. *
  145. * @code bx_srv('bx_channels', 'entity_breadcrumb', [...]); @endcode
  146. *
  147. * Display channel breadcrumb
  148. * @param $iContentId channel content ID
  149. *
  150. * @see BxCnlModule::serviceEntityBreadcrumb
  151. */
  152. /**
  153. * @ref bx_channels-entity_breadcrumb "entity_breadcrumb"
  154. */
  155. public function serviceEntityBreadcrumb($iContentId = 0)
  156. {
  157. if(!$iContentId)
  158. $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
  159. if(!$iContentId)
  160. return false;
  161. $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
  162. if(!$aContentInfo)
  163. return false;
  164. return $this->_oTemplate->entryBreadcrumb($aContentInfo);
  165. }
  166. /**
  167. * @page service Service Calls
  168. * @section bx_channels Channels
  169. * @subsection bx_channels-page_blocks Page Blocks
  170. * @subsubsection bx_channels-entity_parent entity_parent
  171. *
  172. * @code bx_srv('bx_channels', 'entity_parent', [...]); @endcode
  173. *
  174. * Display block with parent channel
  175. * @param $iContentId channel content ID
  176. *
  177. * @see BxCnlModule::serviceEntityParent
  178. */
  179. /**
  180. * @ref bx_channels-entity_parent "entity_parent"
  181. */
  182. public function serviceEntityParent($iContentId = 0)
  183. {
  184. return $this->_serviceTemplateFunc('entryParent', $iContentId);
  185. }
  186. /**
  187. * @page service Service Calls
  188. * @section bx_channels Channels
  189. * @subsection bx_channels-page_blocks Page Blocks
  190. * @subsubsection bx_channels-entity_childs entity_childs
  191. *
  192. * @code bx_srv('bx_channels', 'entity_childs', [...]); @endcode
  193. *
  194. * Display block with child channels
  195. * @param $iContentId channel content ID
  196. *
  197. * @see BxCnlModule::serviceEntityChilds
  198. */
  199. /**
  200. * @ref bx_channels-entity_childs "entity_childs"
  201. */
  202. public function serviceEntityChilds($iContentId = 0)
  203. {
  204. return $this->_serviceTemplateFunc('entryChilds', $iContentId);
  205. }
  206. /**
  207. * @page service Service Calls
  208. * @section bx_channels Channels
  209. * @subsection bx_channels-page_blocks Page Blocks
  210. * @subsubsection bx_channels-search_result_by_hashtag search_result_by_hashtag
  211. *
  212. * @code bx_srv('bx_channels', 'search_result_by_hashtag', [...]); @endcode
  213. *
  214. * Display search results by hashtag for particular channel
  215. * @param $iContentId channel content ID
  216. *
  217. * @see BxCnlModule::serviceSearchResultByHashtag
  218. */
  219. /**
  220. * @ref bx_channels-search_result_by_hashtag "search_result_by_hashtag"
  221. */
  222. public function serviceSearchResultByHashtag($iContentId = 0)
  223. {
  224. $CNF = &$this->_oConfig->CNF;
  225. $oSearch = new BxTemplSearch();
  226. $oSearch->setLiveSearch(0);
  227. $oSearch->setMetaType('keyword');
  228. $aContentInfo = $this->_oDb->getContentInfoById(bx_get('id'));
  229. $_GET['keyword'] = $aContentInfo[$CNF['FIELD_NAME']];
  230. $sCode = $oSearch->response();
  231. if (!$sCode)
  232. $sCode = $oSearch->getEmptyResult();
  233. return $sCode;
  234. }
  235. /**
  236. * Data for Timeline module
  237. */
  238. public function serviceGetTimelineData()
  239. {
  240. $sModule = $this->_aModule['name'];
  241. return array(
  242. 'handlers' => array(
  243. array('group' => $sModule . '_hastag', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'hashtag_added', 'module_name' => $sModule, 'module_method' => 'get_timeline_post_hashtag', 'module_class' => 'Module', 'groupable' => 0, 'group_by' => ''),
  244. array('group' => $sModule . '_hastag', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'hashtag_deleted')
  245. ),
  246. 'alerts' => array(
  247. array('unit' => $sModule, 'action' => 'hashtag_added'),
  248. array('unit' => $sModule, 'action' => 'hashtag_deleted')
  249. )
  250. );
  251. }
  252. public function serviceGetTimelinePostAllowedView ($aEvent)
  253. {
  254. $sError = _t('_sys_txt_access_denied');
  255. if(empty($aEvent) || !is_array($aEvent))
  256. return $sError;
  257. $aEventContent = $this->_oDb->getContentById($aEvent['object_id']);
  258. if ($aEventContent['module_name'] == 'sys_cmts')
  259. return CHECK_ACTION_RESULT_ALLOWED;
  260. if(empty($aEventContent) || !is_array($aEventContent))
  261. return $sError;
  262. if(!BxDolRequest::serviceExists($aEventContent['module_name'], 'get_timeline_post_allowed_view'))
  263. return $sError;
  264. return BxDolService::call($aEventContent['module_name'], 'get_timeline_post_allowed_view', array(array('id' => $aEvent['id'], 'owner_id' => $aEventContent['author_id'], 'object_id' => $aEventContent['content_id'])));
  265. }
  266. public function serviceGetTimelinePostHashtag($aEvent, $aBrowseParams = array())
  267. {
  268. if(empty($aEvent) || !is_array($aEvent))
  269. return false;
  270. $aEventContent = $this->_oDb->getContentById($aEvent['object_id']);
  271. if(empty($aEventContent) || !is_array($aEventContent))
  272. return false;
  273. $sModule = $aEventContent['module_name'];
  274. $sClass = 'Module';
  275. if($sModule == 'sys_cmts'){
  276. $sClass = 'TemplCmtsServices';
  277. $sModule = 'system';
  278. }
  279. if(!BxDolRequest::serviceExists($sModule, 'get_timeline_post', $sClass))
  280. return false;
  281. /**
  282. * Prepare fake event array (only mandatory parameters) to get
  283. * necessary data (related to an 'original' event with hashtag/label)
  284. * from associated content module.
  285. */
  286. $iOwnerId = (int)$aEventContent['author_id'];
  287. $iContentId = (int)$aEventContent['content_id'];
  288. $mixedObjectPrivacyView = BX_DOL_PG_ALL;
  289. if(BxDolRequest::serviceExists($sModule, 'get_privacy_view')) {
  290. $mixedAllowViewTo = BxDolService::call($sModule, 'get_privacy_view', array($iContentId));
  291. if($mixedAllowViewTo !== false)
  292. $mixedObjectPrivacyView = $mixedAllowViewTo;
  293. if(is_numeric($mixedAllowViewTo) && (int)$mixedAllowViewTo < 0)
  294. $iOwnerId = abs($mixedAllowViewTo);
  295. }
  296. $aResult = BxDolService::call($sModule, 'get_timeline_post', array(array(
  297. 'owner_id' => $iOwnerId,
  298. 'object_id' => $iContentId,
  299. 'object_privacy_view' => $mixedObjectPrivacyView
  300. ), $aBrowseParams), $sClass);
  301. if(empty($aResult) || !is_array($aResult))
  302. return $aResult;
  303. /**
  304. * Note. The context shouldn't be changed therefore
  305. * use input event's context (owner_id) in returned results.
  306. */
  307. return array_merge($aResult, array(
  308. 'owner_id' => $aEvent['owner_id']
  309. ));
  310. }
  311. /**
  312. * Data for Notifications module
  313. */
  314. public function serviceGetNotificationsData()
  315. {
  316. $a = parent::serviceGetNotificationsData();
  317. $sModule = $this->_aModule['name'];
  318. $a['handlers'][] = array('group' => $sModule . '_hastag_notif', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'hashtag_added_notif', 'module_name' => $sModule, 'module_method' => 'get_notifications_post_hashtag', 'module_class' => 'Module');
  319. $a['handlers'][] = array('group' => $sModule . '_hastag_notif', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'hashtag_deleted_notif');
  320. $a['settings'][] = array('group' => 'hastag', 'unit' => $sModule, 'action' => 'hashtag_added_notif', 'types' => array('follow_context'));
  321. $a['alerts'][] = array('unit' => $sModule, 'action' => 'hashtag_added_notif');
  322. $a['alerts'][] = array('unit' => $sModule, 'action' => 'hashtag_deleted_notif');
  323. return $a;
  324. }
  325. public function serviceGetNotificationsPostHashtag($aEvent)
  326. {
  327. if(empty($aEvent) || !is_array($aEvent))
  328. return '';
  329. $aContentEvent = $this->_oDb->getContentById($aEvent['subobject_id']);
  330. if(empty($aContentEvent) || !is_array($aContentEvent))
  331. return '';
  332. $oModule = BxDolModule::getInstance($aContentEvent['module_name']);
  333. if ($oModule) {
  334. if (isset($oModule->_oConfig->CNF['OBJECT_PRIVACY_VIEW'])){
  335. $oPrivacy = BxDolPrivacy::getObjectInstance($oModule->_oConfig->CNF['OBJECT_PRIVACY_VIEW']);
  336. if (!$oPrivacy->check($aContentEvent['content_id']))
  337. return '';
  338. }
  339. $aRv = $oModule->serviceGetNotificationsPost(array(
  340. 'object_id' => $aContentEvent['content_id']
  341. ));
  342. $aRv['lang_key'] = '_bx_channels_ntfs_txt_subobject_added';
  343. if(method_exists($oModule, 'serviceActAsProfile') && $oModule->serviceActAsProfile())
  344. $aRv['lang_key'] = '_bx_channels_ntfs_txt_subobject_added_profile';
  345. $aRv['entry_url'] = $this->serviceGetLink($aContentEvent['cnl_id']);
  346. return $aRv;
  347. }
  348. return '';
  349. }
  350. public function serviceBrowseByLevel ($iLevelId = 0, $bDisplayEmptyMsg = false)
  351. {
  352. return $this->_serviceBrowse ('level', array('level' => $iLevelId), BX_DB_PADDING_DEF, $bDisplayEmptyMsg);
  353. }
  354. public function serviceBrowseFollowed($iProfileId = 0, $aParams = array())
  355. {
  356. return $this->_serviceBrowseWithParam ('followed_entries', 'profile_id', $iProfileId, $aParams);
  357. }
  358. public function serviceBrowseAuthor($iProfileId = 0, $aParams = array())
  359. {
  360. $CNF = &$this->_oConfig->CNF;
  361. if(empty($iProfileId))
  362. $iProfileId = bx_get_logged_profile_id();
  363. $sResult = isset($aParams['empty_message']) && (bool)$aParams['empty_message'] === true ? MsgBox(_t('_Empty')) : '';
  364. $oConnection = BxDolConnection::getObjectInstance('sys_profiles_subscriptions');
  365. $aProfile = $oConnection->getConnectedContent($iProfileId);
  366. $aVars = array();
  367. foreach ($aProfile as $iProfileId) {
  368. $oProfile = BxDolProfile::getInstance($iProfileId);
  369. if (!$oProfile || $oProfile->getModule() != $this->getName())
  370. continue;
  371. $iContentId = $oProfile->getContentId();
  372. $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
  373. if (isset($aContentInfo[$CNF['FIELD_NAME']]))
  374. array_push($aVars, array('title' => $aContentInfo[$CNF['FIELD_NAME']], 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId)));
  375. }
  376. if(empty($aVars) || !is_array($aVars))
  377. return $sResult;
  378. return $this->_oTemplate->parseHtmlByName('my_channels.html', array(
  379. 'bx_if:show_list' => array(
  380. 'condition' => count($aVars) > 0,
  381. 'content' => array(
  382. 'bx_repeat:items' => $aVars
  383. )
  384. )
  385. ));
  386. }
  387. public function serviceDeleteProfileFromFansAndAdmins ($iProfileId)
  388. {
  389. return true;
  390. }
  391. public function serviceGetFollowingChannelsNames($iProfileId)
  392. {
  393. if (!($oConn = BxDolConnection::getObjectInstance('sys_profiles_subscriptions')))
  394. return array();
  395. if (!($aIds = $oConn->getConnectedContent($iProfileId)))
  396. return array();
  397. $a = array();
  398. foreach ($aIds as $iId) {
  399. if (!($oProfile = BxDolProfile::getInstance($iId)))
  400. continue;
  401. if ($oProfile->getModule() != $this->getName())
  402. continue;
  403. $a[] = $oProfile->getDisplayName();
  404. }
  405. return $a;
  406. }
  407. public function checkAllowedCompose(&$aDataEntry, $isPerformAction = false)
  408. {
  409. return _t('_sys_txt_access_denied');
  410. }
  411. public function checkAllowedContact($aDataEntry, $isPerformAction = false)
  412. {
  413. return _t('_sys_txt_access_denied');
  414. }
  415. public function followLabels($sModule, $iContentId)
  416. {
  417. if (!getParam('bx_channels_labels_autofollow'))
  418. return;
  419. if (!($oModuleProfiles = BxDolModule::getInstance($sModule)))
  420. return;
  421. if (!($aContentInfo = $oModuleProfiles->_oDb->getContentInfoById($iContentId)) || !($oProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $sModule)))
  422. return;
  423. $CNF = &$oModuleProfiles->_oConfig->CNF;
  424. if (!$oModuleProfiles->serviceActAsProfile() || !isset($CNF['FIELD_LABELS']) || empty($aContentInfo[$CNF['FIELD_ID']]))
  425. return;
  426. if (!($oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS'])) || !$oMetatags->keywordsIsEnabled() || !($aLabels = $oMetatags->keywordsGet($aContentInfo[$CNF['FIELD_ID']])))
  427. return;
  428. if (!($oConn = BxDolConnection::getObjectInstance('sys_profiles_subscriptions')))
  429. return;
  430. foreach ($aLabels as $sLabel) {
  431. if (!($iContentIdChannel = $this->_oDb->getChannelIdByName($sLabel)))
  432. continue;
  433. if (!($oProfileChannel = BxDolProfile::getInstanceByContentAndType($iContentIdChannel, 'bx_channels')))
  434. continue;
  435. $oConn->addConnection($oProfile->id(), $oProfileChannel->id());
  436. }
  437. }
  438. /** Returns profile's subscribed channels React Jot
  439. *
  440. * @param int $iProfileId
  441. * @param array $aParams
  442. * @return array
  443. */
  444. public function serviceBrowseAuthorChannels($iProfileId = 0, $aParams = array())
  445. {
  446. $CNF = &$this->_oConfig->CNF;
  447. if(empty($iProfileId))
  448. $iProfileId = bx_get_logged_profile_id();
  449. $oConnection = BxDolConnection::getObjectInstance('sys_profiles_subscriptions');
  450. $aProfile = $oConnection->getConnectedContent($iProfileId);
  451. $aVars = array();
  452. foreach ($aProfile as $iProfileId) {
  453. $oProfile = BxDolProfile::getInstance($iProfileId);
  454. if (!$oProfile || $oProfile->getModule() != $this->getName())
  455. continue;
  456. $iContentId = $oProfile->getContentId();
  457. $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
  458. if (isset($aContentInfo[$CNF['FIELD_NAME']]))
  459. array_push($aVars, array(
  460. 'title' => $aContentInfo[$CNF['FIELD_NAME']],
  461. 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId),
  462. 'followers' => $oConnection -> getConnectedInitiatorsCount($iProfileId),
  463. 'id' => $iProfileId,
  464. 'icon' => $oProfile -> getThumb()
  465. ));
  466. }
  467. return $aVars;
  468. }
  469. }
  470. /** @} */