mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
Merge branch 'MDL-74238' of https://github.com/paulholden/moodle
This commit is contained in:
commit
21b39e2f53
@ -284,46 +284,10 @@ class manager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the available completion tabs for the current course and user.
|
||||
*
|
||||
* @deprecated since Moodle 4.0
|
||||
* @param stdClass|int $courseorid the course object or id.
|
||||
* @return tabobject[]
|
||||
*/
|
||||
public static function get_available_completion_tabs($courseorid) {
|
||||
debugging('get_available_completion_tabs() has been deprecated. Please use ' .
|
||||
'core_completion\manager::get_available_completion_options() instead.', DEBUG_DEVELOPER);
|
||||
|
||||
$tabs = [];
|
||||
|
||||
$courseid = is_object($courseorid) ? $courseorid->id : $courseorid;
|
||||
$coursecontext = context_course::instance($courseid);
|
||||
|
||||
if (has_capability('moodle/course:update', $coursecontext)) {
|
||||
$tabs[] = new tabobject(
|
||||
'completion',
|
||||
new moodle_url('/course/completion.php', ['id' => $courseid]),
|
||||
new lang_string('coursecompletion', 'completion')
|
||||
);
|
||||
}
|
||||
|
||||
if (has_capability('moodle/course:manageactivities', $coursecontext)) {
|
||||
$tabs[] = new tabobject(
|
||||
'defaultcompletion',
|
||||
new moodle_url('/course/defaultcompletion.php', ['id' => $courseid]),
|
||||
new lang_string('defaultcompletion', 'completion')
|
||||
);
|
||||
}
|
||||
|
||||
if (self::can_edit_bulk_completion($courseorid)) {
|
||||
$tabs[] = new tabobject(
|
||||
'bulkcompletion',
|
||||
new moodle_url('/course/bulkcompletion.php', ['id' => $courseid]),
|
||||
new lang_string('bulkactivitycompletion', 'completion')
|
||||
);
|
||||
}
|
||||
|
||||
return $tabs;
|
||||
public static function get_available_completion_tabs() {
|
||||
throw new \coding_exception(__FUNCTION__ . '() has been removed.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,9 @@ information provided here is intended especially for developers.
|
||||
=== 4.4 ===
|
||||
* A new method, cm_completion_details::is_overall_complete() has been added to calculate whether a module should be considered or
|
||||
not completed, based on their completion options and the current value for the overall complete state.
|
||||
* The following previously deprecated methods have been removed and can no longer be used:
|
||||
- `core_course_bulk_activity_completion_renderer::navigation`
|
||||
- `core_completion\manager::get_available_completion_tabs`
|
||||
|
||||
=== 4.3 ===
|
||||
* A trait class, core_completion/form/form_trait has been added to reuse code for adding and validation completion settings to any
|
||||
|
@ -36,24 +36,10 @@ require_once($CFG->dirroot.'/course/renderer.php');
|
||||
class core_course_bulk_activity_completion_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Render the navigation tabs for the completion page.
|
||||
*
|
||||
* @deprecated since Moodle 4.0
|
||||
* @param int|stdClass $courseorid the course object or id.
|
||||
* @param String $page the tab to focus.
|
||||
* @return string html
|
||||
*/
|
||||
public function navigation($courseorid, $page) {
|
||||
debugging('navigation() has been deprecated as the tabs navigation structure in the completion page ' .
|
||||
'has been replaced with tertiary navigation. Please use render_course_completion_action_bar() instead.',
|
||||
DEBUG_DEVELOPER);
|
||||
|
||||
$tabs = core_completion\manager::get_available_completion_tabs($courseorid);
|
||||
if (count($tabs) > 1) {
|
||||
return $this->tabtree($tabs, $page);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
public function navigation() {
|
||||
throw new coding_exception(__FUNCTION__ . '() has been removed.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user