'ajax' param on shownotice action so we can pull items in full html version for realtime

This commit is contained in:
Brion Vibber 2011-03-14 13:05:30 -07:00
parent 1e36593a23
commit c7e7cc79da

View File

@ -188,6 +188,10 @@ class ShownoticeAction extends OwnerDesignAction
{
parent::handle($args);
if ($this->boolean('ajax')) {
StatusNet::setApi(true);
$this->showAjax();
} else {
if ($this->notice->is_local == Notice::REMOTE_OMB) {
if (!empty($this->notice->url)) {
$target = $this->notice->url;
@ -205,6 +209,7 @@ class ShownoticeAction extends OwnerDesignAction
}
$this->showPage();
}
}
/**
* Don't show local navigation
@ -232,6 +237,21 @@ class ShownoticeAction extends OwnerDesignAction
$this->elementEnd('ol');
}
function showAjax()
{
header('Content-Type: text/xml;charset=utf-8');
$this->xw->startDocument('1.0', 'UTF-8');
$this->elementStart('html');
$this->elementStart('head');
$this->element('title', null, _('Notice'));
$this->elementEnd('head');
$this->elementStart('body');
$nli = new NoticeListItem($this->notice, $this);
$nli->show();
$this->elementEnd('body');
$this->elementEnd('html');
}
/**
* Don't show page notice
*