function diff_block_view

cis7 diff.module diff_block_view($delta)
cle7 diff.module diff_block_view($delta)
elmsmedia7 diff.module diff_block_view($delta)
icor7 diff.module diff_block_view($delta)
meedjum_blog7 diff.module diff_block_view($delta)
mooc7 diff.module diff_block_view($delta)

Implements hook_block_view().

File

sites/all/modules/ulmus/diff/diff.module, line 285
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()) && arg(2) !== 'edit') {
    $enabled_types = variable_get('diff_show_diff_inline_node_bundles', array());
    if (!empty($enabled_types[$node->type])) {
      $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;
    }
  }
}