You are here

function hacked_diff_changed in Hacked! 7.2

Same name and namespace in other branches
  1. 5 hacked.diff.inc \hacked_diff_changed()
  2. 6.2 hacked.diff.inc \hacked_diff_changed()
  3. 6 hacked.diff.inc \hacked_diff_changed()

Generate a diff report for a specific file in a project.

Parameters

$project: The hackedProject instance.

$file: The file to diff within the project.

Return value

A HTML diff report.

1 call to hacked_diff_changed()
hacked_reports_hacked_diff in ./hacked.diff.inc
Shows a diff report for a specific file in a project.

File

./hacked.diff.inc, line 52

Code

function hacked_diff_changed($project, $file) {
  $original_file = $project
    ->file_get_location('remote', $file);
  $installed_file = $project
    ->file_get_location('local', $file);
  $hasher = hacked_get_file_hasher();
  $output = theme('table', array(
    'header' => array(
      t('Original'),
      '',
      t('Current'),
      '',
    ),
    'rows' => diff_get_rows($hasher
      ->fetch_lines($original_file), $hasher
      ->fetch_lines($installed_file), TRUE),
  ));
  return $output;
}