You are here

function faq_ask_edit in FAQ_Ask 6

Same name and namespace in other branches
  1. 6.2 faq_ask.module \faq_ask_edit()
  2. 7 faq_ask.module \faq_ask_edit()

Get the edit question form.

1 string reference to 'faq_ask_edit'
faq_ask_menu in ./faq_ask.module
Implementation of hook_menu().

File

./faq_ask.module, line 152
This module is an add-on to the FAQ module that allows users with the 'ask question' permission to create a question which will be queued for an 'expert' to answer.

Code

function faq_ask_edit($node) {
  global $user;
  if ($node->status == 1) {
    drupal_set_message(t('That question has already been answered.'), 'status');
  }
  else {
    if ($user->uid == $node->uid) {
      $form = drupal_get_form('faq_ask_form', NULL, $node);
      return $form;
    }
    else {
      drupal_set_message(t('You are not allowed to edit that question.'), 'error');
    }
  }
  drupal_goto('node');
}