summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-09-28 17:09:34 -0700
committerZach Copley <zach@status.net>2010-09-29 16:35:12 -0700
commit21759c31326ace83498466794d9b692f3f2ae077 (patch)
treee4fff7e69121d823773b531e63d88214d1456221 /lib
parentfd779009b8636399472d74e86531ba9bc86cfb59 (diff)
New eventsi: Start/EndShowNoticeOptions and Start/EndShowFaveForm
Diffstat (limited to 'lib')
-rw-r--r--lib/noticelist.php38
1 files changed, 22 insertions, 16 deletions
diff --git a/lib/noticelist.php b/lib/noticelist.php
index 529d6a3f9..cc460005a 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -236,14 +236,17 @@ class NoticeListItem extends Widget
function showNoticeOptions()
{
- $user = common_current_user();
- if ($user) {
- $this->out->elementStart('div', 'notice-options');
- $this->showFaveForm();
- $this->showReplyLink();
- $this->showRepeatForm();
- $this->showDeleteLink();
- $this->out->elementEnd('div');
+ if (Event::handle('StartShowNoticeOptions', array($this))) {
+ $user = common_current_user();
+ if ($user) {
+ $this->out->elementStart('div', 'notice-options');
+ $this->showFaveForm();
+ $this->showReplyLink();
+ $this->showRepeatForm();
+ $this->showDeleteLink();
+ $this->out->elementEnd('div');
+ }
+ Event::handle('EndShowNoticeOptions', array($this));
}
}
@@ -270,15 +273,18 @@ class NoticeListItem extends Widget
function showFaveForm()
{
- $user = common_current_user();
- if ($user) {
- if ($user->hasFave($this->notice)) {
- $disfavor = new DisfavorForm($this->out, $this->notice);
- $disfavor->show();
- } else {
- $favor = new FavorForm($this->out, $this->notice);
- $favor->show();
+ if (Event::handle('StartShowFaveForm', array($this))) {
+ $user = common_current_user();
+ if ($user) {
+ if ($user->hasFave($this->notice)) {
+ $disfavor = new DisfavorForm($this->out, $this->notice);
+ $disfavor->show();
+ } else {
+ $favor = new FavorForm($this->out, $this->notice);
+ $favor->show();
+ }
}
+ Event::handle('EndShowFaveForm', array($this));
}
}