function _answers_notify_form_alter in Answers 6
Same name and namespace in other branches
- 7 includes/answers.notify.inc \_answers_notify_form_alter()
- 7.2 includes/answers.notify.inc \_answers_notify_form_alter()
1 call to _answers_notify_form_alter()
File
- includes/
answers.notify.inc, line 58 - Notification functions for the 'Answers' module
Code
function _answers_notify_form_alter(&$form, $form_state, $form_id) {
global $user;
// Hide the option to get notifications by email if the user is anonymous
if ($form_id == 'question_node_form' && $user->uid == 0) {
$form['field_notify_p'][0]['#default_value']['value'] = 0;
$form['field_notify_p']['#prefix'] = '<div style="display: none;">';
$form['field_notify_p']['#suffix'] = '</div>';
}
}