]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
QnA: Unify answer forms
authorZach Copley <zach@status.net>
Mon, 4 Apr 2011 19:02:33 +0000 (12:02 -0700)
committerZach Copley <zach@status.net>
Mon, 4 Apr 2011 19:02:33 +0000 (12:02 -0700)
plugins/QnA/QnAPlugin.php
plugins/QnA/lib/qnanewanswerform.php
plugins/QnA/lib/qnareviseanswerform.php

index 08a73031a50a9756a4a7703550a6f02f1abbd16a..a586d89b4094c274cab322978327268a3164279e 100644 (file)
@@ -391,7 +391,7 @@ class QnAPlugin extends MicroAppPlugin
             // Don't prompt user for an answer if the question is closed or
             // the current user posed the question in the first place
             if (empty($question->closed)) {
-                if (!empty($user) && ($user->id != $question->profile_id)) {
+                if (!empty($user)) {
                     $profile = $user->getProfile();
                     $answer = $question->getAnswer($profile);
                     if (!$answer) {
index 967b27e70cdcad868310c7a7be0c12b6ee163ccf..34e73def0adce5b9131504935d0766aa9342dd15 100644 (file)
@@ -103,9 +103,9 @@ class QnanewanswerForm extends Form
         $out      = $this->out;
         $id       = "question-" . $question->id;
 
-        $out->element('p', 'answer', $question->title);
+        $out->element('p', 'answer', 'Your answer');
         $out->hidden('id', $id);
-        $out->element('input', array('type' => 'text', 'name' => 'answer'));
+        $out->textarea('answer', 'answer');
     }
 
     /**
index f9ebae132c3d2e31b3bd34d4fe83f7540ff19e84..280dd74cd992e72af6587f0cf24ec349bf4b793c 100644 (file)
@@ -101,13 +101,11 @@ class QnareviseanswerForm extends Form
      */
     function formData()
     {
-        $out      = $this->out;
-
-        $out->element('p', 'Your answer to:', $this->question->title);
-
+        $out = $this->out;
+        $out->element('p', 'revise-answer', 'Your answer');
         $id = "answer-" . $this->answer->id;
         $out->hidden('id', $id);
-        $out->textarea('answer', 'You said:', $this->answer->content);
+        $out->textarea('answer', 'answer', $this->answer->content);
     }
 
     /**