You are here

function diff_block_view in Diff 7.3

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

Implements hook_block_view().

File

./diff.module, line 331
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 = diff_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;
    }
  }
}