Skip to content

Commit

Permalink
Resolve conflict.
Browse files Browse the repository at this point in the history
  • Loading branch information
romanlesnikov authored and AntonLV committed Jun 21, 2021
1 parent 446284b commit 3f6818a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 17 deletions.
3 changes: 1 addition & 2 deletions modules/boonex/channels/classes/BxCnlConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ function __construct($aModule)

'PARAM_DEFAULT_AUTHOR' => 'bx_channels_default_author',
'PARAM_NUM_RSS' => 'bx_channels_num_rss',
'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_channels_num_connections_quick',


'PARAM_SEARCHABLE_FIELDS' => 'bx_channels_searchable_fields',
'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_channels_per_page_browse_showcase',
'PARAM_PER_PAGE_BROWSE_RECOMMENDED' => 'bx_channels_per_page_browse_recommended',
Expand Down
25 changes: 17 additions & 8 deletions modules/boonex/channels/classes/BxCnlModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ function processHashtag($sHashtag, $sModuleName, $iContentId, $iAuthorId)
* 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
* For now if module cannot be created then a channel for such tag shouldn't be created too.
*/

$oModule = BxDolModule::getInstance($sModuleName);
if(empty($oModule))
if(empty($oModule) && $sModuleName != 'sys_cmts')
return;

