| Línea 22... |
Línea 22... |
| 22 |
* @package report_log
|
22 |
* @package report_log
|
| 23 |
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
|
23 |
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
|
| 24 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
24 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 25 |
*/
|
25 |
*/
|
| Línea -... |
Línea 26... |
| - |
|
26 |
|
| - |
|
27 |
use core\report_helper;
|
| 26 |
|
28 |
|
| Línea 27... |
Línea 29... |
| 27 |
defined('MOODLE_INTERNAL') || die;
|
29 |
defined('MOODLE_INTERNAL') || die;
|
| 28 |
|
30 |
|
| 29 |
/**
|
31 |
/**
|
| 30 |
* This function extends the navigation with the report items
|
32 |
* This function extends the navigation with the report items
|
| 31 |
*
|
33 |
*
|
| 32 |
* @param navigation_node $navigation The navigation node to extend
|
34 |
* @param navigation_node $navigation The navigation node to extend
|
| 33 |
* @param stdClass $course The course to object for the report
|
35 |
* @param stdClass $course The course to object for the report
|
| 34 |
* @param stdClass $context The context of the course
|
36 |
* @param stdClass $context The context of the course
|
| - |
|
37 |
*/
|
| 35 |
*/
|
38 |
function report_log_extend_navigation_course($navigation, $course, $context) {
|
| - |
|
39 |
if (
|
| - |
|
40 |
has_capability('report/log:view', $context)
|
| 36 |
function report_log_extend_navigation_course($navigation, $course, $context) {
|
41 |
&& report_helper::has_valid_group($context)
|
| 37 |
if (has_capability('report/log:view', $context)) {
|
42 |
) {
|
| 38 |
$url = new moodle_url('/report/log/index.php', array('id'=>$course->id));
|
43 |
$url = new moodle_url('/report/log/index.php', array('id'=>$course->id));
|
| 39 |
$navigation->add(get_string('pluginname', 'report_log'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
|
44 |
$navigation->add(get_string('pluginname', 'report_log'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
|
| Línea 122... |
Línea 127... |
| 122 |
*
|
127 |
*
|
| 123 |
* @param navigation_node $navigation The navigation node to extend
|
128 |
* @param navigation_node $navigation The navigation node to extend
|
| 124 |
* @param stdClass $cm
|
129 |
* @param stdClass $cm
|
| 125 |
*/
|
130 |
*/
|
| 126 |
function report_log_extend_navigation_module($navigation, $cm) {
|
131 |
function report_log_extend_navigation_module($navigation, $cm) {
|
| - |
|
132 |
if (
|
| 127 |
if (has_capability('report/log:view', context_course::instance($cm->course))) {
|
133 |
has_capability('report/log:view', context_course::instance($cm->course))
|
| - |
|
134 |
&& report_helper::has_valid_group(context_module::instance($cm->id))
|
| - |
|
135 |
) {
|
| 128 |
$url = new moodle_url('/report/log/index.php', array('chooselog'=>'1','id'=>$cm->course,'modid'=>$cm->id));
|
136 |
$url = new moodle_url('/report/log/index.php', [
|
| - |
|
137 |
'chooselog' => '1',
|
| - |
|
138 |
'id' => $cm->course,
|
| - |
|
139 |
'modid' => $cm->id,
|
| - |
|
140 |
'isactivitypage' => '1',
|
| - |
|
141 |
]);
|
| 129 |
$navigation->add(get_string('logs'), $url, navigation_node::TYPE_SETTING, null, 'logreport', new pix_icon('i/report', ''));
|
142 |
$navigation->add(get_string('logs'), $url, navigation_node::TYPE_SETTING, null, 'logreport', new pix_icon('i/report', ''));
|
| 130 |
}
|
143 |
}
|
| 131 |
}
|
144 |
}
|
| Línea 132... |
Línea 145... |
| 132 |
|
145 |
|