MDL-73956 forum: Final deprecation of forum_update_subscriptions_button

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
This commit is contained in:
Daniel Ziegenberg 2024-03-25 20:56:40 +01:00
parent 342319339f
commit 20c32542a7
No known key found for this signature in database
GPG Key ID: 7E6F98FFADBEFD39
2 changed files with 12 additions and 31 deletions

View File

@ -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__);
}
/**

View File

@ -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.