New events for overriding scope checks
This commit is contained in:
parent
dbae9ea11b
commit
b65db93d29
12
EVENTS.txt
12
EVENTS.txt
|
@ -1430,3 +1430,15 @@ StartShowNoticeOptionItems: Before showing first controls in a notice list item;
|
|||
|
||||
EndShowNoticeOptionItems: After showing last controls in a notice list item; inside the div
|
||||
- $nli: NoticeListItem being shown
|
||||
|
||||
StartNoticeInScope: Before checking if a notice should be visible to a user
|
||||
- $notice: The notice to check
|
||||
- $profile: The profile to check for scope
|
||||
- &$bResult: The boolean result; fill this in if you want to skip
|
||||
|
||||
EndNoticeInScope: After checking if a notice should be visible to a user
|
||||
- $notice: The notice to check
|
||||
- $profile: The profile to check for scope
|
||||
- &$bResult: The boolean result; overwrite this if you so desire
|
||||
|
||||
|
||||
|
|
|
@ -2365,7 +2365,11 @@ class Notice extends Managed_DataObject
|
|||
$result = self::cacheGet($keypart);
|
||||
|
||||
if ($result === false) {
|
||||
$bResult = $this->_inScope($profile);
|
||||
$bResult = false;
|
||||
if (Event::handle('StartNoticeInScope', array($notice, $profile, &$bResult))) {
|
||||
$bResult = $this->_inScope($profile);
|
||||
Event::handle('EndNoticeInScope', array($notice, $profile, &$bResult));
|
||||
}
|
||||
$result = ($bResult) ? 1 : 0;
|
||||
self::cacheSet($keypart, $result, 0, 300);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user