Ver Fonte

Ticket #62 - Event's DB descriptor should have NON-translated language keys.

AntonLV há 10 anos atrás
pai
commit
77c5fb68a9

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

@@ -213,7 +213,7 @@ class BxBaseModGeneralModule extends BxDolModule
         $sEntryCaption = isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...');
 
 		return array(
-			'entry_sample' => _t($CNF['T']['txt_sample_single']),
+			'entry_sample' => $CNF['T']['txt_sample_single'],
 			'entry_url' => $sEntryUrl,
 			'entry_caption' => $sEntryCaption,
 			'entry_author' => $aContentInfo[$CNF['FIELD_AUTHOR']],
@@ -241,11 +241,11 @@ class BxBaseModGeneralModule extends BxDolModule
         $sEntryCaption = isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...');
 
 		return array(
-			'entry_sample' => _t($CNF['T']['txt_sample_single']),
+			'entry_sample' => $CNF['T']['txt_sample_single'],
 			'entry_url' => $sEntryUrl,
 			'entry_caption' => $sEntryCaption,
 			'entry_author' => $aContentInfo[$CNF['FIELD_AUTHOR']],
-			'subentry_sample' => _t($CNF['T']['txt_sample_comment_single']),
+			'subentry_sample' => $CNF['T']['txt_sample_comment_single'],
 			'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.
 		);
@@ -271,11 +271,11 @@ class BxBaseModGeneralModule extends BxDolModule
         $sEntryCaption = isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...');
 
 		return array(
-			'entry_sample' => _t($CNF['T']['txt_sample_single']),
+			'entry_sample' => $CNF['T']['txt_sample_single'],
 			'entry_url' => $sEntryUrl,
 			'entry_caption' => $sEntryCaption,
 			'entry_author' => $aContentInfo[$CNF['FIELD_AUTHOR']],
-			'subentry_sample' => _t($CNF['T']['txt_sample_vote_single']),
+			'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.
 		);
     }

+ 5 - 1
modules/boonex/notifications/classes/BxNtfsDb.php

@@ -57,8 +57,12 @@ class BxNtfsDb extends BxBaseModNotificationsDb
 		}
 
 		//--- Apply privacy filter
+		$aPrivacy = array(BX_DOL_PG_ALL);
+		if(isLogged())
+			$aPrivacy[] = BX_DOL_PG_MEMBERS;
+
 		$oPrivacy = BxDolPrivacy::getObjectInstance($this->_oConfig->getObject('privacy_view'));
-		$aQueryParts = $oPrivacy->getContentByGroupAsSQLPart(BX_DOL_PG_ALL);
+		$aQueryParts = $oPrivacy->getContentByGroupAsSQLPart($aPrivacy);
 		$sWhereClause .= $aQueryParts['where'] . " ";
 
 		//--- Check type

+ 3 - 0
modules/boonex/notifications/classes/BxNtfsTemplate.php

@@ -100,6 +100,9 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
         $aEvent['content'] = unserialize($aEvent['content']);
         $aEvent['content']['owner_name'] = $sOwnerName;
         $aEvent['content']['owner_link'] = $sOwnerUrl;
+        foreach($aEvent['content'] as $sKey => $sValue)
+        	if(substr($sValue, 0, 1) == '_')
+        		$aEvent['content'][$sKey] = _t($sValue);
 
     	$sContent = _t(!empty($aEvent['content']['lang_key']) ? $aEvent['content']['lang_key'] : $this->_getLangKey($aEvent));
     	$sContent = $this->parseHtmlByContent($sContent, $aEvent['content'], array('{', '}'));

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

@@ -401,7 +401,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         $sEntryCaption = !empty($aContent['title']) ? $aContent['title'] : strmaxtextlen($aContent['description'], 20, '...');
 
 		return array(
-			'entry_sample' => _t($CNF['T']['txt_sample_single_ext']),
+			'entry_sample' => $CNF['T']['txt_sample_single_ext'],
 			'entry_url' => $this->_oConfig->getItemViewUrl($aContent),
 			'entry_caption' => $sEntryCaption,
 			'entry_author' => $aContent['owner_id'],
@@ -425,11 +425,11 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         $sEntryCaption = !empty($aContent['title']) ? $aContent['title'] : strmaxtextlen($aContent['description'], 20, '...');
 
 		return array(
-			'entry_sample' => _t($CNF['T']['txt_sample_single']),
+			'entry_sample' => $CNF['T']['txt_sample_single'],
 			'entry_url' => $this->_oConfig->getItemViewUrl($aContent),
 			'entry_caption' => $sEntryCaption,
 			'entry_author' => $aContent['owner_id'],
-			'subentry_sample' => _t($CNF['T']['txt_sample_comment_single']),
+			'subentry_sample' => $CNF['T']['txt_sample_comment_single'],
 			'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.
 		);
@@ -451,11 +451,11 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         $sEntryCaption = !empty($aContent['title']) ? $aContent['title'] : strmaxtextlen($aContent['description'], 20, '...');
 
 		return array(
-			'entry_sample' => _t($CNF['T']['txt_sample_single']),
+			'entry_sample' => $CNF['T']['txt_sample_single'],
 			'entry_url' => $this->_oConfig->getItemViewUrl($aContent),
 			'entry_caption' => $sEntryCaption,
 			'entry_author' => $aContent['owner_id'],
-			'subentry_sample' => _t($CNF['T']['txt_sample_vote_single']),
+			'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.
 		);
     }

+ 1 - 1
template/scripts/BxBaseServiceConnections.php

@@ -64,7 +64,7 @@ class BxBaseServiceConnections extends BxDol
 			return array();
 
 		return array(
-			'entry_sample' => _t('_sys_profile_sample_single'),
+			'entry_sample' => '_sys_profile_sample_single',
 			'entry_url' => $oProfile->getUrl(),
 			'entry_caption' => $oProfile->getDisplayName(),
 			'entry_author' => $oProfile->id(),