forked from GNUsocial/gnu-social
New eventsi: Start/EndShowNoticeOptions and Start/EndShowFaveForm
This commit is contained in:
parent
fd779009b8
commit
21759c3132
16
EVENTS.txt
16
EVENTS.txt
@ -258,10 +258,22 @@ EndShowExportData: just after showing the <div> with export data (feeds)
|
|||||||
- $action: action object being shown
|
- $action: action object being shown
|
||||||
|
|
||||||
StartShowNoticeItem: just before showing the notice item
|
StartShowNoticeItem: just before showing the notice item
|
||||||
- $action: action object being shown
|
- $item: The NoticeListItem object being shown
|
||||||
|
|
||||||
EndShowNoticeItem: just after showing the notice item
|
EndShowNoticeItem: just after showing the notice item
|
||||||
- $action: action object being shown
|
- $item: the NoticeListItem object being shown
|
||||||
|
|
||||||
|
StartShowNoticeOptions: just before showing notice options like fave, repeat, etc.
|
||||||
|
- $item: the NoticeListItem object being shown
|
||||||
|
|
||||||
|
EndShowNoticeOptions: just after showing notice options like fave, repeat, etc.
|
||||||
|
- $item: the NoticeListItem object being shown
|
||||||
|
|
||||||
|
StartShowFaveForm: just before showing the fave form
|
||||||
|
- $item: the NoticeListItem object being shown
|
||||||
|
|
||||||
|
EndShowFaveForm: just after showing the fave form
|
||||||
|
- $item: the NoticeListItem object being shown
|
||||||
|
|
||||||
StartShowPageNotice: just before showing the page notice (instructions or error)
|
StartShowPageNotice: just before showing the page notice (instructions or error)
|
||||||
- $action: action object being shown
|
- $action: action object being shown
|
||||||
|
@ -236,6 +236,7 @@ class NoticeListItem extends Widget
|
|||||||
|
|
||||||
function showNoticeOptions()
|
function showNoticeOptions()
|
||||||
{
|
{
|
||||||
|
if (Event::handle('StartShowNoticeOptions', array($this))) {
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
if ($user) {
|
if ($user) {
|
||||||
$this->out->elementStart('div', 'notice-options');
|
$this->out->elementStart('div', 'notice-options');
|
||||||
@ -245,6 +246,8 @@ class NoticeListItem extends Widget
|
|||||||
$this->showDeleteLink();
|
$this->showDeleteLink();
|
||||||
$this->out->elementEnd('div');
|
$this->out->elementEnd('div');
|
||||||
}
|
}
|
||||||
|
Event::handle('EndShowNoticeOptions', array($this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -270,6 +273,7 @@ class NoticeListItem extends Widget
|
|||||||
|
|
||||||
function showFaveForm()
|
function showFaveForm()
|
||||||
{
|
{
|
||||||
|
if (Event::handle('StartShowFaveForm', array($this))) {
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
if ($user) {
|
if ($user) {
|
||||||
if ($user->hasFave($this->notice)) {
|
if ($user->hasFave($this->notice)) {
|
||||||
@ -280,6 +284,8 @@ class NoticeListItem extends Widget
|
|||||||
$favor->show();
|
$favor->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Event::handle('EndShowFaveForm', array($this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user