function showAjax()
{
- 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: Title for conversation page.
$this->element('title', null, _m('TITLE','Notice'));
$this->elementStart('body');
$this->showContent();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
}
}
$this->msg = $msg;
if ($this->trimmed('ajax')) {
- 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 on page for sending a direct message.
$this->element('title', null, _('New message'));
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');
function showAjax()
{
- 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: Title for page that shows a notice.
$this->element('title', null, _m('TITLE','Notice'));
$nli = new NoticeListItem($this->notice, $this);
$nli->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
}
/**
function initFeed()
{
- $this->xw->startDocument('1.0', 'UTF-8');
+ $this->startXML();
$commonAttrs = array('xml:lang' => 'en-US');
foreach ($this->namespaces as $prefix => $uri) {
if ($prefix == '') {
$this->extraHeaders();
if (preg_match("/.*\/.*xml/", $type)) {
// Required for XML documents
- $this->xw->startDocument('1.0', 'UTF-8');
+ $this->startXML();
}
$this->xw->writeDTD('html',
'-//W3C//DTD XHTML 1.0 Strict//EN',
$options);
if ($this->boolean('ajax')) {
- 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, _m('Blog entry saved'));
$nli = new NoticeListItem($saved, $this);
$nli->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($saved->bestUrl(), 303);
}
} catch (ClientException $ce) {
if ($this->boolean('ajax')) {
- 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 an AJAX error occurs
$this->element('title', null, _('Ajax Error'));
$this->elementStart('body');
$this->element('p', array('id' => 'error'), $ce->getMessage());
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
return;
} else {
$this->error = $ce->getMessage();
}
if ($this->boolean('ajax')) {
- 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 posting a bookmark.
$this->element('title', null, _m('Bookmark posted'));
$this->elementStart('body');
$this->showNotice($saved);
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($saved->bestUrl(), 303);
}
}
if ($this->boolean('ajax')) {
- 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, _m('Event saved'));
$this->elementEnd('head');
$this->elementStart('body');
- $this->elementStart('body');
$form = new RSVPForm($this->event, $this);
$form->show();
$this->elementEnd('body');
- $this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
}
}
}
if ($this->boolean('ajax')) {
- 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, _m('Event saved'));
$this->elementStart('body');
$this->showNotice($saved);
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($saved->bestUrl(), 303);
}
// @todo factor this out into a base class
function outputAjaxError($msg)
{
- 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 an AJAX error occurs
$this->element('title', null, _('Ajax Error'));
$this->elementStart('body');
$this->element('p', array('id' => 'error'), $msg);
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
return;
}
if ($this->boolean('ajax')) {
$rsvp = RSVP::fromNotice($saved);
- 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 creating an event.
$this->element('title', null, _m('Event saved'));
$this->elementEnd('head');
$this->elementStart('body');
- $this->elementStart('body');
$cancel = new CancelRSVPForm($rsvp, $this);
$cancel->show();
$this->elementEnd('body');
- $this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($saved->bestUrl(), 303);
}
$action->extraHeaders();
if (preg_match("/.*\/.*xml/", $type)) {
// Required for XML documents
- $action->xw->startDocument('1.0', 'UTF-8');
+ $action->startXML();
}
$action->xw->writeDTD('html',
'-//WAPFORUM//DTD XHTML Mobile 1.0//EN',
{
$this->err = $err;
if ($this->boolean('ajax')) {
- 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: Form title.
$this->element('title', null, _m('TITLE','Subscribe to user'));
$this->elementStart('body');
$this->showContent();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
$this->showPage();
}
$this->error = $err;
}
if ($this->boolean('ajax')) {
- 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: Form title.
$this->element('title', null, _m('Subscribe to user'));
$this->elementStart('body');
$this->showContent();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
$this->showPage();
}
}
if ($this->boolean('ajax')) {
- 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, _m('Notice posted'));
$this->elementStart('body');
$this->showNotice($saved);
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($saved->bestUrl(), 303);
}
}
if ($this->boolean('ajax')) {
- 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 poll response.
$this->element('title', null, _m('Poll results'));
$form = new PollResultForm($this->poll, $this);
$form->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($this->poll->bestUrl(), 303);
}
}
if ($this->boolean('ajax')) {
- 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 an answer.
$this->element('title', null, _m('Answers'));
$form = new QnashowquestionForm($this, $this->question);
$form->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($this->question->bestUrl(), 303);
}
if ($this->boolean('ajax')) {
common_debug("ajaxy part");
$answer = $this->question->getAnswer($profile);
- 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 an answer.
$this->element('title', null, _m('Answers'));
$nli->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_debug("not ajax");
common_redirect($this->question->bestUrl(), 303);
}
if ($this->boolean('ajax')) {
- 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, _m('Question posted'));
$this->elementStart('body');
$this->showNotice($saved);
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($saved->bestUrl(), 303);
}
}
if ($this->boolean('ajax')) {
common_debug("ajaxy part");
- 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 an answer.
$this->element('title', null, _m('Answer'));
$form = new QnashowanswerForm($this, $answer);
$form->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($this->answer->bestUrl(), 303);
}
}
if ($this->boolean('ajax')) {
common_debug("ajaxy part");
- 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 an answer.
$this->element('title', null, _m('Answer'));
$form = new QnashowanswerForm($this, $answer);
$form->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($this->answer->bestUrl(), 303);
}
function showAjaxReviseForm()
{
- 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: Form title for sending an answer.
$this->element('title', null, _m('TITLE','Answer'));
$form = new QnareviseanswerForm($this->answer, $this);
$form->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
}
/**
}
if ($this->boolean('ajax')) {
- 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 in a vote for a question or answer.
$this->element('title', null, _m('Answers'));
$form = new QnA_Answer($this->question, $this);
$form->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
common_redirect($this->question->bestUrl(), 303);
}
*/
function ajaxResults()
{
- 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: Title for AJAX form to indicated that flags were removed.
$this->element('title', null, _m('Flags cleared'));
// TRANS: Body element for "flags cleared" form.
$this->element('p', 'cleared', _m('Cleared'));
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
}
}
*/
function ajaxResults()
{
- 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: AJAX form title for a flagged profile.
$this->element('title', null, _m('Flagged for review'));
// TRANS: Body text for AJAX form when a profile has been flagged for review.
$this->element('p', 'flagged', _m('Flagged'));
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
}
}