X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Ferror.php;h=4024a9affc37290f1b530afcbce6c9215eb8d128;hb=b5c5d8d3933c9694bd105fc1e1f06bc96da2dc79;hp=762425dc44ade45ccb3e46c77aec6bfcf07cda1b;hpb=6c77d86b7f39c35eac0fcc3f13c0beba3e694318;p=quix0rs-gnu-social.git diff --git a/lib/error.php b/lib/error.php index 762425dc44..4024a9affc 100644 --- a/lib/error.php +++ b/lib/error.php @@ -68,7 +68,11 @@ class ErrorAction extends InfoAction function showPage() { - if ($this->minimal) { + if (StatusNet::isAjax()) { + $this->extraHeaders(); + $this->ajaxErrorMsg(); + exit(); + } if ($this->minimal) { // Even more minimal -- we're in a machine API // and don't want to flood the output. $this->extraHeaders(); @@ -91,6 +95,30 @@ class ErrorAction extends InfoAction $this->element('div', array('class' => 'error'), $this->message); } + function showNoticeForm() + { + } + /** + * Show an Ajax-y error message + * + * Goes back to the browser, where it's shown in a popup. + * + * @param string $msg Message to show + * + * @return void + */ + function ajaxErrorMsg() + { + $this->startHTML('text/xml;charset=utf-8', true); + $this->elementStart('head'); + // TRANS: Page title after an AJAX error occurs on the send notice page. + $this->element('title', null, _('Ajax Error')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->element('p', array('id' => 'error'), $this->message); + $this->elementEnd('body'); + $this->elementEnd('html'); + } }