X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FQnA%2Factions%2Fqnaclosequestion.php;h=2cafde91fc9f14939917010305a5eb43ed18b15a;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=1ef5063a025741046493b0f4ee948e9d9cbf6f8a;hpb=a10edb3183928d40c0567ea912a2530ebfb17683;p=quix0rs-gnu-social.git diff --git a/plugins/QnA/actions/qnaclosequestion.php b/plugins/QnA/actions/qnaclosequestion.php index 1ef5063a02..2cafde91fc 100644 --- a/plugins/QnA/actions/qnaclosequestion.php +++ b/plugins/QnA/actions/qnaclosequestion.php @@ -74,7 +74,7 @@ class QnaclosequestionAction extends Action { parent::prepare($argarray); if ($this->boolean('ajax')) { - StatusNet::setApi(true); + GNUsocial::setApi(true); } $this->user = common_current_user(); @@ -92,7 +92,7 @@ class QnaclosequestionAction extends Action } $id = substr($this->trimmed('id'), 9); - $this->question = QnA_Question::staticGet('id', $id); + $this->question = QnA_Question::getKV('id', $id); if (empty($this->question)) { // TRANS: Client exception thrown trying to respond to a non-existing question. throw new ClientException(_m('Invalid or missing question.'), 404); @@ -147,9 +147,7 @@ class QnaclosequestionAction extends Action } 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')); @@ -158,9 +156,9 @@ class QnaclosequestionAction extends Action $form = new QnashowquestionForm($this, $this->question); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { - common_redirect($this->question->bestUrl(), 303); + common_redirect($this->question->getUrl(), 303); } } @@ -187,7 +185,7 @@ class QnaclosequestionAction extends Action * * @return boolean is read only action? */ - function isReadOnly($args) + function isReadOnly(array $args=array()) { if ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD') {