Ver Fonte

Ticket #4011 - Notifications: Don't store absolute URL in compiled notification content.

AntonLV há 4 anos atrás
pai
commit
ed55a70217

+ 4 - 4
inc/classes/BxDolCmts.php

@@ -243,7 +243,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
         if(!empty($mixedUserBpFilter))
             $this->_sBrowseFilter = $mixedUserBpFilter;
 
-        $this->_sViewUrl = BX_DOL_URL_ROOT . 'page.php?i=cmts-view';
+        $this->_sViewUrl = 'page.php?i=cmts-view';
         $this->_sBaseUrl = $this->_aSystem['base_url'];
 
         $this->_sListAnchor = "cmts-anchor-%s-%d";
@@ -458,16 +458,16 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
         return $this->isEditAllowedAll() || $this->isRemoveAllowedAll() || $this->isAutoApprove() ? BX_CMT_STATUS_ACTIVE : BX_CMT_STATUS_PENDING;
     }
 
-    public function getViewUrl($iCmtId)
+    public function getViewUrl($iCmtId, $bAbsolute = true)
     {
     	if(empty($this->_aSystem['trigger_field_title']))
             return '';
 
-    	return BxDolPermalinks::getInstance()->permalink($this->_sViewUrl, array(
+    	return ($bAbsolute ? BX_DOL_URL_ROOT : '') . BxDolPermalinks::getInstance()->permalink($this->_sViewUrl, [
             'sys' => $this->_sSystem,
             'id' => $this->_iId,
             'cmt_id' => $iCmtId
-        ));
+        ]);
     }
 
     public function getViewText($mixedItem)

+ 17 - 17
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -1865,7 +1865,7 @@ class BxBaseModGeneralModule extends BxDolModule
         if(empty($aContentInfo) || !is_array($aContentInfo))
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
         $sEntryCaption = isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...');
 
         return array(
@@ -1938,7 +1938,7 @@ class BxBaseModGeneralModule extends BxDolModule
         if(!$oComment || !$oComment->isEnabled())
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
         $sEntryCaption = isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...');
 
         return array(
@@ -1947,7 +1947,7 @@ class BxBaseModGeneralModule extends BxDolModule
             'entry_caption' => $sEntryCaption,
             'entry_author' => $aContentInfo[$CNF['FIELD_AUTHOR']],
             'subentry_sample' => $CNF['T']['txt_sample_comment_single'],
-            'subentry_url' => $oComment->getViewUrl((int)$aEvent['subobject_id']),
+            'subentry_url' => '{bx_url_root}' . $oComment->getViewUrl((int)$aEvent['subobject_id'], false),
             'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
         );
     }
@@ -1969,18 +1969,18 @@ class BxBaseModGeneralModule extends BxDolModule
             return array();
 
         $iObjectId = (int)$aParentInfo['cmt_object_id'];
-		$oComment->init($iObjectId);
+            $oComment->init($iObjectId);
 
-		return array(
-		    'object_id' => $iObjectId,
-			'entry_sample' => '_cmt_txt_sample_comment_single',
-			'entry_url' => $oComment->getViewUrl($iParentId),
-			'entry_caption' => strmaxtextlen($aParentInfo['cmt_text'], 20, '...'),
-			'entry_author' => (int)$aParentInfo['cmt_author_id'],
-			'subentry_sample' => '_cmt_txt_sample_reply_to',
-			'subentry_url' => $oComment->getViewUrl((int)$aEvent['subobject_id']),
-			'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
-		);
+        return array(
+            'object_id' => $iObjectId,
+            'entry_sample' => '_cmt_txt_sample_comment_single',
+            'entry_url' => '{bx_url_root}' . $oComment->getViewUrl($iParentId, false),
+            'entry_caption' => strmaxtextlen($aParentInfo['cmt_text'], 20, '...'),
+            'entry_author' => (int)$aParentInfo['cmt_author_id'],
+            'subentry_sample' => '_cmt_txt_sample_reply_to',
+            'subentry_url' => '{bx_url_root}' . $oComment->getViewUrl((int)$aEvent['subobject_id'], false),
+            'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+        );
     }
 
 	/**
@@ -1999,7 +1999,7 @@ class BxBaseModGeneralModule extends BxDolModule
         if(!$oVote || !$oVote->isEnabled())
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
         $sEntryCaption = isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...');
 
         return array(
@@ -2039,7 +2039,7 @@ class BxBaseModGeneralModule extends BxDolModule
         else
             $aSubentrySampleParams[] = '_undefined';
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
         $sEntryCaption = isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...');
 
         return array(
@@ -2082,7 +2082,7 @@ class BxBaseModGeneralModule extends BxDolModule
         if(!$oScore || !$oScore->isEnabled())
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
         $sEntryCaption = isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...');
 
         return array(

+ 9 - 8
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -1113,7 +1113,7 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
          * should be linked to Group Profile (Group Profile -> Members tab) 
          * instead of Personal Profile of invited member.
          */
