function content_lock_node_view in Content locking (anti-concurrent editing) 7.2
Same name and namespace in other branches
- 7.3 content_lock.module \content_lock_node_view()
- 7 content_lock.module \content_lock_node_view()
Implements hook_node_view().
File
- ./
content_lock.module, line 248 - Allows users to lock documents for modification.
Code
function content_lock_node_view($node, $view_mode, $langcode) {
global $user;
static $messages_shown = FALSE;
if ($view_mode != 'full' || !_content_lock_is_lockable_node($node)) {
return;
}
if (!$messages_shown) {
_content_lock_show_warnings();
$messages_shown = TRUE;
}
if (empty($node->in_preview)) {
// Check if the user has pending locks and warn him.
content_lock_warn_pending_locks($user->uid);
}
}