From 9ff0b21e3877af84b778d616b16c1b853971bfa7 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 6 Feb 2024 14:49:16 +0000 Subject: [PATCH] MDL-73976 course: final removal of deprecated request button method. --- .upgradenotes/MDL-73976-2024053011201329.yml | 7 +++++ course/lib.php | 30 -------------------- lib/deprecatedlib.php | 8 ++++++ 3 files changed, 15 insertions(+), 30 deletions(-) create mode 100644 .upgradenotes/MDL-73976-2024053011201329.yml diff --git a/.upgradenotes/MDL-73976-2024053011201329.yml b/.upgradenotes/MDL-73976-2024053011201329.yml new file mode 100644 index 00000000000..e890893142b --- /dev/null +++ b/.upgradenotes/MDL-73976-2024053011201329.yml @@ -0,0 +1,7 @@ +issueNumber: MDL-73976 +notes: + core_course: + - message: >- + The previously deprecated `print_course_request_buttons` method has been + removed and can no longer be used + type: removed diff --git a/course/lib.php b/course/lib.php index 3eca82d2fa2..4afe6858818 100644 --- a/course/lib.php +++ b/course/lib.php @@ -480,36 +480,6 @@ function get_category_or_system_context($categoryid) { } } -/** - * Print the buttons relating to course requests. - * - * @param context $context current page context. - * @deprecated since Moodle 4.0 - * @todo Final deprecation MDL-73976 - */ -function print_course_request_buttons($context) { - global $CFG, $DB, $OUTPUT; - debugging("print_course_request_buttons() is deprecated. " . - "This is replaced with the category_action_bar tertiary navigation.", DEBUG_DEVELOPER); - if (empty($CFG->enablecourserequests)) { - return; - } - if (course_request::can_request($context)) { - // Print a button to request a new course. - $params = []; - if ($context instanceof context_coursecat) { - $params['category'] = $context->instanceid; - } - echo $OUTPUT->single_button(new moodle_url('/course/request.php', $params), - get_string('requestcourse'), 'get'); - } - /// Print a button to manage pending requests - if (has_capability('moodle/site:approvecourse', $context)) { - $disabled = !$DB->record_exists('course_request', array()); - echo $OUTPUT->single_button(new moodle_url('/course/pending.php'), get_string('coursespending'), 'get', array('disabled' => $disabled)); - } -} - /** * Does the user have permission to edit things in this category? * diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index b0efea86737..99345b269ed 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -221,6 +221,14 @@ function print_arrow() { \core\deprecation::emit_deprecation_if_present(__FUNCTION__); } +/** + * @deprecated since Moodle 4.0 + */ +#[\core\attribute\deprecated('category_action_bar tertiary navigation', since: '4.0', mdl: 'MDL-73462', final: true)] +function print_course_request_buttons() { + \core\deprecation::emit_deprecation_if_present(__FUNCTION__); +} + /** * Execute cron tasks *