See Release Notes
Long Term Support Release
Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 403]
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 * Bulk activity completion selection 19 * 20 * @package core_completion 21 * @category completion 22 * @copyright 2017 Adrian Greeve 23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 24 */ 25 26 require_once(__DIR__.'/../config.php'); 27 require_once($CFG->dirroot.'/course/lib.php'); 28 require_once($CFG->libdir.'/completionlib.php'); 29 30 $id = required_param('id', PARAM_INT); // Course id. 31 32 // Perform some basic access control checks. 33 if ($id) { 34 35 if ($id == SITEID) { 36 // Don't allow editing of 'site course' using this form. 37 throw new \moodle_exception('cannoteditsiteform'); 38 } 39 40 if (!$course = $DB->get_record('course', array('id' => $id))) { 41 throw new \moodle_exception('invalidcourseid'); 42 } 43 require_login($course); 44 require_capability('moodle/course:manageactivities', context_course::instance($course->id)); 45 46 } else { 47 require_login(); 48 throw new \moodle_exception('needcourseid'); 49 } 50 51 // Set up the page. 52 navigation_node::override_active_url(new moodle_url('/course/completion.php', array('id' => $course->id))); 53 $PAGE->set_course($course); 54 $PAGE->set_url('/course/defaultcompletion.php', array('id' => $course->id)); 55 $PAGE->set_title($course->shortname); 56 $PAGE->set_heading($course->fullname); 57 $PAGE->set_pagelayout('admin'); 58 59 // Get all that stuff I need for the renderer. 60 $manager = new \core_completion\manager($id); 61 $activityresourcedata = $manager->get_activities_and_resources(); 62 63 $renderer = $PAGE->get_renderer('core_course', 'bulk_activity_completion'); 64 65 // Print the form. 66 echo $OUTPUT->header(); 67 68 $actionbar = new \core_course\output\completion_action_bar($course->id, $PAGE->url); 69 echo $renderer->render_course_completion_action_bar($actionbar); 70 71 echo $OUTPUT->heading(get_string('defaultcompletion', 'completion')); 72 73 $PAGE->requires->js_call_amd('core_form/changechecker', 'watchFormById', ['theform']); 74 75 echo $renderer->defaultcompletion($activityresourcedata); 76 77 echo $OUTPUT->footer();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body