MDL-40913 core_message: removed 'view' add_to_log call
[moodle.git] / report / outline / locallib.php
blobba4761cc55812554dbc70e5390096610c5db5d04
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
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.
8 //
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/>.
17 /**
18 * This file contains functions used by the outline reports
20 * @package report
21 * @subpackage outline
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) {
32 global $OUTPUT, $CFG;
34 $image = "<img src=\"" . $OUTPUT->pix_url('icon', $mod->modname) . "\" class=\"icon\" alt=\"$mod->modfullname\" />";
36 echo "<tr>";
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>&nbsp;&nbsp;&nbsp;</td>";
42 echo "<td valign=\"top\">";
43 if (isset($result->info)) {
44 echo "$result->info";
45 } else {
46 echo "<p style=\"text-align:center\">-</p>";
48 echo "</td>";
49 echo "<td>&nbsp;&nbsp;&nbsp;</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>";
54 echo "</tr>";