function answers_lock_example_settings_form_submit in Answers 7.4
Process answers_lock configuration settings.
When the configuration setting changes, reset all question locks. Some *other* module may still want a question locked. If *any* module wants a question locked, then it is locked. Otherwise, it is unlocked.
1 string reference to 'answers_lock_example_settings_form_submit'
- answers_lock_example_form_alter in answers_lock_example/
answers_lock_example.module - Implements hook_form_alter().
File
- answers_lock_example/
answers_lock_example.module, line 93 - Example module of the question 'lock'.
Code
function answers_lock_example_settings_form_submit($form, &$form_state) {
module_load_include('inc', 'answers', 'includes/answers.lock');
$new = $form_state['values']['answers_lock_example_lock_questions_p'];
$old = $form_state['values']['answers_lock_example_old_lock_questions_p'];
if ($old != $new) {
drupal_set_message($new ? 'Questions have been locked.' : 'Questions have been unlocked (unless they are locked for another reason)');
answers_reset_lock_info();
}
}