Permalink
Browse files

MDL-29368 Assignment: Fixed a fatal error caused by a missing include

  • Loading branch information...
1 parent abd481c commit a558511b859ccb51b504851ed33dcc32bcd6b7e1 Stephen Bourget committed with stronk7 Oct 19, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 mod/assignment/renderer.php
@@ -66,7 +66,12 @@ protected function htmllize_tree($tree, $dir) {
foreach ($dir['files'] as $file) {
$filename = $file->get_filename();
$icon = mimeinfo("icon", $filename);
- $plagiarsmlinks = plagiarism_get_links(array('userid'=>$file->get_userid(), 'file'=>$file, 'cmid'=>$tree->cm->id, 'course'=>$tree->course));
+ if ($CFG->enableplagiarism) {
+ require_once($CFG->libdir.'/plagiarismlib.php');
+ $plagiarsmlinks = plagiarism_get_links(array('userid'=>$file->get_userid(), 'file'=>$file, 'cmid'=>$tree->cm->id, 'course'=>$tree->course));
+ } else {
+ $plagiarsmlinks = '';
+ }
$image = $this->output->pix_icon("f/$icon", $filename, 'moodle', array('class'=>'icon'));
$result .= '<li yuiConfig=\''.json_encode($yuiconfig).'\'><div>'.$image.' '.$file->fileurl.' '.$plagiarsmlinks.$file->portfoliobutton.'</div></li>';
}

0 comments on commit a558511

Please sign in to comment.