You are here

function hook_content_lock_form_id_blacklist_alter in Content locking (anti-concurrent editing) 7.3

Same name and namespace in other branches
  1. 6.2 content_lock.api.inc \hook_content_lock_form_id_blacklist_alter()
  2. 7 content_lock.api.inc \hook_content_lock_form_id_blacklist_alter()
  3. 7.2 content_lock.api.php \hook_content_lock_form_id_blacklist_alter()

Alter the blacklist of form_ids.

Locking nodes referenced from certain form_ids, such as comment forms and the like, can supposedly be enabled or disabled here.

Parameters

array $blacklist: An array of blacklisted form_ids. Set $blacklist[<form_id>] = TRUE to blacklist <form_id> or unset($blacklist[<form_id>]) to unblacklist a form. Note that locking is not likely to work for every type of node form.

object $node: If available, the node being currently checked shalled be passed in. This may be useful for form_ids based on the nid of a node which certain modules might do with the help of hook_forms().

Related topics

1 invocation of hook_content_lock_form_id_blacklist_alter()
content_lock_content_lock_skip_locking in ./content_lock.module
Implements our own skip_locking api to implement our logic to skip locks.

File

./content_lock.api.php, line 134
Document content_lock hooks.

Code

function hook_content_lock_form_id_blacklist_alter(&$blacklist, $node = NULL) {

  /*
   * Disable locking an arbitrary form which happens to set
   * $form['nid'] and $form['#node'] to point to a node.
   */
  $blacklist['arbitrary_form'] = TRUE;
}