You are here

function workbench_moderation_messages_shown in Workbench Moderation 7

Same name and namespace in other branches
  1. 7.3 workbench_moderation.module \workbench_moderation_messages_shown()

Prevent multiple moderation status.

This function is a helper called from workbench_moderation_messages(). If the same node node_view() called multiple times in a page request there could be duplicate messages.

Parameters

$context: A string, either 'view' or 'edit'. Currently only "view" is implemented.

$node: A node object for which workbench_moderation_messages() is adding messages.

Return value

BOOL TRUE or FALSE for whether the given node has had messages added in the given context.

1 call to workbench_moderation_messages_shown()
workbench_moderation_messages in ./workbench_moderation.module
Sets status messages for a node.

File

./workbench_moderation.module, line 2111
Content moderation for Workbench.

Code

function workbench_moderation_messages_shown($context, $node) {
  $shown =& drupal_static(__FUNCTION__);
  if (!empty($shown[$context][$node->nid])) {
    return TRUE;
  }
  $shown[$context][$node->nid] = TRUE;
  return FALSE;
}