You are here

function hook_workbench_block in Workbench 7

Same name and namespace in other branches
  1. 8 workbench.api.php \hook_workbench_block()

Return Workbench status information in a block.

To reduce clutter, modules are encouraged to use this hook to provide debugging and other relevant information.

Return value

An array of message strings to print. The preferred format is a one line string in the format Title: <em>Message</em>.

See also

workbench_block_view().

1 invocation of hook_workbench_block()
workbench_block_view in ./workbench.module
Implements hook_block_view().

File

./workbench.api.php, line 74
API documentation file for Workbench.

Code

function hook_workbench_block() {

  // Add editing information to this page (if it's a node).
  if ($node = menu_get_object()) {
    if (node_access('update', $node)) {
      return array(
        t('My Module: <em>You may not edit this content.</em>'),
      );
    }
    else {
      return array(
        t('My Module: <em>You may edit this content.</em>'),
      );
    }
  }
}