Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 27... Línea 27...
27
use core\report_helper;
27
use core\report_helper;
Línea 28... Línea 28...
28
 
28
 
29
require('../../config.php');
29
require('../../config.php');
30
require_once($CFG->libdir.'/adminlib.php');
30
require_once($CFG->libdir.'/adminlib.php');
-
 
31
require_once($CFG->dirroot.'/course/lib.php');
Línea 31... Línea 32...
31
require_once($CFG->dirroot.'/course/lib.php');
32
global $SITE, $PAGE;
32
 
33
 
33
$id = optional_param('id', 0, PARAM_INT);
34
$id = optional_param('id', 0, PARAM_INT);
Línea -... Línea 35...
-
 
35
$page = optional_param('page', 0, PARAM_INT);
34
$page = optional_param('page', 0, PARAM_INT);
36
$logreader = optional_param('logreader', '', PARAM_COMPONENT); // Reader which will be used for displaying logs.
-
 
37
 
-
 
38
// Get course details.
-
 
39
if (!empty($id)) {
-
 
40
    $course = $DB->get_record('course', ['id' => $id], '*');
-
 
41
    if ($course) {
-
 
42
        require_login($course);
-
 
43
        $context = context_course::instance($course->id);
-
 
44
        $coursename = format_string($course->fullname, true, ['context' => $context]);
-
 
45
    }
35
$logreader = optional_param('logreader', '', PARAM_COMPONENT); // Reader which will be used for displaying logs.
46
}
36
 
47
 
37
if (empty($id)) {
48
if (empty($course)) {
38
    admin_externalpage_setup('reportloglive', '', null, '', array('pagelayout' => 'report'));
-
 
39
    $context = context_system::instance();
-
 
40
    $coursename = format_string($SITE->fullname, true, array('context' => $context));
-
 
41
} else {
-
 
42
    $course = get_course($id);
-
 
43
    require_login($course);
49
    admin_externalpage_setup('reportloglive', '', null, '', ['pagelayout' => 'report']);
44
    $context = context_course::instance($course->id);
50
    $context = context_system::instance();
Línea 45... Línea 51...
45
    $coursename = format_string($course->fullname, true, array('context' => $context));
51
    $coursename = format_string($SITE->fullname, true, ['context' => $context]);
46
}
52
}
Línea 58... Línea 64...
58
}
64
}
59
$url = new moodle_url("/report/loglive/index.php", $params);
65
$url = new moodle_url("/report/loglive/index.php", $params);
Línea 60... Línea 66...
60
 
66
 
61
$PAGE->set_url($url);
67
$PAGE->set_url($url);
-
 
68
$PAGE->set_pagelayout('report');
-
 
69
$PAGE->set_context($context);
-
 
70
$strlivelogs = get_string('livelogs', 'report_loglive');
-
 
71
$PAGE->set_title("$coursename: $strlivelogs");
-
 
72
$output = $PAGE->get_renderer('report_loglive');
-
 
73
echo $output->header();
-
 
74
if (!report_helper::has_valid_group($context)) {
-
 
75
    echo $output->notification(get_string('notingroup'));
-
 
76
    echo $output->footer();
-
 
77
    exit();
Línea 62... Línea 78...
62
$PAGE->set_pagelayout('report');
78
}
63
 
79
 
64
$renderable = new report_loglive_renderable($logreader, $id, $url, 0, $page);
80
$renderable = new report_loglive_renderable($logreader, $id, $url, 0, $page);
65
$refresh = $renderable->get_refresh_rate();
-
 
66
$logreader = $renderable->selectedlogreader;
-
 
67
 
81
$refresh = $renderable->get_refresh_rate();
68
$strlivelogs = get_string('livelogs', 'report_loglive');
-
 
69
$strupdatesevery = get_string('updatesevery', 'moodle', $refresh);
-
 
70
 
-
 
71
 
-
 
72
$PAGE->set_url($url);
-
 
73
$PAGE->set_context($context);
82
$logreader = $renderable->selectedlogreader;
Línea 74... Línea -...
74
$PAGE->set_title("$coursename: $strlivelogs");
-
 
75
$PAGE->set_heading($coursename);
-
 
76
 
-
 
77
$output = $PAGE->get_renderer('report_loglive');
83
$strupdatesevery = get_string('updatesevery', 'moodle', $refresh);
78
echo $output->header();
84
$PAGE->set_heading($coursename);
79
 
85
 
80
// Print selector dropdown.
86
// Print selector dropdown.
81
$pluginname = get_string('pluginname', 'report_loglive');
87
$pluginname = get_string('pluginname', 'report_loglive');