exit(1);
}
-require_once INSTALLDIR . '/lib/noticelist.php';
-require_once INSTALLDIR . '/lib/mediafile.php';
-
/**
* Action for posting new notices
*
$options['reply_to'] = $replyto;
}
- $upload = null;
- $upload = MediaFile::fromUpload('attach');
+ $upload = MediaFile::fromUpload('attach', $this->scoped);
if (isset($upload)) {
}
}
- if ($user->shareLocation()) {
+ if ($this->scoped->shareLocation()) {
// use browser data if checked; otherwise profile data
if ($this->arg('notice_data-geo')) {
$locOptions = Notice::locationOptions($this->trimmed('lat'),
Event::handle('EndNoticeSaveWeb', array($this, $notice));
}
+
+ assert($notice instanceof Notice);
+
Event::handle('EndSaveNewNoticeWeb', array($this, $user, &$content_shortened, &$options));
if (StatusNet::isAjax()) {
- header('Content-Type: text/xml;charset=utf-8');
- $this->xw->startDocument('1.0', 'UTF-8');
- $this->elementStart('html');
+ $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
// TRANS: Page title after sending a notice.
$this->element('title', null, _('Notice posted'));
$this->elementStart('body');
$this->showNotice($notice);
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
exit;
} else {
$returnto = $this->trimmed('returnto');
$this->elementStart('body');
$this->element('p', array('id' => 'error'), $msg);
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
}
/**
$form->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
}
/**
*
* @return void
*/
- function showNotice($notice)
+ function showNotice(Notice $notice)
{
$nli = new NoticeListItem($notice, $this);
$nli->show();