Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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.
13
//
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/>.
16
 
17
/**
18
 * Libs, public API.
19
 *
20
 * NOTE: page type not included because there can not be any blocks in popups
21
 *
22
 * @package    report_loglive
23
 * @copyright  2011 Petr Skoda
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 */
26
 
1441 ariadna 27
use core\report_helper;
28
 
1 efrain 29
defined('MOODLE_INTERNAL') || die;
30
 
31
/**
32
 * This function extends the navigation with the report items
33
 *
34
 * @global stdClass $CFG
35
 * @global core_renderer $OUTPUT
36
 * @param navigation_node $navigation The navigation node to extend
37
 * @param stdClass        $course     The course to object for the report
38
 * @param context         $context    The context of the course
39
 */
40
function report_loglive_extend_navigation_course($navigation, $course, $context) {
1441 ariadna 41
    if (
42
        has_capability('report/log:view', $context)
43
        && report_helper::has_valid_group($context)
44
    ) {
1 efrain 45
        $url = new moodle_url('/report/loglive/index.php', array('id' => $course->id));
46
        $navigation->add(get_string('pluginname', 'report_loglive'), $url, navigation_node::TYPE_SETTING, null, null,
47
                new pix_icon('i/report', ''));
48
    }
49
}
50
 
51
/**
52
 * Callback to verify if the given instance of store is supported by this report or not.
53
 *
54
 * @param string $instance store instance.
55
 *
56
 * @return bool returns true if the store is supported by the report, false otherwise.
57
 */
58
function report_loglive_supports_logstore($instance) {
59
    if ($instance instanceof \core\log\sql_reader) {
60
        return true;
61
    }
62
    return false;
63
}