From 7298d0762a14623db04e9fb74348c74576ee22c5 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 22 Sep 2023 18:24:20 +0100 Subject: [PATCH] MDL-74238 completion: final removal of deprecated navigation methods. --- completion/classes/manager.php | 40 +------------------ completion/upgrade.txt | 3 ++ .../bulk_activity_completion_renderer.php | 18 +-------- 3 files changed, 7 insertions(+), 54 deletions(-) diff --git a/completion/classes/manager.php b/completion/classes/manager.php index 25a86f27c4a..f2b661a50b8 100644 --- a/completion/classes/manager.php +++ b/completion/classes/manager.php @@ -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.'); } /** diff --git a/completion/upgrade.txt b/completion/upgrade.txt index 7b40b722976..790b7ee7ed3 100644 --- a/completion/upgrade.txt +++ b/completion/upgrade.txt @@ -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 diff --git a/course/classes/output/bulk_activity_completion_renderer.php b/course/classes/output/bulk_activity_completion_renderer.php index ef0d9fe8f7d..e7a06767d1e 100644 --- a/course/classes/output/bulk_activity_completion_renderer.php +++ b/course/classes/output/bulk_activity_completion_renderer.php @@ -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.'); } /**