]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/QnA/actions/qnanewanswer.php
Update translator documentation.
[quix0rs-gnu-social.git] / plugins / QnA / actions / qnanewanswer.php
index 6815abd79897418321c1b40ab6187fedf2c3b2b3..e565b3e93ade336e0e559ad875f61cdcd820478e 100644 (file)
@@ -80,8 +80,8 @@ class QnanewanswerAction extends Action
         $this->user = common_current_user();
 
         if (empty($this->user)) {
-            // TRANS: Client exception thrown trying to answer a question while not logged in.
             throw new ClientException(
+                // TRANS: Client exception thrown trying to answer a question while not logged in.
                 _m("You must be logged in to answer to a question."),
                 403
             );
@@ -96,8 +96,8 @@ class QnanewanswerAction extends Action
         $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(
+                // TRANS: Client exception thrown trying to respond to a non-existing question.
                 _m('Invalid or missing question.'),
                 404
             );
@@ -162,13 +162,13 @@ class QnanewanswerAction extends Action
 
             $this->elementStart('body');
 
-            
             $nli = new NoticeAnswerListItem($notice, $this, $this->question, $answer);
             $nli->show();
-  
+
             $this->elementEnd('body');
             $this->elementEnd('html');
         } else {
+            common_debug("not ajax");
             common_redirect($this->question->bestUrl(), 303);
         }
     }
@@ -223,7 +223,7 @@ class QnanewanswerAction extends Action
         $this->startHTML('text/xml;charset=utf-8', true);
         $this->elementStart('head');
         // TRANS: Page title after an AJAX error occurs on the post answer page.
-        $this->element('title', null, _('Ajax Error'));
+        $this->element('title', null, _m('Ajax Error'));
         $this->elementEnd('head');
         $this->elementStart('body');
         $this->element('p', array('id' => 'error'), $msg);
@@ -277,7 +277,6 @@ class QnanewanswerAction extends Action
         $this->msg = $msg;
         $this->showPage();
     }
-
 }
 
 class NoticeAnswerListItem extends NoticeListItem
@@ -343,10 +342,10 @@ class NoticeAnswerListItem extends NoticeListItem
             $form = new QnashowanswerForm($this->out, $this->answer);
             $form->show();
         } else {
+            // TRANS: Error message displayed when an answer has no content.
             $out->text(_m('Answer data is missing.'));
         }
 
         $this->out->elementEnd('p');
     }
-
-}
\ No newline at end of file
+}