* StatusNet - the distributed open-source microblogging tool
* Copyright (C) 2011, StatusNet, Inc.
*
- * Answer a question
+ * Vote on a question or answer
*
* PHP version 5
*
* 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.
}
/**
- * Answer a question
+ * Vote on a question or answer
*
* @category QnA
* @package StatusNet
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-class AnswerAction extends Action
+class Qnavote extends Action
{
protected $user = null;
protected $error = null;
protected $complete = null;
- protected $qustion = null;
+ protected $question = null;
protected $answer = null;
/**
if (empty($this->user)) {
// TRANS: Client exception thrown trying to answer a question while not logged in.
- throw new ClientException(_m("You must be logged in to answer to a question."),
+ throw new ClientException(_m('You must be logged in to answer to a question.'),
403);
}
}
$id = $this->trimmed('id');
- $this->question = Question::staticGet('id', $id);
+ $this->question = QnA_Question::getKV('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.'), 404);
$this->xw->startDocument('1.0', 'UTF-8');
$this->elementStart('html');
$this->elementStart('head');
- // TRANS: Page title after sending an answer.
+ // TRANS: Page title after sending in a vote for a question or answer.
$this->element('title', null, _m('Answers'));
$this->elementEnd('head');
$this->elementStart('body');
- $form = new Answer($this->question, $this);
+ $form = new QnA_Answer($this->question, $this);
$form->show();
$this->elementEnd('body');
$this->elementEnd('html');
$this->element('p', 'error', $this->error);
}
- $form = new AnswerForm($this->question, $this);
+ $form = new QnaanswerForm($this->question, $this);
$form->show();