You are here

API.txt in Content locking (anti-concurrent editing) 6

Same filename and directory in other branches
  1. 6.2 API.txt
  2. 7 API.txt
<h4>hook_content_lock_skip_locking($node, $form_id, $form, $form_state)</h4>
Implement this hook if you want to force the skipping of a using any reasons or logic you want.
Be sure to check $node for null, as it might not always be an object. 
If you return TRUE, the lock won't be applied (and this node will be skipped).

<h4>hook_content_lock_form_id_blacklist_alter(&$blacklist, $node = NULL)</h4>
Implement this hook to alter the blacklist of form_ids, where locking will be skipped.
As parameter you get the current node, if the object is preset. You can implement your own logic here.
If you want to blacklist a node type, add $blacklist['your_form_id'] = TRUE;

<h4>hook_content_lock_node_type_blacklist_alter(&$blacklist, $node)</h4>
Implement this hook to be able to alter the blacklist of node_types, where locking will be skipped.
This hook only gets called if a node object is set at all (as otherwise types wont be able to be checked).
If you want to blacklist a node type, set $blacklist['node_type'] = TRUE;.
As normal, node_type is the machine-name of the node type, not the human-readable name.

<h4>hook_content_lock_locked($nid, $uid)</h4>
This hook gets called when a lock gets set. Implement this if you want to trigger any actions when a lock gets applied.

<h4>hook_content_lock_released($nid)</h4>
This hook is called after a lock has been successfully released from the node identified by $nid.
Implement this to react to a node losing its lock.

File

API.txt
View source
  1. hook_content_lock_skip_locking($node, $form_id, $form, $form_state)

  2. Implement this hook if you want to force the skipping of a using any reasons or logic you want.
  3. Be sure to check $node for null, as it might not always be an object.
  4. If you return TRUE, the lock won't be applied (and this node will be skipped).
  5. hook_content_lock_form_id_blacklist_alter(&$blacklist, $node = NULL)

  6. Implement this hook to alter the blacklist of form_ids, where locking will be skipped.
  7. As parameter you get the current node, if the object is preset. You can implement your own logic here.
  8. If you want to blacklist a node type, add $blacklist['your_form_id'] = TRUE;
  9. hook_content_lock_node_type_blacklist_alter(&$blacklist, $node)

  10. Implement this hook to be able to alter the blacklist of node_types, where locking will be skipped.
  11. This hook only gets called if a node object is set at all (as otherwise types wont be able to be checked).
  12. If you want to blacklist a node type, set $blacklist['node_type'] = TRUE;.
  13. As normal, node_type is the machine-name of the node type, not the human-readable name.
  14. hook_content_lock_locked($nid, $uid)

  15. This hook gets called when a lock gets set. Implement this if you want to trigger any actions when a lock gets applied.
  16. hook_content_lock_released($nid)

  17. This hook is called after a lock has been successfully released from the node identified by $nid.
  18. Implement this to react to a node losing its lock.