-        $sEntryUrl = $oGroupProfile->getUrl();
+        $sEntryUrl = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oGroupProfile->getUrl());
 
         return array(
             'entry_sample' => $CNF['T']['txt_sample_single'],
@@ -1164,13 +1164,14 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
          * should be linked to Group Profile (Group Profile -> Members tab) 
          * instead of Personal Profile of a member, who performed an action.
          */
-        $sEntryUrl = $oGroupProfile->getUrl();
-        if(!empty($CNF['URL_ENTRY_FANS']))
-            $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_ENTRY_FANS'], array(
+        if(empty($CNF['URL_ENTRY_FANS']))
+            $sEntryUrl = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oGroupProfile->getUrl());
+        else
+            $sEntryUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_ENTRY_FANS'], [
                 'profile_id' => $oGroupProfile->id()
-            ));
+            ]);
 
-        return array(
+        return [
             'entry_sample' => $CNF['T']['txt_sample_single'],
             'entry_url' => $sEntryUrl,
             'entry_caption' => $oGroupProfile->getDisplayName(),
@@ -1178,7 +1179,7 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
             'subentry_sample' => $oProfile->getDisplayName(),
             'subentry_url' => $sEntryUrl,
             'lang_key' => $sLangKey
-        );
+        ];
     }
 
     /**
@@ -1201,7 +1202,7 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
             return false;
 
         $oGroupProfile = BxDolProfile::getInstanceByContentAndType($aEvent['object_id'], $this->getName());
-        $a['content']['url'] = $oGroupProfile->getUrl();
+        $a['content']['url'] = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oGroupProfile->getUrl());
         $a['content']['title'] = $oGroupProfile->getDisplayName();
 
         if(isset($CNF['FIELD_PUBLISHED'])) {

+ 2 - 2
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -1212,14 +1212,14 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
         if(empty($aSubcontentInfo) || !is_array($aSubcontentInfo))
             return array();
 
-        $sSubentryUrl = BxDolService::call('bx_timeline', 'get_link', array((int)$aEvent['subobject_id']));
+        $sSubentryUrl = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', BxDolService::call('bx_timeline', 'get_link', array((int)$aEvent['subobject_id'])));
         $sSubentrySample = $aSubcontentInfo['title'];
         if(empty($sSubentrySample))
             $sSubentrySample = strmaxtextlen($aSubcontentInfo['description'], 20, '...');
 
         return array(
             'entry_sample' => $CNF['T']['txt_sample_single'],
-            'entry_url' => $oGroupProfile->getUrl(),
+            'entry_url' => str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oGroupProfile->getUrl()),
             'entry_caption' => $oGroupProfile->getDisplayName(),
             'entry_author' => $oGroupProfile->id(),
             'subentry_sample' => $sSubentrySample,

+ 3 - 3
modules/boonex/ads/classes/BxAdsModule.php

@@ -676,7 +676,7 @@ class BxAdsModule extends BxBaseModTextModule
         if(empty($aInterestedInfo) || !is_array($aInterestedInfo))
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
 
         return array(
             'entry_sample' => $CNF['T']['txt_sample_single'],
@@ -742,7 +742,7 @@ class BxAdsModule extends BxBaseModTextModule
         if(empty($aContentInfo) || !is_array($aContentInfo))
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
 
         return array(
             'entry_sample' => $CNF['T']['txt_sample_single'],
@@ -769,7 +769,7 @@ class BxAdsModule extends BxBaseModTextModule
         if(empty($aContentInfo) || !is_array($aContentInfo))
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
 
         return array(
             'object_id' => $iContentId,

+ 6 - 6
modules/boonex/albums/classes/BxAlbumsModule.php

@@ -625,8 +625,8 @@ class BxAlbumsModule extends BxBaseModTextModule
             return array();
 
         $oPermalinks = BxDolPermalinks::getInstance();
-        $sEntryUrl = BX_DOL_URL_ROOT . $oPermalinks->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
-        $sSubentryUrl = BX_DOL_URL_ROOT . $oPermalinks->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $iMediaId);
+        $sEntryUrl = '{bx_url_root}' . $oPermalinks->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
+        $sSubentryUrl = '{bx_url_root}' . $oPermalinks->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $iMediaId);
         $sEntryCaption = isset($aMediaInfo['title']) ? $aMediaInfo['title'] : _t('_bx_albums_media');
 
         return array(
@@ -653,7 +653,7 @@ class BxAlbumsModule extends BxBaseModTextModule
         if(!$oComment || !$oComment->isEnabled())
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $aMediaInfo['id']);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $aMediaInfo['id']);
         $sEntryCaption = isset($aMediaInfo['title']) ? $aMediaInfo['title'] : _t('_bx_albums_media');
 
         return array(
@@ -662,7 +662,7 @@ class BxAlbumsModule extends BxBaseModTextModule
             'entry_caption' => $sEntryCaption,
             'entry_author' => $aMediaInfo['author'],
             'subentry_sample' => $CNF['T']['txt_media_comment_single'],
-            'subentry_url' => $oComment->getViewUrl((int)$aEvent['subobject_id']),
+            'subentry_url' => '{bx_url_root}' . $oComment->getViewUrl((int)$aEvent['subobject_id'], false),
             'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
         );
     }
@@ -680,7 +680,7 @@ class BxAlbumsModule extends BxBaseModTextModule
         if(!$oVote || !$oVote->isEnabled())
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $aMediaInfo['id']);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $aMediaInfo['id']);
         $sEntryCaption = isset($aMediaInfo['title']) ? $aMediaInfo['title'] : _t('_bx_albums_media');
 
         return array(
@@ -717,7 +717,7 @@ class BxAlbumsModule extends BxBaseModTextModule
         if(!$oVote || !$oVote->isEnabled())
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $aMediaInfo['id']);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $aMediaInfo['id']);
         $sEntryCaption = isset($aMediaInfo['title']) ? $aMediaInfo['title'] : _t('_bx_albums_media');
 
         return array(

+ 1 - 1
modules/boonex/channels/classes/BxCnlModule.php

@@ -402,7 +402,7 @@ class BxCnlModule extends BxBaseModGroupsModule
             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']);
+            $aRv['entry_url'] = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $this->serviceGetLink($aContentEvent['cnl_id']));
             return $aRv;
         }
 

+ 2 - 2
modules/boonex/feedback/classes/BxFdbModule.php

@@ -245,7 +245,7 @@ class BxFdbModule extends BxBaseModGeneralModule
         if(empty($aQuestion) || !is_array($aQuestion) || $aQuestion[$CNF['FIELD_STATUS_ADMIN']] != 'active')
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT;
+        $sEntryUrl = '{bx_url_root}';
         $sEntryCaption = strmaxtextlen($aQuestion[$CNF['FIELD_TEXT']], 20, '...');
 
         return array(
@@ -276,7 +276,7 @@ class BxFdbModule extends BxBaseModGeneralModule
         if($this->_oConfig->isModeNio() && (int)$aAnswer[$CNF['FIELD_ANS_IMPORTANT']] == 0)
             return array();
 
-        $sEntryUrl = BX_DOL_URL_ROOT;
+        $sEntryUrl = '{bx_url_root}';
         $sEntryCaption = strmaxtextlen($aQuestion[$CNF['FIELD_TEXT']], 20, '...');
 
         return array(

+ 17 - 18
modules/boonex/invites/classes/BxInvModule.php

@@ -325,8 +325,8 @@ class BxInvModule extends BxDolModule
     	$sModule = $this->_aModule['name'];
 
     	$sEventPrivacy = $sModule . '_allow_view_event_to';
-		if(BxDolPrivacy::getObjectInstance($sEventPrivacy) === false)
-			$sEventPrivacy = '';
+        if(BxDolPrivacy::getObjectInstance($sEventPrivacy) === false)
+            $sEventPrivacy = '';
 
         return array(
             'handlers' => array(
@@ -347,26 +347,25 @@ class BxInvModule extends BxDolModule
     public function serviceGetNotificationsRequest($aEvent)
     {  
         if (getParam('bx_invites_requests_notifications') != 'on')
-             return array();
-        
+            return [];
+
         $aRequest = $this->_oDb->getRequests(array('type' => 'by_id', 'value' => $aEvent['object_id']));
         if (!$aRequest)
-            return array();
-           
+            return [];
+
         $CNF = &$this->_oConfig->CNF;
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_REQUESTS']);
-            
-		return array(
-			'entry_sample' => $aRequest['name'] . '(' . $aRequest['email'] . ')',
-			'entry_url' => $sEntryUrl,
-			'entry_caption' => $aRequest['text'],
-			'entry_author' => '',
-			'entry_privacy' => '', //may be empty or not specified. In this case Public privacy will be used.
-			'lang_key' => '_bx_invites_alert_action_request', //may be empty or not specified. In this case the default one from Notification module will be used.
-		);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink($CNF['URL_REQUESTS']);
+
+        return [
+            'entry_sample' => $aRequest['name'] . '(' . $aRequest['email'] . ')',
+            'entry_url' => $sEntryUrl,
+            'entry_caption' => $aRequest['text'],
+            'entry_author' => '',
+            'entry_privacy' => '', //may be empty or not specified. In this case Public privacy will be used.
+            'lang_key' => '_bx_invites_alert_action_request', //may be empty or not specified. In this case the default one from Notification module will be used.
+        ];
     }
-    
-    
+
     public function attachAccountIdToInvite($iAccountId, $sKey)
     {
         $this->_oDb->attachAccountIdToInvite($iAccountId, $sKey);

+ 7 - 1
modules/boonex/notifications/classes/BxNtfsTemplate.php

@@ -407,7 +407,13 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
 
     protected function _getContentLink(&$aEvent)
     {
-        return !empty($aEvent['subobject_id']) && !empty($aEvent['content']['subentry_url']) ? $aEvent['content']['subentry_url'] : $aEvent['content']['entry_url'];
+        $sLink = $aEvent['content']['entry_url'];
+        if(!empty($aEvent['subobject_id']) && !empty($aEvent['content']['subentry_url'])) 
+            $sLink = $aEvent['content']['subentry_url'];
+
+        return bx_replace_markers($sLink, [
+            'bx_url_root' => BX_DOL_URL_ROOT
+        ]);
     }
 
     protected function _isInContext(&$aEvent)

+ 1 - 1
modules/boonex/reminders/classes/BxRemindersModule.php

@@ -87,7 +87,7 @@ class BxRemindersModule extends BxBaseModGeneralModule
 
         $aReturn = array(
             'entry_sample' => $CNF['T']['txt_sample_single'],
-            'entry_url' => $this->getEntryUrl($aEntry),
+            'entry_url' => str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $this->getEntryUrl($aEntry)),
             'lang_key' => $aEntry[$CNF['FIELD_TEXT']]
         );
 

+ 6 - 6
modules/boonex/timeline/classes/BxTimelineConfig.php

@@ -794,21 +794,21 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         return $this->CNF['T']['txt_sample_with_' . $sResult];
     }
 
-    public function getViewUrl($iOwnerId)
+    public function getViewUrl($iOwnerId, $bAbsolute = true)
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->CNF['URI_VIEW_LIST'], [
+        return ($bAbsolute ? BX_DOL_URL_ROOT : '') . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->CNF['URI_VIEW_LIST'], [
             'id' => $iOwnerId
         ]);
     }
 
-    public function getHomeViewUrl()
+    public function getHomeViewUrl($bAbsolute = true)
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->CNF['URL_HOME']);
+        return ($bAbsolute ? BX_DOL_URL_ROOT : '') . BxDolPermalinks::getInstance()->permalink($this->CNF['URL_HOME']);
     }
 
-    public function getItemViewUrl($aEvent)
+    public function getItemViewUrl($aEvent, $bAbsolute = true)
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->CNF['URI_VIEW_ENTRY'], [
+        return ($bAbsolute ? BX_DOL_URL_ROOT : '') . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->CNF['URI_VIEW_ENTRY'], [
             'id' => $aEvent['id']
         ]);
     }

+ 8 - 8
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -2236,7 +2236,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
 
         return array(
             'entry_sample' => $CNF['T']['txt_sample_single_ext'],
-            'entry_url' => $this->_oConfig->getItemViewUrl($aContent),
+            'entry_url' => '{bx_url_root}' . $this->_oConfig->getItemViewUrl($aContent, false),
             'entry_caption' => $sEntryCaption,
             'entry_author' => $iEntryAuthor,
             'lang_key' => '' //may be empty or not specified. In this case the default one from Notification module will be used.
@@ -2278,11 +2278,11 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
 
         return array(
             'entry_sample' => $CNF['T']['txt_sample_single'],
-            'entry_url' => $this->_oConfig->getItemViewUrl($aContent),
+            'entry_url' => '{bx_url_root}' . $this->_oConfig->getItemViewUrl($aContent, false),
             'entry_caption' => $sEntryCaption,
             'entry_author' => $aContent['owner_id'],
             'subentry_sample' => $CNF['T']['txt_sample_comment_single'],
-            'subentry_url' => $oComment->getViewUrl((int)$aEvent['subobject_id']),
+            'subentry_url' => '{bx_url_root}' . $oComment->getViewUrl((int)$aEvent['subobject_id'], false),
             'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
         );
     }
@@ -2324,11 +2324,11 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         return array(
             'object_id' => $iObjectId,
             'entry_sample' => '_cmt_txt_sample_comment_single',
-            'entry_url' => $oComment->getViewUrl($iParentId),
+            'entry_url' => '{bx_url_root}' . $oComment->getViewUrl($iParentId, false),
             'entry_caption' => strmaxtextlen($aParentInfo['cmt_text'], 20, '...'),
             'entry_author' => (int)$aParentInfo['cmt_author_id'],
             'subentry_sample' => '_cmt_txt_sample_reply_to',
-            'subentry_url' => $oComment->getViewUrl((int)$aEvent['subobject_id']),
+            'subentry_url' => '{bx_url_root}' . $oComment->getViewUrl((int)$aEvent['subobject_id'], false),
             'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
         );
     }
@@ -2368,7 +2368,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
 
         return array(
             'entry_sample' => $CNF['T']['txt_sample_single'],
-            'entry_url' => $this->_oConfig->getItemViewUrl($aContent),
+            'entry_url' => '{bx_url_root}' . $this->_oConfig->getItemViewUrl($aContent, false),
             'entry_caption' => $sEntryCaption,
             'entry_author' => $aContent['owner_id'],
             'subentry_sample' => $CNF['T']['txt_sample_vote_single'],
@@ -2407,7 +2407,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
 
         return array(
             'entry_sample' => $CNF['T']['txt_sample_single'],
-            'entry_url' => $this->_oConfig->getItemViewUrl($aContent),
+            'entry_url' => '{bx_url_root}' . $this->_oConfig->getItemViewUrl($aContent, false),
             'entry_caption' => $sEntryCaption,
             'entry_author' => $aContent['owner_id'],
             'subentry_sample' => $CNF['T']['txt_sample_reaction_single'],
@@ -2480,7 +2480,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
 
         return array(
             'entry_sample' => $CNF['T']['txt_sample_single'],
-            'entry_url' => $this->_oConfig->getItemViewUrl($aContent),
+            'entry_url' => '{bx_url_root}' . $this->_oConfig->getItemViewUrl($aContent, false),
             'entry_caption' => $sEntryCaption,
             'entry_author' => $aContent['owner_id'],
             'subentry_sample' => $CNF['T']['txt_sample_score_' . $sType . '_single'],

+ 3 - 3
template/scripts/BxBaseAuditServices.php

@@ -59,7 +59,7 @@ class BxBaseAuditServices extends BxDol
             return array();
 
         $iCmtId = (int)$aCmtInfo['cmt_id'];
-        $sCmtUrl = $oCmts->serviceGetLink($iCmtId);
+        $sCmtUrl = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oCmts->serviceGetLink($iCmtId));
         $sCmtCaption = strmaxtextlen($oCmts->serviceGetText($iCmtId), 20, '...');
 
         return array(
@@ -103,7 +103,7 @@ class BxBaseAuditServices extends BxDol
             $aSubentrySampleParams[] = '_undefined';
 
         $iCmtId = (int)$aCmtInfo['cmt_id'];
-        $sCmtUrl = $oCmts->serviceGetLink($iCmtId);
+        $sCmtUrl = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oCmts->serviceGetLink($iCmtId));
         $sCmtCaption = strmaxtextlen($oCmts->serviceGetText($iCmtId), 20, '...');
 
         return array(
@@ -150,7 +150,7 @@ class BxBaseAuditServices extends BxDol
             return array();
 
         $iCmtId = (int)$aCmtInfo['cmt_id'];
-        $sCmtUrl = $oCmts->serviceGetLink($iCmtId);
+        $sCmtUrl = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oCmts->serviceGetLink($iCmtId));
         $sCmtCaption = strmaxtextlen($oCmts->serviceGetText($iCmtId), 20, '...');
 
         return array(

+ 5 - 5
template/scripts/BxBaseCmtsServices.php

@@ -271,7 +271,7 @@ class BxBaseCmtsServices extends BxDol
         if(empty($CNF['FIELD_ID']) || empty($CNF['FIELD_AUTHOR']) || !(isset($CNF['FIELD_TITLE']) || isset($CNF['FIELD_TEXT'])) || empty($CNF['URI_VIEW_ENTRY']))
             return [];
 
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+        $sEntryUrl = '{bx_url_root}' . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
         $sEntryCaption = isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...');
 
         return array(
@@ -279,7 +279,7 @@ class BxBaseCmtsServices extends BxDol
             'entry_url' => $sEntryUrl,
             'entry_caption' => $sEntryCaption,
             'subentry_sample' => $CNF['T']['txt_sample_comment_single'],
-            'subentry_url' => $oComment->getViewUrl((int)$aCommentGi['cmt_id']),
+            'subentry_url' => '{bx_url_root}' . $oComment->getViewUrl((int)$aCommentGi['cmt_id'], false),
             'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
         );
     }
@@ -304,7 +304,7 @@ class BxBaseCmtsServices extends BxDol
             return array();
 
         $iCmtId = (int)$aCmtInfo['cmt_id'];
-        $sCmtUrl = $oCmts->serviceGetLink($iCmtId);
+        $sCmtUrl = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oCmts->serviceGetLink($iCmtId));
         $sCmtCaption = strmaxtextlen($oCmts->serviceGetText($iCmtId), 20, '...');
 
         return array(
@@ -348,7 +348,7 @@ class BxBaseCmtsServices extends BxDol
             $aSubentrySampleParams[] = '_undefined';
 
         $iCmtId = (int)$aCmtInfo['cmt_id'];
-        $sCmtUrl = $oCmts->serviceGetLink($iCmtId);
+        $sCmtUrl = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oCmts->serviceGetLink($iCmtId));
         $sCmtCaption = strmaxtextlen($oCmts->serviceGetText($iCmtId), 20, '...');
 
         return array(
@@ -395,7 +395,7 @@ class BxBaseCmtsServices extends BxDol
             return array();
 
         $iCmtId = (int)$aCmtInfo['cmt_id'];
-        $sCmtUrl = $oCmts->serviceGetLink($iCmtId);
+        $sCmtUrl = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oCmts->serviceGetLink($iCmtId));
         $sCmtCaption = strmaxtextlen($oCmts->serviceGetText($iCmtId), 20, '...');
 
         return array(

+ 2 - 2
template/scripts/BxBaseServiceConnections.php

@@ -288,7 +288,7 @@ class BxBaseServiceConnections extends BxDol
 
         return array(
             'entry_sample' => '_sys_profile_sample_single',
-            'entry_url' => $oOwner->getUrl(),
+            'entry_url' => str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oOwner->getUrl()),
             'entry_caption' => $oProfile->getDisplayName(),
             'entry_author' => $oProfile->id(),
             'lang_key' => '_sys_profile_subscription_added',
@@ -316,7 +316,7 @@ class BxBaseServiceConnections extends BxDol
 
         return array(
             'entry_sample' => '_sys_profile_sample_single',
-            'entry_url' => $oOwner->getUrl(),
+            'entry_url' => str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', $oOwner->getUrl()),
             'entry_caption' => $oProfile->getDisplayName(),
             'entry_author' => $oProfile->id(),
             'lang_key' => $sLangKey,

+ 11 - 11
template/scripts/BxBaseServiceMetatags.php

@@ -85,28 +85,28 @@ class BxBaseServiceMetatags extends BxDol
 	/**
      * Get notification data for Notifications module - action Mention. 
      */
