mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 04:33:13 +01:00
Merge branch 'MDL-73976' of https://github.com/paulholden/moodle
This commit is contained in:
commit
0e4d6567a0
7
.upgradenotes/MDL-73976-2024053011201329.yml
Normal file
7
.upgradenotes/MDL-73976-2024053011201329.yml
Normal 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
|
@ -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?
|
||||
*
|
||||
|
@ -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
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user