2 // This file is part of Moodle - http://moodle.org/
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 * This file contains functions used by the outline reports
22 * @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 defined('MOODLE_INTERNAL') ||
die;
28 require_once(dirname(__FILE__
).'/lib.php');
29 require_once($CFG->dirroot
.'/course/lib.php');
31 function report_outline_print_row($mod, $instance, $result) {
34 $image = "<img src=\"" . $OUTPUT->pix_url('icon', $mod->modname
) . "\" class=\"icon\" alt=\"$mod->modfullname\" />";
37 echo "<td valign=\"top\">$image</td>";
38 echo "<td valign=\"top\" style=\"width:300\">";
39 echo " <a title=\"$mod->modfullname\"";
40 echo " href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".format_string($instance->name
,true)."</a></td>";
41 echo "<td> </td>";
42 echo "<td valign=\"top\">";
43 if (isset($result->info
)) {
46 echo "<p style=\"text-align:center\">-</p>";
49 echo "<td> </td>";
50 if (!empty($result->time
)) {
51 $timeago = format_time(time() - $result->time
);
52 echo "<td valign=\"top\" style=\"white-space: nowrap\">".userdate($result->time
)." ($timeago)</td>";