function answers_question_locked_p in Answers 7.4
Indicate whether a question is locked or not.
Parameters
object $question: A question node.
3 calls to answers_question_locked_p()
- answers_best_answer_flag_access in answers_best_answer/
answers_best_answer.module - Implements hook_flag_access().
- answers_create_answer_permission_p in ./
answers.module - Checks permissions access.
- answers_node_view in ./
answers.module - Implements hook_node_view().
File
- includes/
answers.lock.inc, line 132 - Question locking functions for the 'Answers' module.
Code
function answers_question_locked_p($question) {
$items = field_get_items('node', $question, 'question_locks');
if (!$items) {
return FALSE;
}
$modules = array();
foreach ($items as $module) {
$modules[] = $module['value'];
}
// Compare the list with only currently locking modules.
return count(array_intersect($modules, answers_locking_modules())) > 0;
}