AntonLV 7 rokov pred
rodič
commit
bfd4764a00

+ 22 - 9
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -725,6 +725,19 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
         return $a;
         return $a;
     }
     }
 
 
+    public function serviceGetNotificationsPost($aEvent)
+    {
+        $aResult = parent::serviceGetNotificationsVote($aEvent);
+        if(empty($aResult) || !is_array($aResult) || !$this->serviceActAsProfile())
+            return $aResult;
+
+        $oProfile = BxDolProfile::getInstanceByContentAndType((int)$aEvent['object_id'], $this->_oConfig->getName());
+        if($oProfile !== false)
+            $aResult['entry_author'] = $oProfile->id();
+
+        return $aResult;
+    }
+
     public function serviceGetNotificationsVote($aEvent)
     public function serviceGetNotificationsVote($aEvent)
     {
     {
         $aResult = parent::serviceGetNotificationsVote($aEvent);
         $aResult = parent::serviceGetNotificationsVote($aEvent);
@@ -763,15 +776,15 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
         if(empty($sSubentrySample))
         if(empty($sSubentrySample))
             $sSubentrySample = strmaxtextlen($aSubcontentInfo['description'], 20, '...');
             $sSubentrySample = strmaxtextlen($aSubcontentInfo['description'], 20, '...');
 
 
-		return array(
-			'entry_sample' => $CNF['T']['txt_sample_single'],
-			'entry_url' => $oGroupProfile->getUrl(),
-			'entry_caption' => $oGroupProfile->getDisplayName(),
-			'entry_author' => $oGroupProfile->id(),
-			'subentry_sample' => $sSubentrySample,
-			'subentry_url' => $sSubentryUrl,
-			'lang_key' => $CNF['T']['txt_ntfs_timeline_post_common'],
-		);
+        return array(
+            'entry_sample' => $CNF['T']['txt_sample_single'],
+            'entry_url' => $oGroupProfile->getUrl(),
+            'entry_caption' => $oGroupProfile->getDisplayName(),
+            'entry_author' => $oGroupProfile->id(),
+            'subentry_sample' => $sSubentrySample,
+            'subentry_url' => $sSubentryUrl,
+            'lang_key' => $CNF['T']['txt_ntfs_timeline_post_common'],
+        );
     }
     }
 
 
 	/**
 	/**

+ 27 - 20
modules/boonex/channels/classes/BxCnlModule.php

@@ -181,27 +181,34 @@ class BxCnlModule extends BxBaseModGroupsModule
 
 
     public function serviceGetNotificationsPostHashtag($aEvent)
     public function serviceGetNotificationsPostHashtag($aEvent)
     {
     {
-         if(empty($aEvent) || !is_array($aEvent))
+        if(empty($aEvent) || !is_array($aEvent))
+            return '';
+
+        $aContentEvent = $this->_oDb->getContentById($aEvent['subobject_id']);
+        if(empty($aContentEvent) || !is_array($aContentEvent))
             return '';
             return '';
-         
-         $aContentEvent = $this->_oDb->getContentById($aEvent['subobject_id']);
-         if(empty($aContentEvent) || !is_array($aContentEvent))
-             return '';
-         
-         $oModule = BxDolModule::getInstance($aContentEvent['module_name']);
-         if ($oModule){
-             if (isset($oModule->_oConfig->CNF['OBJECT_PRIVACY_VIEW'])){
-                 $oPrivacy = BxDolPrivacy::getObjectInstance($oModule->_oConfig->CNF['OBJECT_PRIVACY_VIEW']);
-                 if (!$oPrivacy->check($aContentEvent['content_id']))
-                     return '';
-             }
-             $aRv = $oModule->serviceGetNotificationsPost(array('object_id' => $aContentEvent['content_id']));
-             $aRv['lang_key'] = '_bx_channels_ntfs_txt_subobject_added';
-             $aRv['channel_url'] = $this->serviceGetLink($aContentEvent['cnl_id']);
-             return $aRv;
-         }
-         
-         return '';
+
+        $oModule = BxDolModule::getInstance($aContentEvent['module_name']);
+        if ($oModule) {
+            if (isset($oModule->_oConfig->CNF['OBJECT_PRIVACY_VIEW'])){
+                $oPrivacy = BxDolPrivacy::getObjectInstance($oModule->_oConfig->CNF['OBJECT_PRIVACY_VIEW']);
+                if (!$oPrivacy->check($aContentEvent['content_id']))
+                    return '';
+            }
+
+            $aRv = $oModule->serviceGetNotificationsPost(array(
+                'object_id' => $aContentEvent['content_id']
+            ));
+
+            $aRv['lang_key'] = '_bx_channels_ntfs_txt_subobject_added';
+            if(method_exists($oModule, 'serviceActAsProfile') && $oModule->serviceActAsProfile())
+                $aRv['lang_key'] = '_bx_channels_ntfs_txt_subobject_added_profile';
+
+            $aRv['entry_url'] = $this->serviceGetLink($aContentEvent['cnl_id']);
+            return $aRv;
+        }
+
+        return '';
     }
     }
     
     
     public function serviceBrowseAuthor($iProfileId = 0, $aParams = array())
     public function serviceBrowseAuthor($iProfileId = 0, $aParams = array())

+ 5 - 4
modules/boonex/channels/install/langs/en.xml

@@ -221,8 +221,9 @@
 	<string name="_bx_channels_txt_sample_comment_single"><![CDATA[comment to channel]]></string>
 	<string name="_bx_channels_txt_sample_comment_single"><![CDATA[comment to channel]]></string>
 	<string name="_bx_channels_txt_sample_vote_single"><![CDATA[vote to channel]]></string>
 	<string name="_bx_channels_txt_sample_vote_single"><![CDATA[vote to channel]]></string>
 
 
-  <string name="_bx_channels_txt_ntfs_timeline_post_common"><![CDATA[New post <b class="bx-ntfs-content-entry">{subentry_sample}</b> in <b class="bx-ntfs-content-profile">{owner_name}</b> channel timeline]]></string>
-  <string name="_bx_channels_ntfs_txt_subobject_added"><![CDATA[New content <b class="bx-ntfs-content-entry">{entry_caption}</b> in <b class="bx-ntfs-content-profile">{owner_name}</b> channel]]></string>
-  <string name="_bx_channels_alert_action_hashtag_added"><![CDATA[New hashtags]]></string>
-  <string name="_bx_channels_alert_action_hashtag_added_notif_follow_context"><![CDATA[New hashtags]]></string>
+    <string name="_bx_channels_txt_ntfs_timeline_post_common"><![CDATA[New post <b class="bx-ntfs-content-entry">{subentry_sample}</b> in <b class="bx-ntfs-content-profile">{owner_name}</b> channel timeline]]></string>
+    <string name="_bx_channels_ntfs_txt_subobject_added"><![CDATA[New content <b class="bx-ntfs-content-entry">{entry_caption}</b> in <b class="bx-ntfs-content-profile">{owner_name}</b> channel]]></string>
+    <string name="_bx_channels_ntfs_txt_subobject_added_profile"><![CDATA[<b class="bx-ntfs-content-entry">{entry_caption}</b> was added to <b class="bx-ntfs-content-profile">{owner_name}</b> channel]]></string>
+    <string name="_bx_channels_alert_action_hashtag_added"><![CDATA[New hashtags]]></string>
+    <string name="_bx_channels_alert_action_hashtag_added_notif_follow_context"><![CDATA[New hashtags]]></string>
 </resources>
 </resources>

+ 1 - 0
modules/boonex/russian/data/langs/bx_channels/ru.xml

@@ -222,6 +222,7 @@
 	
 	
     <string name="_bx_channels_txt_ntfs_timeline_post_common"><![CDATA[В канале <b class="bx-ntfs-content-profile">{owner_name}</b> новая публикация <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
     <string name="_bx_channels_txt_ntfs_timeline_post_common"><![CDATA[В канале <b class="bx-ntfs-content-profile">{owner_name}</b> новая публикация <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
     <string name="_bx_channels_ntfs_txt_subobject_added"><![CDATA[В канале <b class="bx-ntfs-content-profile">{owner_name}</b> новая публикация <b class="bx-ntfs-content-entry">{entry_caption}</b>]]></string>
     <string name="_bx_channels_ntfs_txt_subobject_added"><![CDATA[В канале <b class="bx-ntfs-content-profile">{owner_name}</b> новая публикация <b class="bx-ntfs-content-entry">{entry_caption}</b>]]></string>
+    <string name="_bx_channels_ntfs_txt_subobject_added_profile"><![CDATA[<b class="bx-ntfs-content-entry">{entry_caption}</b> был добавлен в <b class="bx-ntfs-content-profile">{owner_name}</b> канал]]></string>
     <string name="_bx_channels_alert_action_hashtag_added"><![CDATA[Новые хештеги]]></string>
     <string name="_bx_channels_alert_action_hashtag_added"><![CDATA[Новые хештеги]]></string>
     <string name="_bx_channels_alert_action_hashtag_added_notif_follow_context"><![CDATA[Новые хештеги]]></string>
     <string name="_bx_channels_alert_action_hashtag_added_notif_follow_context"><![CDATA[Новые хештеги]]></string>
 </resources>
 </resources>

+ 1 - 1
template/account_unit_wo_info.html

@@ -1,4 +1,4 @@
-<div class="bx-account-unit-wo-info bx-def-thumb-size">
+<div class="bx-account-unit-wo-info bx-def-thumb-size bx-def-font-align-center">
     <div class="bx-def-unit-img bx-def-thumb-size">
     <div class="bx-def-unit-img bx-def-thumb-size">
         <a class="bx-def-font-align-center" href="__content_url__">
         <a class="bx-def-font-align-center" href="__content_url__">
             <p class="bx-account-unit-thumb bx-def-thumb bx-def-thumb-size bx-def-border bx-def-box-sizing" style="background-color:rgba(__color__)">__letter__</p>
             <p class="bx-account-unit-thumb bx-def-thumb bx-def-thumb-size bx-def-border bx-def-box-sizing" style="background-color:rgba(__color__)">__letter__</p>

+ 1 - 1
template/account_unit_wo_info_links.html

@@ -1,4 +1,4 @@
-<div class="bx-account-unit-wo-info bx-def-thumb-size">
+<div class="bx-account-unit-wo-info bx-def-thumb-size bx-def-font-align-center">
     <div class="bx-def-unit-img bx-def-thumb-size">
     <div class="bx-def-unit-img bx-def-thumb-size">
         <p class="bx-account-unit-thumb bx-def-thumb bx-def-thumb-size bx-def-border bx-def-box-sizing" style="background-color:rgba(__color__)">__letter__</p>
         <p class="bx-account-unit-thumb bx-def-thumb bx-def-thumb-size bx-def-border bx-def-box-sizing" style="background-color:rgba(__color__)">__letter__</p>
         <bx_if:show_online>
         <bx_if:show_online>