Skip to content

Commit

Permalink
MDL-73863 course: Deprecate unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski committed Mar 10, 2022
1 parent 36fe569 commit 135e1a2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions completion/classes/manager.php
Expand Up @@ -262,10 +262,14 @@ public static function can_edit_bulk_completion($courseorid, $cm = null) {
/**
* 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;
Expand Down
3 changes: 3 additions & 0 deletions completion/upgrade.txt
Expand Up @@ -10,6 +10,9 @@ information provided here is intended especially for developers.
criteria was completed.
* New method get_available_completion_options() has been added in the core_completion\manager class. This method can be used
to obtain an array with the available completion options ([url => name]) for the current course and user.
* The method get_available_completion_tabs() in the core_completion\manager class has been deprecated because the tabs navigation
structure is no longer used in the completion pages. Please use core_completion\manager::get_available_completion_options()
instead.

=== 3.11 ===
* New Behat steps for activity completion in the behat_completion class:
Expand Down
5 changes: 5 additions & 0 deletions course/classes/output/bulk_activity_completion_renderer.php
Expand Up @@ -38,11 +38,16 @@ 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);
Expand Down
3 changes: 3 additions & 0 deletions course/upgrade.txt
Expand Up @@ -87,6 +87,9 @@ course formats don't have their own renderer.
- print_course_request_buttons
* New page_setup() method in the core_course_category class. This method can be used for a general page setup in the course
category pages.
* The method navigation() in the core_course_bulk_activity_completion_renderer class has been deprecated as the tabs navigation
structure in the course competency pages has been replaced with tertiary navigation. To render the navigation, please
render_course_completion_action_bar() instead.

=== 3.11 ===
* A new callback xxx_coursemodule_definition_after_data that allows plugins to extend activity forms after the data is set.
Expand Down

0 comments on commit 135e1a2

Please sign in to comment.