$item = new ThreadedNoticeListSubItem($notice, $this->out);
$item->show();
}
+ if (common_current_user()) {
+ $item = new ThreadedNoticeListReplyItem($this->notice, $this->out);
+ $item->show();
+ }
$this->out->elementEnd('ul');
}
{
//
}
+}
+
+/**
+ * Show a mini inline posting form for replies.
+ */
+class ThreadedNoticeListReplyItem extends NoticeListItem
+{
+
+ /**
+ * recipe function for displaying a single notice.
+ *
+ * This uses all the other methods to correctly display a notice. Override
+ * it or one of the others to fine-tune the output.
+ *
+ * @return void
+ */
+
+ function show()
+ {
+ $this->showStart();
+ $this->showMiniForm();
+ $this->showEnd();
+ }
+
+ function showMiniForm()
+ {
+ $replyToId = $this->notice->id;
+ $id = 'replyto-notice-' + $replyToId;
+ $url = common_local_url('newnotice');
+
+ // @fixme replace this with an ajax-friendly form pair?
+ $this->out->elementStart('form',
+ array('id' => $id,
+ 'class' => 'replyform',
+ 'method' => 'post',
+ 'action' => $url));
+ $this->out->hidden('token', common_session_token());
+ $this->out->hidden("$id-inreplyto", $replyToId, "inreplyto");
+ $this->out->element('textarea', array('name' => 'status_textarea'));
+ $this->out->elementStart('div', array('class' => 'controls'));
+ $this->out->submit("$id-submit", _m('Send reply'));
+ $this->out->elementEnd('div');
+ $this->out->elementEnd('form');
+ }
}
\ No newline at end of file