1441 |
ariadna |
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 |
* Course activities overview page.
|
|
|
19 |
*
|
|
|
20 |
* @package core_course
|
|
|
21 |
* @copyright 2025 Ferran Recio <ferran@moodle.com>
|
|
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
require_once('../config.php');
|
|
|
26 |
require_once('lib.php');
|
|
|
27 |
require_once($CFG->libdir . '/completionlib.php');
|
|
|
28 |
|
|
|
29 |
$courseid = required_param('id', PARAM_INT);
|
|
|
30 |
// The expand param is just a quick way of expanding a specific activity type so it
|
|
|
31 |
// does not require javascript to expand it. It is mostly used to accelerate behats.
|
|
|
32 |
$expand = optional_param_array('expand', [], PARAM_ALPHANUM);
|
|
|
33 |
|
|
|
34 |
$PAGE->set_url('/course/overview.php', ['id' => $courseid]);
|
|
|
35 |
|
|
|
36 |
$course = get_course($courseid);
|
|
|
37 |
|
|
|
38 |
$context = context_course::instance($course->id, MUST_EXIST);
|
|
|
39 |
|
|
|
40 |
require_login($course);
|
|
|
41 |
require_capability('moodle/course:viewoverview', $context);
|
|
|
42 |
|
|
|
43 |
// Trigger event, course information viewed.
|
|
|
44 |
$event = \core\event\course_overview_viewed::create(['context' => $context]);
|
|
|
45 |
$event->add_record_snapshot('course', $course);
|
|
|
46 |
$event->trigger();
|
|
|
47 |
|
|
|
48 |
$format = course_get_format($course);
|
|
|
49 |
$renderer = $format->get_renderer($PAGE);
|
|
|
50 |
$overviewpageclass = $format->get_output_classname('overview\\overviewpage');
|
|
|
51 |
/** @var core_courseformat\output\local\overview\overviewpage $overview */
|
|
|
52 |
$overview = new $overviewpageclass($course, $expand);
|
|
|
53 |
|
|
|
54 |
$PAGE->set_pagelayout('incourse');
|
|
|
55 |
|
|
|
56 |
$PAGE->set_title(get_string('overview_page_title', 'course', $course->fullname));
|
|
|
57 |
$PAGE->set_heading($course->fullname);
|
|
|
58 |
include_course_ajax($course);
|
|
|
59 |
|
|
|
60 |
echo $renderer->header();
|
|
|
61 |
|
|
|
62 |
echo $renderer->heading(get_string('activities'), 2, 'h4');
|
|
|
63 |
echo $renderer->paragraph(get_string('overview_info', 'course'));
|
|
|
64 |
|
|
|
65 |
echo $renderer->render($overview);
|
|
|
66 |
|
|
|
67 |
echo $renderer->footer();
|