From 20c32542a70273818eb62a73691030c61f3ff814 Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Mon, 25 Mar 2024 20:56:40 +0100 Subject: [PATCH] MDL-73956 forum: Final deprecation of forum_update_subscriptions_button Signed-off-by: Daniel Ziegenberg --- mod/forum/deprecatedlib.php | 39 ++++++++----------------------------- mod/forum/upgrade.txt | 4 ++++ 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/mod/forum/deprecatedlib.php b/mod/forum/deprecatedlib.php index de88a07f225..97b73b51ab1 100644 --- a/mod/forum/deprecatedlib.php +++ b/mod/forum/deprecatedlib.php @@ -418,39 +418,16 @@ function forum_get_completion_state() { } /** - * Prints the editing button on subscribers page - * * @deprecated since Moodle 4.0 - * @todo MDL-73956 Final deprecation in Moodle 4.4 - * @global object - * @global object - * @param int $courseid - * @param int $forumid - * @return string */ -function forum_update_subscriptions_button($courseid, $forumid): string { - global $CFG, $USER; - - debugging('The method forum_update_subscriptions_button() has been deprecated as it is no longer used.' . - 'The \'Manage subscribers\' button has been replaced with tertiary navigation.', DEBUG_DEVELOPER); - - if (!empty($USER->subscriptionsediting)) { - $string = get_string('managesubscriptionsoff', 'forum'); - $edit = "off"; - } else { - $string = get_string('managesubscriptionson', 'forum'); - $edit = "on"; - } - - $subscribers = html_writer::start_tag('form', ['action' => $CFG->wwwroot . '/mod/forum/subscribers.php', - 'method' => 'get', 'class' => 'd-flex flex-wrap align-items-center']); - $subscribers .= html_writer::empty_tag('input', array('type' => 'submit', 'value' => $string, - 'class' => 'btn btn-secondary')); - $subscribers .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'id', 'value' => $forumid)); - $subscribers .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'edit', 'value' => $edit)); - $subscribers .= html_writer::end_tag('form'); - - return $subscribers; +#[\core\attribute\deprecated( + since: '4.0', + reason: 'The \'Manage subscribers\' button has been replaced with tertiary navigation.', + mdl: 'MDL-73415', + final: true +)] +function forum_update_subscriptions_button(): void { + \core\deprecation::emit_deprecation_if_present(__FUNCTION__); } /** diff --git a/mod/forum/upgrade.txt b/mod/forum/upgrade.txt index fc40a9a63cc..714cebf010b 100644 --- a/mod/forum/upgrade.txt +++ b/mod/forum/upgrade.txt @@ -1,6 +1,10 @@ This files describes API changes in /mod/forum/*, information provided here is intended especially for developers. +=== 4.5 === + +* Final deprecation of forum_update_subscriptions_button(). + === 4.4 === * The mod_forum_get_forum_discussions_paginated web service has been removed from core.