Fix ajax error output

This commit is contained in:
Zach Copley 2011-06-29 21:55:28 +00:00
parent 7fb93673bc
commit 4eac561cf6
1 changed files with 12 additions and 1 deletions

View File

@ -150,7 +150,18 @@ class NewbookmarkAction extends Action
} catch (ClientException $ce) {
if ($this->boolean('ajax')) {
throw $ce;
header('Content-Type: text/xml;charset=utf-8');
$this->xw->startDocument('1.0', 'UTF-8');
$this->elementStart('html');
$this->elementStart('head');
// TRANS: Page title after an AJAX error occurs
$this->element('title', null, _('Ajax Error'));
$this->elementEnd('head');
$this->elementStart('body');
$this->element('p', array('id' => 'error'), $ce->getMessage());
$this->elementEnd('body');
$this->elementEnd('html');
return;
} else {
$this->error = $ce->getMessage();
$this->showPage();