You are here

function _content_lock_show_warnings in Content locking (anti-concurrent editing) 6

Same name and namespace in other branches
  1. 6.2 content_lock.module \_content_lock_show_warnings()
  2. 7.3 includes/content_lock.func.inc \_content_lock_show_warnings()
  3. 7 content_lock.module \_content_lock_show_warnings()
  4. 7.2 content_lock.module \_content_lock_show_warnings()
1 call to _content_lock_show_warnings()
content_lock_nodeapi in ./content_lock.module
Implementation of hook_nodeapi().

File

./content_lock.module, line 548
Allows users to lock documents for modification.

Code

function _content_lock_show_warnings() {
  global $user;
  if (empty($_SESSION['content_lock'])) {
    return;
  }
  $data = unserialize($_SESSION['content_lock']);
  if (!is_array($data) || count($data) == 0) {
    return;
  }
  foreach ($data as $nid => $messsage) {
    if (_content_lock_still_locked($user->uid, $nid) > 0) {
      drupal_set_message($messsage, 'warning');
    }
  }
  $_SESSION['content_lock'] = '';
}