فهرست منبع

Ticket #5164 - Notifications: Improve layout and content for different use cases. Point 2.

AntonLV 1 سال پیش
والد
کامیت
5393b882f5

+ 10 - 0
inc/classes/BxDolCmts.php

@@ -459,6 +459,11 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
         return $this->_aSystem;
     }
 
+    public function getModule()
+    {
+        return $this->_aSystem['module'];
+    }
+
     public function getStorageObjectName()
     {
     	return $this->_getFormObject()->getStorageObjectName();
@@ -589,6 +594,11 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
         return ($bWithHash ? '#' : '') . sprintf($this->_sItemAnchorApi, $iItemId);
     }
 
+    public function geModalViewApi()
+    {
+        return 'default';
+    }
+
     public function getAttachments($iCmtId)
     {
         $aResult = array();

+ 6 - 1
modules/boonex/timeline/classes/BxTimelineCmts.php

@@ -23,7 +23,12 @@ class BxTimelineCmts extends BxTemplCmts
 
         $this->_aSystem['trigger_field_privacy_view'] = 'object_privacy_view';
     }
-    
+
+    public function geModalViewApi()
+    {
+        return $this->_sModule;
+    }
+
     public function onPostAfter($iCmtId, $aDp = [])
     {
         $CNF = &$this->_oModule->_oConfig->CNF;

+ 7 - 1
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -2591,7 +2591,8 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             'entry_caption' => $sEntryCaption,
             'entry_summary' => $sEntrySummary,
             'entry_author' => $iEntryAuthor,
-            'lang_key' => '' //may be empty or not specified. In this case the default one from Notification module will be used.
+            'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+            'modal_view' => $this->getName()            
         ];
     }
 
@@ -2642,6 +2643,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             'subentry_url_api' => $oComment->getItemUrlApi($iCommentId, '{bx_url_root}'),
             'subentry_summary' => $oComment->getViewText($iCommentId),
             'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+            'modal_view' => $this->getName()
         ];
     }
 
@@ -2693,6 +2695,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             'subentry_url_api' => $oComment->getItemUrlApi($iCommentId, '{bx_url_root}'),
             'subentry_summary' => $oComment->getViewText($iCommentId),
             'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+            'modal_view' => $this->getName()
         ];
     }
 
@@ -2738,6 +2741,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             'entry_author' => $aContent['owner_id'],
             'subentry_sample' => $CNF['T']['txt_sample_vote_single'],
             'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+            'modal_view' => $this->getName()
         ];
     }
 
@@ -2780,6 +2784,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             'subentry_sample' => $CNF['T']['txt_sample_reaction_single'],
             'subentry_sample_params' => $aSubentrySampleParams,
             'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+            'modal_view' => $this->getName()
         ];
     }
 
@@ -2854,6 +2859,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             'entry_author' => $aContent['owner_id'],
             'subentry_sample' => $CNF['T']['txt_sample_score_' . $sType . '_single'],
             'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+            'modal_view' => $this->getName()
         ];
     }
 

+ 3 - 0
template/scripts/BxBaseServiceMetatags.php

@@ -113,6 +113,7 @@ class BxBaseServiceMetatags extends BxDol
         if(!$oProfile)
             return [];
 
+        $sModalView = 'default';
         $sEntryUrl = $sEntryUrlApi = '';
         if (isset($aEvent['content']['module']) && isset($aEvent['content']['content_id'])) {
             if ('sys_cmts' == $aEvent['content']['module']) {
@@ -121,6 +122,7 @@ class BxBaseServiceMetatags extends BxDol
                 if ($oCmts && $aCmt) {
                     $sEntryUrl = $oCmts->getItemUrl($aCmt['cmt_id'], '{bx_url_root}');
                     $sEntryUrlApi = $oCmts->getItemUrlApi($aCmt['cmt_id'], '{bx_url_root}');
+                    $sModalView = $oCmts->geModalViewApi();
                 }
             }
             elseif (BxDolRequest::serviceExists($aEvent['content']['module'], 'get_link'))
@@ -137,6 +139,7 @@ class BxBaseServiceMetatags extends BxDol
             'entry_caption' => $oProfile->getDisplayName(),
             'entry_author' => $iProfile,
             'lang_key' => '_sys_metatags_mention_added',
+            'modal_view' => $sModalView
         ];
     }
 }