This commit is contained in:
Sara Arjona 2024-08-28 14:08:58 +02:00
commit 0e4d6567a0
No known key found for this signature in database
3 changed files with 15 additions and 30 deletions

View File

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

View File

@ -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?
*

View File

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