summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/shownotice.php28
-rw-r--r--lib/noticelist.php13
2 files changed, 27 insertions, 14 deletions
diff --git a/actions/shownotice.php b/actions/shownotice.php
index b0d973a99..0d89af5ac 100644
--- a/actions/shownotice.php
+++ b/actions/shownotice.php
@@ -209,7 +209,7 @@ class ShownoticeAction extends Action
function showContent()
{
$this->elementStart('ol', array('class' => 'notices xoxo'));
- $nli = new NoticeListItem($this->notice, $this);
+ $nli = new SingleNoticeItem($this->notice, $this);
$nli->show();
$this->elementEnd('ol');
}
@@ -264,3 +264,29 @@ class ShownoticeAction extends Action
}
}
}
+
+class SingleNoticeItem extends NoticeListItem
+{
+ /**
+ * recipe function for displaying a single notice.
+ *
+ * We overload to show attachments.
+ *
+ * @return void
+ */
+
+ function show()
+ {
+ $this->showStart();
+ $this->showNotice();
+ $this->showNoticeAttachments();
+ $this->showNoticeInfo();
+ $this->showNoticeOptions();
+ $this->showEnd();
+ }
+
+ function showNoticeAttachments() {
+ $al = new AttachmentList($this->notice, $this->out);
+ $al->show();
+ }
+}
diff --git a/lib/noticelist.php b/lib/noticelist.php
index ad792441a..bd4815cd6 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -179,7 +179,6 @@ class NoticeListItem extends Widget
{
$this->showStart();
$this->showNotice();
- $this->showNoticeAttachments();
$this->showNoticeInfo();
$this->showNoticeOptions();
$this->showEnd();
@@ -193,18 +192,6 @@ class NoticeListItem extends Widget
$this->out->elementEnd('div');
}
- function showNoticeAttachments() {
- if ($this->isUsedInList()) {
- return;
- }
- $al = new AttachmentList($this->notice, $this->out);
- $al->show();
- }
-
- function isUsedInList() {
- return 'shownotice' !== $this->out->args['action'];
- }
-
function showNoticeInfo()
{
$this->out->elementStart('div', 'entry-content');