Commit 23702085 authored by Brion Vibber's avatar Brion Vibber

quickie inline reply posting form

parent 934ae38a
......@@ -171,6 +171,10 @@ class ThreadedNoticeListItem extends NoticeListItem
$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');
}
......@@ -195,4 +199,48 @@ class ThreadedNoticeListSubItem extends NoticeListItem
{
//
}
}
/**
* 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment