You are here

function simpleanswer_view in Answers 5.2

File

simpleanswer/simpleanswer.module, line 92
Adds a simple form to post a response/answer to questions using the answers module. This module does not display its content directly and requires the answers module to show its content.

Code

function simpleanswer_view(&$node, $teaser = 0, $page = 0) {
  $node = node_prepare($node, $teaser);
  if ($page) {
    $qid = answers_answersapi('question', $node->nid);
    drupal_goto('node/' . $qid);
  }
  $node->content['body']['#value'] = theme('simpleanswer_content', $node, $teaser, $page);
  return $node;
}