function _content_lock_save_lock_warning in Content locking (anti-concurrent editing) 7.2
Same name and namespace in other branches
- 6.2 content_lock.module \_content_lock_save_lock_warning()
- 6 content_lock.module \_content_lock_save_lock_warning()
- 7.3 includes/content_lock.func.inc \_content_lock_save_lock_warning()
- 7 content_lock.module \_content_lock_save_lock_warning()
Save lock warning.
Parameters
string $message: Message string.
int $nid: Node id.
1 call to _content_lock_save_lock_warning()
- content_lock_warn_pending_locks in ./
content_lock.module - Warn pending locks.
File
- ./
content_lock.module, line 942 - Allows users to lock documents for modification.
Code
function _content_lock_save_lock_warning($message, $nid) {
if (empty($_SESSION['content_lock'])) {
$_SESSION['content_lock'] = '';
}
$data = unserialize($_SESSION['content_lock']);
if (!is_array($data)) {
$data = array();
}
if (array_key_exists($nid, $data)) {
return;
}
$data[$nid] = $message;
$_SESSION['content_lock'] = serialize($data);
}