summaryrefslogtreecommitdiff
path: root/lib/noticelist.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-09-30 13:59:02 -0700
committerZach Copley <zach@status.net>2010-09-30 13:59:02 -0700
commit23c45d6c493ac08341d4c7e259a9c227c1f1970d (patch)
treebbca87731b1b7338c54942f26eee6e3be95f2a74 /lib/noticelist.php
parentbc2b72a8723054affc4c71ab9ae55cf40aba7447 (diff)
parent3224f7fec9906b00684851759fcb476517d14e48 (diff)
Merge branch 'anon-fave-plugin' into 0.9.x
Diffstat (limited to 'lib/noticelist.php')
-rw-r--r--lib/noticelist.php52
1 files changed, 31 insertions, 21 deletions
diff --git a/lib/noticelist.php b/lib/noticelist.php
index 529d6a3f9..df1533980 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -226,24 +226,31 @@ class NoticeListItem extends Widget
function showNoticeInfo()
{
$this->out->elementStart('div', 'entry-content');
- $this->showNoticeLink();
- $this->showNoticeSource();
- $this->showNoticeLocation();
- $this->showContext();
- $this->showRepeat();
+ if (Event::handle('StartShowNoticeInfo', array($this))) {
+ $this->showNoticeLink();
+ $this->showNoticeSource();
+ $this->showNoticeLocation();
+ $this->showContext();
+ $this->showRepeat();
+ Event::handle('EndShowNoticeInfo', array($this));
+ }
+
$this->out->elementEnd('div');
}
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 +277,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));
}
}