/*
Expand Down Expand Up @@ -294,6 +295,10 @@ public function serviceGetTimelinePostAllowedView ($aEvent)
return $sError;

$aEventContent = $this->_oDb->getContentById($aEvent['object_id']);

if ($aEventContent['module_name'] == 'sys_cmts')
return CHECK_ACTION_RESULT_ALLOWED;

if(empty($aEventContent) || !is_array($aEventContent))
return $sError;

Expand All @@ -307,15 +312,20 @@ public function serviceGetTimelinePostHashtag($aEvent, $aBrowseParams = array())
{
if(empty($aEvent) || !is_array($aEvent))
return false;

$aEventContent = $this->_oDb->getContentById($aEvent['object_id']);
if(empty($aEventContent) || !is_array($aEventContent))
return false;

$sModule = $aEventContent['module_name'];
if(!BxDolRequest::serviceExists($sModule, 'get_timeline_post'))
$sClass = 'Module';
if($sModule == 'sys_cmts'){
$sClass = 'TemplCmtsServices';
$sModule = 'system';
}

if(!BxDolRequest::serviceExists($sModule, 'get_timeline_post', $sClass))
return false;

/**
* Prepare fake event array (only mandatory parameters) to get
* necessary data (related to an 'original' event with hashtag/label)
Expand All @@ -331,16 +341,15 @@ public function serviceGetTimelinePostHashtag($aEvent, $aBrowseParams = array())
if(is_numeric($mixedAllowViewTo) && (int)$mixedAllowViewTo < 0)
$iOwnerId = abs($mixedAllowViewTo);
}

$aResult = BxDolService::call($sModule, 'get_timeline_post', array(array(
'owner_id' => $iOwnerId,
'object_id' => $iContentId,
'object_privacy_view' => $mixedObjectPrivacyView
), $aBrowseParams));
), $aBrowseParams), $sClass);

if(empty($aResult) || !is_array($aResult))
return $aResult;

/**
* Note. The context shouldn't be changed therefore
* use input event's context (owner_id) in returned results.
Expand Down
13 changes: 8 additions & 5 deletions modules/boonex/channels/install/langs/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
<string name="_bx_channels_acl_action_view_profile"><![CDATA[View Channel]]></string>
<string name="_bx_channels_acl_action_edit_any_profile"><![CDATA[Edit Any Channel]]></string>
<string name="_bx_channels_acl_action_create_channel_auto"><![CDATA[Create Channel Auto]]></string>

<string name="_bx_channels_page_title_sys_edit_profile"><![CDATA[Edit Channel]]></string>
<string name="_bx_channels_acl_action_create_channel_auto_info"><![CDATA[Automatically create new channel when new hashtag is mentioned by anyone with this level]]></string>

<string name="_bx_channels_page_title_sys_edit_profile"><![CDATA[Edit Channel]]></string>
<string name="_bx_channels_page_title_edit_profile"><![CDATA[Edit Channel]]></string>
<string name="_bx_channels_page_title_sys_edit_profile_cover"><![CDATA[Edit Channel Cover]]></string>
<string name="_bx_channels_page_title_edit_profile_cover"><![CDATA[Edit Cover]]></string>
Expand Down Expand Up @@ -76,10 +77,12 @@
<string name="_bx_channels_page_title_entries_search"><![CDATA[Search]]></string>
<string name="_bx_channels_page_title_sys_entries_toplevel"><![CDATA[Top level]]></string>
<string name="_bx_channels_page_title_entries_toplevel"><![CDATA[Top level]]></string>
<string name="_bx_channels_page_title_sys_entries_of_author"><![CDATA[Сhannels of author]]></string>
<string name="_bx_channels_page_title_entries_of_author"><![CDATA[Сhannels by {display_name}]]></string>
<string name="_bx_channels_page_title_sys_entries_of_author"><![CDATA[Сhannels of author]]></string>
<string name="_bx_channels_page_title_entries_of_author"><![CDATA[Сhannels by {display_name}]]></string>

<string name="_bx_channels_page_block_title_sys_entries_actions"><![CDATA[Channels actions]]></string>
<string name="_bx_channels_page_block_title_system_profile_subscribed_me"><![CDATA[Followers]]></string>
<string name="_bx_channels_page_block_title_profile_subscribed_me"><![CDATA[Followers]]></string>
<string name="_bx_channels_page_block_title_sys_entries_actions"><![CDATA[Channels actions]]></string>
<string name="_bx_channels_page_block_title_entries_actions"><![CDATA[Channels actions]]></string>
<string name="_bx_channels_page_block_title_sys_entries_of_author"><![CDATA[Followed Сhannels]]></string>
<string name="_bx_channels_page_block_title_entries_of_author"><![CDATA[Followed Сhannels]]></string>
Expand Down
6 changes: 4 additions & 2 deletions modules/boonex/channels/install/sql/enable.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
('bx_channels_view_profile', 2, 'bx_channels', '', '_bx_channels_page_block_title_entry_parent', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_channels";s:6:"method";s:13:"entity_parent";}', 0, 0, 1, 1),
('bx_channels_view_profile', 3, 'bx_channels', '', '_bx_channels_page_block_title_entry_childs', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_channels";s:6:"method";s:13:"entity_childs";}', 0, 0, 1, 1),
('bx_channels_view_profile', 4, 'bx_channels', '', '_bx_channels_page_block_title_search_results_by_hashtag', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_channels\";s:6:\"method\";s:24:\"search_result_by_hashtag\";}', 0, 0, 0, 0),
('bx_channels_view_profile', 4, 'bx_channels', '', '_bx_channels_page_block_title_profile_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_channels\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 0, 1);
('bx_channels_view_profile', 4, 'bx_channels', '', '_bx_channels_page_block_title_profile_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_channels\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 0, 1),
('bx_channels_view_profile', 4, 'bx_channels', '', '_bx_channels_page_block_title_profile_subscribed_me', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:11:\"bx_channels\";s:6:\"method\";s:21:\"profile_subscribed_me\";}', 0, 1, 1, 0);

-- PAGE: view closed profile

Expand Down Expand Up @@ -285,7 +286,8 @@ INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`,
SET @iIdActionProfileEditAny = LAST_INSERT_ID();

INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_channels', 'create channel auto', NULL, '_bx_channels_acl_action_create_channel_auto', '', 1, 1);
('bx_channels', 'create channel auto', NULL, '_bx_channels_acl_action_create_channel_auto', '_bx_channels_acl_action_create_channel_auto_info', 1, 1);

SET @iIdActionCreateChannelAuto = LAST_INSERT_ID();

SET @iUnauthenticated = 1;
Expand Down
3 changes: 3 additions & 0 deletions modules/boonex/russian/data/langs/bx_channels/ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<string name="_bx_channels_acl_action_view_profile"><![CDATA[Просмотреть канал]]></string>
<string name="_bx_channels_acl_action_edit_any_profile"><![CDATA[Редактировать любой канал]]></string>
<string name="_bx_channels_acl_action_create_channel_auto"><![CDATA[Создавать канал автоматически]]></string>
<string name="_bx_channels_acl_action_create_channel_auto_info"><![CDATA[Автоматически создавать новый канал, когда новый хэштег упоминается кем-либо с этим уровнем]]></string>

<string name="_bx_channels_page_title_sys_edit_profile"><![CDATA[Редактировать канал]]></string>
<string name="_bx_channels_page_title_edit_profile"><![CDATA[Редактировать канал]]></string>
Expand Down Expand Up @@ -79,6 +80,8 @@
<string name="_bx_channels_page_title_entries_toplevel"><![CDATA[Верхний уровень]]></string>
<string name="_bx_channels_page_title_entries_of_author"><![CDATA[{display_name} - Каналы]]></string>

<string name="_bx_channels_page_block_title_system_profile_subscribed_me"><![CDATA[Подписчики]]></string>
<string name="_bx_channels_page_block_title_profile_subscribed_me"><![CDATA[Подписчики]]></string>
<string name="_bx_channels_page_block_title_sys_entries_actions"><![CDATA[Каналы - Действия]]></string>
<string name="_bx_channels_page_block_title_entries_actions"><![CDATA[Каналы - Действия]]></string>
<string name="_bx_channels_page_block_title_sys_entries_of_author"><![CDATA[Просматриваемые каналы]]></string>
Expand Down

0 comments on commit 3f6818a

Please sign in to comment.