forked from GNUsocial/gnu-social
add StartNoticeSaveWeb and EndNoticeSaveWeb to hook web-based UI for notices
This commit is contained in:
parent
79b5f1cea5
commit
7dd46222a8
11
EVENTS.txt
11
EVENTS.txt
@ -1045,3 +1045,14 @@ StartActivityEnd: before the closing </entry> in a notice activity entry (last c
|
|||||||
EndActivityEnd: after the closing </entry> in a notice activity entry
|
EndActivityEnd: after the closing </entry> in a notice activity entry
|
||||||
- &$notice: notice being output
|
- &$notice: notice being output
|
||||||
- &$xs: XMLStringer for output
|
- &$xs: XMLStringer for output
|
||||||
|
|
||||||
|
StartNoticeSaveWeb: before saving a notice through the Web interface
|
||||||
|
- $action: action being executed (instance of NewNoticeAction)
|
||||||
|
- &$authorId: integer ID of the author
|
||||||
|
- &$text: text of the notice
|
||||||
|
- &$options: additional options (location, replies, etc.)
|
||||||
|
|
||||||
|
EndNoticeSaveWeb: after saving a notice through the Web interface
|
||||||
|
- $action: action being executed (instance of NewNoticeAction)
|
||||||
|
- $notice: notice that was saved
|
||||||
|
|
||||||
|
@ -203,12 +203,20 @@ class NewnoticeAction extends Action
|
|||||||
$options = array_merge($options, $locOptions);
|
$options = array_merge($options, $locOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$author_id = $user->id;
|
||||||
|
$text = $content_shortened;
|
||||||
|
|
||||||
|
if (Event::handle('StartNoticeSaveWeb', array($this, &$author_id, &$text, &$options))) {
|
||||||
|
|
||||||
$notice = Notice::saveNew($user->id, $content_shortened, 'web', $options);
|
$notice = Notice::saveNew($user->id, $content_shortened, 'web', $options);
|
||||||
|
|
||||||
if (isset($upload)) {
|
if (isset($upload)) {
|
||||||
$upload->attachToNotice($notice);
|
$upload->attachToNotice($notice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Event::handle('EndNoticeSaveWeb', array($this, $notice));
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->boolean('ajax')) {
|
if ($this->boolean('ajax')) {
|
||||||
header('Content-Type: text/xml;charset=utf-8');
|
header('Content-Type: text/xml;charset=utf-8');
|
||||||
$this->xw->startDocument('1.0', 'UTF-8');
|
$this->xw->startDocument('1.0', 'UTF-8');
|
||||||
|
Loading…
Reference in New Issue
Block a user