You are here

function faq_ask_edit in FAQ_Ask 6.2

Same name and namespace in other branches
  1. 6 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 155
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;
      drupal_goto("node/{$node->nid}/edit", 'ask=TRUE');
    }
    else {
      drupal_set_message(t('You are not allowed to edit that question.'), 'error');
    }
  }
  drupal_goto('node');
}