X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FQnA%2Factions%2Fqnareviseanswer.php;h=43ce50429c1cdb9838dee790efcab8dfc9d562b9;hb=627d84a1e2db2aca5d2ce1272f6e83fb7faa8ad2;hp=ce4bdea56ac5bcdb36799a7625ac17c65be96956;hpb=cb183359e23ae7a5cfb483fa06c6c4b7a8b05fff;p=quix0rs-gnu-social.git diff --git a/plugins/QnA/actions/qnareviseanswer.php b/plugins/QnA/actions/qnareviseanswer.php index ce4bdea56a..43ce50429c 100644 --- a/plugins/QnA/actions/qnareviseanswer.php +++ b/plugins/QnA/actions/qnareviseanswer.php @@ -88,7 +88,7 @@ class QnareviseanswerAction extends Action $id = substr($this->trimmed('id'), 7); - $this->answer = QnA_Answer::staticGet('id', $id); + $this->answer = QnA_Answer::getKV('id', $id); $this->question = $this->answer->getQuestion(); if (empty($this->answer) || empty($this->question)) { @@ -155,9 +155,7 @@ class QnareviseanswerAction extends Action } 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')); @@ -166,9 +164,9 @@ class QnareviseanswerAction extends Action $form = new QnashowanswerForm($this, $answer); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { - common_redirect($this->answer->bestUrl(), 303); + common_redirect($this->answer->getUrl(), 303); } } @@ -199,9 +197,7 @@ class QnareviseanswerAction extends Action } 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')); @@ -210,9 +206,9 @@ class QnareviseanswerAction extends Action $form = new QnashowanswerForm($this, $answer); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { - common_redirect($this->answer->bestUrl(), 303); + common_redirect($this->answer->getUrl(), 303); } } @@ -239,9 +235,7 @@ class QnareviseanswerAction extends Action 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')); @@ -250,7 +244,7 @@ class QnareviseanswerAction extends Action $form = new QnareviseanswerForm($this->answer, $this); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } /** @@ -262,7 +256,7 @@ class QnareviseanswerAction 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') {