]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/QnA/actions/qnanewanswer.php
Fix i18n issues.
[quix0rs-gnu-social.git] / plugins / QnA / actions / qnanewanswer.php
index 781ded36e6b96427c972b1b35e89114519f268ab..09d111040d15634c4522bf4f360e369b3b3fe884 100644 (file)
@@ -45,12 +45,12 @@ if (!defined('STATUSNET')) {
  */
 class QnanewanswerAction extends Action
 {
-    protected $user        = null;
-    protected $error       = null;
-    protected $complete    = null;
+    protected $user     = null;
+    protected $error    = null;
+    protected $complete = null;
 
-    protected $question    = null;
-    protected $content     = null;
+    protected $question = null;
+    protected $content  = null;
 
     /**
      * Returns the title of the action
@@ -91,19 +91,22 @@ class QnanewanswerAction extends Action
             $this->checkSessionToken();
         }
 
-        $id = $this->trimmed('id');
+        $id = substr($this->trimmed('id'), 9);
+
+        common_debug("XXXXXXXXXXXXXXXXXX id = " . $id);
+
         $this->question = QnA_Question::staticGet('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.'), 
+                _m('Invalid or missing question.'),
                 404
             );
         }
 
         $this->answerText = $this->trimmed('answer');
-        
+
         return true;
     }
 
@@ -145,8 +148,8 @@ class QnanewanswerAction extends Action
             $this->showPage();
             return;
         }
-
         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');
@@ -155,8 +158,7 @@ class QnanewanswerAction extends Action
             $this->element('title', null, _m('Answers'));
             $this->elementEnd('head');
             $this->elementStart('body');
-            $form = new QnaanswerForm($this->question, $this);
-            $form->show();
+            $this->raw()
             $this->elementEnd('body');
             $this->elementEnd('html');
         } else {
@@ -176,7 +178,6 @@ class QnanewanswerAction extends Action
         }
 
         $form = new QnaanswerForm($this->question, $this);
-
         $form->show();
 
         return;