You are here

function _content_lock_save_lock_warning in Content locking (anti-concurrent editing) 7

Same name and namespace in other branches
  1. 6.2 content_lock.module \_content_lock_save_lock_warning()
  2. 6 content_lock.module \_content_lock_save_lock_warning()
  3. 7.3 includes/content_lock.func.inc \_content_lock_save_lock_warning()
  4. 7.2 content_lock.module \_content_lock_save_lock_warning()
1 call to _content_lock_save_lock_warning()
content_lock_warn_pending_locks in ./content_lock.module
For every lock a user current have on any nodes, print a warning messagt with an link to release this node.

File

./content_lock.module, line 697
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);
}