From 57feeb566a0cb2c544545dbfc616437cae69b923 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 11 Sep 2009 22:37:37 -0400 Subject: Add a parameter named 'inreplyto' to the 'notice/new' page, so urls can inclue 'inreplyto' id's. Also add 'inreplyto' to the urls sent in emails. --- lib/noticelist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/noticelist.php') diff --git a/lib/noticelist.php b/lib/noticelist.php index ec85e4a5c..6b2bccd97 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -442,7 +442,7 @@ class NoticeListItem extends Widget { if (common_logged_in()) { $reply_url = common_local_url('newnotice', - array('replyto' => $this->profile->nickname)); + array('replyto' => $this->profile->nickname, 'inreplyto' => $this->notice->id)); $this->out->elementStart('a', array('href' => $reply_url, 'class' => 'notice_reply', 'title' => _('Reply to this notice'))); -- cgit v1.2.3-54-g00ecf From 4b7881c64e741d7b82f1d65bd9651148692cf1d4 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 18 Sep 2009 19:32:51 +0200 Subject: Removed trailing single space in author @title --- lib/noticelist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/noticelist.php') diff --git a/lib/noticelist.php b/lib/noticelist.php index 6b2bccd97..336457b45 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -261,7 +261,7 @@ class NoticeListItem extends Widget $attrs = array('href' => $this->profile->profileurl, 'class' => 'url'); if (!empty($this->profile->fullname)) { - $attrs['title'] = $this->profile->fullname . ' (' . $this->profile->nickname . ') '; + $attrs['title'] = $this->profile->fullname . ' (' . $this->profile->nickname . ')'; } $this->out->elementStart('a', $attrs); $this->showAvatar(); -- cgit v1.2.3-54-g00ecf From 6af71f2cd2b2fcacb0f1eb2e0172a300802fe8bc Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 18 Sep 2009 17:37:36 -0400 Subject: Show context link if this notice starts a conversation --- lib/noticelist.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib/noticelist.php') diff --git a/lib/noticelist.php b/lib/noticelist.php index 6b2bccd97..507413da7 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -418,9 +418,17 @@ class NoticeListItem extends Widget function showContext() { - // XXX: also show context if there are replies to this notice - if (!empty($this->notice->conversation) - && $this->notice->conversation != $this->notice->id) { + $hasConversation = false; + if( !empty($this->notice->conversation) + && $this->notice->conversation != $this->notice->id){ + $hasConversation = true; + }else{ + $conversation = Notice::conversationStream($this->notice->id, 1, 1); + if($conversation->N > 0){ + $hasConversation = true; + } + } + if ($hasConversation){ $convurl = common_local_url('conversation', array('id' => $this->notice->conversation)); $this->out->element('a', array('href' => $convurl.'#notice-'.$this->notice->id, -- cgit v1.2.3-54-g00ecf From d3d9913be062c974e3ae721c0cbf5c5ad2cbfce8 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 25 Sep 2009 12:47:14 +0000 Subject: Added hook for notice item. After
  • and Before
  • . Allows authors to include aside data to their notice items --- EVENTS.txt | 6 ++++++ lib/noticelist.php | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/noticelist.php') diff --git a/EVENTS.txt b/EVENTS.txt index fa25aabcd..74923dcc0 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -194,6 +194,12 @@ StartShowExportData: just before showing the
    with export data (feeds) EndShowExportData: just after showing the
    with export data (feeds) - $action: action object being shown +StartShowNoticeItem: just before showing the notice item +- $action: action object being shown + +EndShowNoticeItem: just after showing the notice item +- $action: action object being shown + StartShowPageNotice: just before showing the page notice (instructions or error) - $action: action object being shown diff --git a/lib/noticelist.php b/lib/noticelist.php index d4cd3ff6e..c2ff7c26b 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -178,9 +178,12 @@ class NoticeListItem extends Widget function show() { $this->showStart(); - $this->showNotice(); - $this->showNoticeInfo(); - $this->showNoticeOptions(); + if (Event::handle('StartShowNoticeItem', array($this))) { + $this->showNotice(); + $this->showNoticeInfo(); + $this->showNoticeOptions(); + Event::handle('EndShowNoticeItem', array($this)); + } $this->showEnd(); } -- cgit v1.2.3-54-g00ecf From ee236e68df8a8b7ee7917fd60ef36b57c0bd64db Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 27 Sep 2009 21:05:29 -0400 Subject: show delete button when user has deleteOthersNotice right --- lib/noticelist.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/noticelist.php') diff --git a/lib/noticelist.php b/lib/noticelist.php index c2ff7c26b..6c296f82a 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -472,7 +472,10 @@ class NoticeListItem extends Widget function showDeleteLink() { $user = common_current_user(); - if ($user && $this->notice->profile_id == $user->id) { + + if (!empty($user) && + ($this->notice->profile_id == $user->id || $user->hasRight(Right::deleteOthersNotice))) { + $deleteurl = common_local_url('deletenotice', array('notice' => $this->notice->id)); $this->out->element('a', array('href' => $deleteurl, -- cgit v1.2.3-54-g00ecf