function faq_ask_submit in FAQ_Ask 7
Same name and namespace in other branches
- 8 faq_ask.module \faq_ask_submit()
- 6.2 faq_ask.module \faq_ask_submit()
Handles the ask form submission
Parameters
array $form: The form being posted
array $form_state: Array containing the posted values
1 string reference to 'faq_ask_submit'
- faq_ask_form_faq_node_form_alter in ./
faq_ask.module - Implements hook_form_FORM_ID_alter().
File
- ./
faq_ask.module, line 641 - 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_submit($form, &$form_state) {
global $user;
if ($form_state['values']['op'] != t('Save')) {
// If we're not saving then do not do actions
return;
}
// Issue #1554912 by jlea9378: Access Denied for Anonymous
if (!user_access('view own unpublished content') || $user->uid == 0) {
$form_state['redirect'] = array(
'faq-page',
);
// Redirect to faq-page if the user is not allowed to view content
}
}