You are here

function diff_block_view in Diff 7.2

Same name and namespace in other branches
  1. 7.3 diff.module \diff_block_view()

Implements hook_block_view().

File

./diff.module, line 124
Provides functionality to show a diff between two node revisions.

Code

function diff_block_view($delta) {
  if ($delta === 'inline' && user_access('view revisions') && ($node = menu_get_object())) {
    $block = array();
    $revisions = node_revision_list($node);
    if (count($revisions) > 1) {
      $block['subject'] = t('Highlight changes');
      $block['content'] = drupal_get_form('diff_inline_form', $node, $revisions);
    }
    return $block;
  }
}