You are here

function simpleanswer_form in Answers 5.2

Implementation of hook_form().

1 call to simpleanswer_form()
simpleanswer_answers in simpleanswer/simpleanswer.module
Implementation of AnswersAPI.

File

simpleanswer/simpleanswer.module, line 71
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_form(&$node) {
  if (!arg(3) && arg(2) != 'edit') {
    drupal_goto();
  }
  $type = node_get_types('type', $node);
  $form['body'] = array(
    '#type' => 'textarea',
    '#title' => check_plain($type->body_label),
    '#default_value' => $node->body,
    '#rows' => 3,
    '#cols' => 60,
    '#attributes' => array(
      'class' => 'mceNoEditor',
    ),
    '#required' => TRUE,
  );
  $form['#attributes'] = array(
    'class' => 'subscription_box',
  );
  $form['body_filter']['filter'] = filter_form($node->format);
  return $form;
}