Skip to content

Commit

Permalink
MDL-73976 course: final removal of deprecated request button method.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Jul 24, 2024
1 parent 554a790 commit 9ff0b21
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
7 changes: 7 additions & 0 deletions .upgradenotes/MDL-73976-2024053011201329.yml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 0 additions & 30 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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?
*
Expand Down
8 changes: 8 additions & 0 deletions lib/deprecatedlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 9ff0b21

Please sign in to comment.