-	public function serviceGetNotificationsPostMention($aEvent)
+    public function serviceGetNotificationsPostMention($aEvent)
     {
     	$iProfile = (int)$aEvent['object_owner_id'];
     	$oProfile = BxDolProfile::getInstance($iProfile);
         if(!$oProfile)
-			return array();
+            return array();
 
         if (isset($aEvent['content']['content_id']) && isset($aEvent['content']['module'])) {
             if (BxDolRequest::serviceExists($aEvent['content']['module'], 'get_link'))
-                $sEntryUrl = bx_srv($aEvent['content']['module'], 'get_link', [$aEvent['content']['content_id']]);
+                $sEntryUrl = str_replace(BX_DOL_URL_ROOT, '{bx_url_root}', bx_srv($aEvent['content']['module'], 'get_link', [$aEvent['content']['content_id']]));
         }
 
         if (!$sEntryUrl)
-            $sEntryUrl = BX_DOL_URL_ROOT . bx_append_url_params('searchKeyword.php', array('type' => 'mention', 'keyword' => $iProfile));
+            $sEntryUrl = '{bx_url_root}' . bx_append_url_params('searchKeyword.php', array('type' => 'mention', 'keyword' => $iProfile));
 
-		return array(
-			'entry_sample' => '_sys_profile_sample_single',
-			'entry_url' => $sEntryUrl,
-			'entry_caption' => $oProfile->getDisplayName(),
-			'entry_author' => $iProfile,
-			'lang_key' => '_sys_metatags_mention_added',
-		);
+        return array(
+            'entry_sample' => '_sys_profile_sample_single',
+            'entry_url' => $sEntryUrl,
+            'entry_caption' => $oProfile->getDisplayName(),
+            'entry_author' => $iProfile,
+            'lang_key' => '_sys_metatags_mention_added',
+        );
     }
 }