]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/QnA/actions/qnanewanswer.php
Improved type-hint for following methods:
[quix0rs-gnu-social.git] / plugins / QnA / actions / qnanewanswer.php
index e565b3e93ade336e0e559ad875f61cdcd820478e..1a16a3fa6b9ad790950781b283d020825e729e22 100644 (file)
@@ -93,7 +93,7 @@ class QnanewanswerAction 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)) {
             throw new ClientException(
@@ -151,10 +151,8 @@ class QnanewanswerAction extends Action
         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'));
@@ -166,10 +164,10 @@ class QnanewanswerAction extends Action
             $nli->show();
 
             $this->elementEnd('body');
-            $this->elementEnd('html');
+            $this->endHTML();
         } else {
             common_debug("not ajax");
-            common_redirect($this->question->bestUrl(), 303);
+            common_redirect($this->question->getUrl(), 303);
         }
     }
 
@@ -199,7 +197,7 @@ class QnanewanswerAction 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') {
@@ -228,7 +226,7 @@ class QnanewanswerAction extends Action
         $this->elementStart('body');
         $this->element('p', array('id' => 'error'), $msg);
         $this->elementEnd('body');
-        $this->elementEnd('html');
+        $this->endHTML();
     }
 
     /**
@@ -254,7 +252,7 @@ class QnanewanswerAction extends Action
         $form->show();
 
         $this->elementEnd('body');
-        $this->elementEnd('html');
+        $this->endHTML();
     }
 
     /**
@@ -328,7 +326,7 @@ class NoticeAnswerListItem extends NoticeListItem
      */
     function showContent()
     {
-        $this->out->elementStart('p', array('class' => 'entry-content answer-content'));
+        $this->out->elementStart('p', array('class' => 'e-content answer-content'));
         if ($this->notice->rendered) {
             $this->out->raw($this->notice->rendered);
         } else {