From 2c14185a527becaeda764e2e162fe8cd7e762597 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 9 Apr 2011 15:41:48 -0400 Subject: [PATCH] Add an indicator saying to whom a notice is addressed --- lib/noticelistitem.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php index 9c50966406..74c51f4a2e 100644 --- a/lib/noticelistitem.php +++ b/lib/noticelistitem.php @@ -119,6 +119,7 @@ class NoticeListItem extends Widget { $this->out->elementStart('div', 'entry-title'); $this->showAuthor(); + $this->showAddressees(); $this->showContent(); $this->out->elementEnd('div'); } @@ -218,6 +219,24 @@ class NoticeListItem extends Widget $this->out->elementEnd('span'); } + function showAddressees() + { + $groups = $this->notice->getGroups(); + if (!empty($groups) && count($groups) > 0) { + $this->out->text('▶ '); + $first = true; + foreach ($groups as $group) { + if (!$first) { + $this->out->text(', '); + } else { + $first = false; + } + $this->out->element('a', array('href' => $group->homeUrl()), + $group->nickname); + } + } + } + /** * show the avatar of the notice's author * -- 2.39.5