';
if ($mode == "outline") {
echo "
";
}
foreach ($modinfo->sections[$i] as $cmid) {
$mod = $modinfo->cms[$cmid];
if (empty($mod->uservisible)) {
continue;
}
$instance = $DB->get_record("$mod->modname", array("id"=>$mod->instance));
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
if (file_exists($libfile)) {
require_once($libfile);
switch ($mode) {
case "outline":
$user_outline = $mod->modname."_user_outline";
if (function_exists($user_outline)) {
$output = $user_outline($course, $user, $mod, $instance);
} else {
$output = report_outline_user_outline($user->id, $cmid, $mod->modname, $instance->id);
}
report_outline_print_row($mod, $instance, $output);
break;
case "complete":
$user_complete = $mod->modname."_user_complete";
$image = $OUTPUT->pix_icon('icon', $mod->modfullname, 'mod_'.$mod->modname, array('class'=>'icon'));
echo "";
ob_start();
echo "";
if (function_exists($user_complete)) {
$user_complete($course, $user, $mod, $instance);
} else {
echo report_outline_user_complete($user->id, $cmid, $mod->modname, $instance->id);
}
echo "
";
$output = ob_get_contents();
ob_end_clean();
if (str_replace(' ', '', $output) != '') {
echo $output;
}
break;
}
}
}
if ($mode == "outline") {
echo "
";
}
echo '