function hacked_reports_hacked_diff in Hacked! 7.2
Same name and namespace in other branches
- 5 hacked.diff.inc \hacked_reports_hacked_diff()
- 6.2 hacked.diff.inc \hacked_reports_hacked_diff()
- 6 hacked.diff.inc \hacked_reports_hacked_diff()
Shows 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
If the user is allowed to view the diff report, then a HTML diff report, otherwise a HTML error string.
1 string reference to 'hacked_reports_hacked_diff'
- hacked_menu in ./
hacked.module - Implementation of hook_menu().
File
- ./
hacked.diff.inc, line 17
Code
function hacked_reports_hacked_diff($project, $file) {
if (!module_exists('diff')) {
return t('The diff module is required to use this feature.');
}
$project
->identify_project();
// Find a better way to do this:
$breadcrumb = array(
l('Home', '<front>'),
l('Administer', 'admin'),
l('Reports', 'admin/reports'),
l('Hacked', 'admin/reports/hacked'),
l($project
->title(), 'admin/reports/hacked/' . $project->name),
);
drupal_set_breadcrumb($breadcrumb);
if ($project
->file_is_diffable($file)) {
return hacked_diff_changed($project, $file);
}
return t('Cannot hash binary file or file not found: %file', array(
'%file' => $file,
));
}