]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/QnA/actions/qnanewanswer.php
Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase
[quix0rs-gnu-social.git] / plugins / QnA / actions / qnanewanswer.php
index 09d111040d15634c4522bf4f360e369b3b3fe884..94bfc09a39903da7d699ffe2b8a841870a25b0c1 100644 (file)
@@ -20,7 +20,7 @@
  * You should have received a copy of the GNU Affero General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
- * @category  QuestonAndAnswer
+ * @category  QnA
  * @package   StatusNet
  * @author    Zach Copley <zach@status.net>
  * @copyright 2011 StatusNet, Inc.
@@ -137,9 +137,11 @@ class QnanewanswerAction extends Action
      */
     function newAnswer()
     {
+        $profile = $this->user->getProfile();
+
         try {
             $notice = QnA_Answer::saveNew(
-                $this->user->getProfile(),
+                $profile,
                 $this->question,
                 $this->answerText
             );
@@ -150,6 +152,7 @@ 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');
@@ -158,7 +161,7 @@ class QnanewanswerAction extends Action
             $this->element('title', null, _m('Answers'));
             $this->elementEnd('head');
             $this->elementStart('body');
-            $this->raw()
+            $this->raw($answer->asHTML());
             $this->elementEnd('body');
             $this->elementEnd('html');
         } else {
@@ -177,7 +180,7 @@ class QnanewanswerAction extends Action
             $this->element('p', 'error', $this->error);
         }
 
-        $form = new QnaanswerForm($this->question, $this);
+        $form = new QnanewanswerForm($this->question, $this);
         $form->show();
 
         return;