diff --git a/CHANGES.md b/CHANGES.md index 6575ffe..3c96165 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### v4.4-r4 +* 2024-10-20 - Upgrade: Adopt changes from MDL-81960 and use new \core\url class. * 2024-10-20 - Upgrade: Adopt changes from MDL-81031 and use new \core\user class. * 2024-10-07 - Prepare compatibility for Moodle 4.5. * 2024-09-23 - Documentation: Add a note about the removal of the local/recompletion:resetmycompletion capability to README.md diff --git a/classes/enrollist_table.php b/classes/enrollist_table.php index d68a048..2679891 100644 --- a/classes/enrollist_table.php +++ b/classes/enrollist_table.php @@ -167,7 +167,7 @@ public function other_cols($column, $row) { // Inject actions column. if ($column === 'actions') { - $buttonurl = new \moodle_url('/user/view.php', ['id' => $row->moodleuserid, 'course' => $row->courseid]); + $buttonurl = new \core\url('/user/view.php', ['id' => $row->moodleuserid, 'course' => $row->courseid]); $buttonlabel = get_string('tableviewenrolment', 'enrol_semco'); return $OUTPUT->single_button($buttonurl, $buttonlabel, 'get'); } diff --git a/classes/external.php b/classes/external.php index d07d16b..81dfc82 100644 --- a/classes/external.php +++ b/classes/external.php @@ -216,13 +216,13 @@ public static function enrol_user($userid, $courseid, $semcobookingid, $timestar // Throw an exception if recompletion is not enabled at all. if (empty($recompletionconfig->recompletiontype)) { - $localrecompletionurl = new moodle_url('/local/recompletion/recompletion.php', ['id' => $params['courseid']]); + $localrecompletionurl = new \core\url('/local/recompletion/recompletion.php', ['id' => $params['courseid']]); throw new moodle_exception('localrecompletionnotenabled', 'enrol_semco', '', $localrecompletionurl->out()); } // Throw an exception if recompletion is not set to OnDemand. if ($recompletionconfig->recompletiontype != \local_recompletion_recompletion_form::RECOMPLETION_TYPE_ONDEMAND) { - $localrecompletionurl = new moodle_url('/local/recompletion/recompletion.php', ['id' => $params['courseid']]); + $localrecompletionurl = new \core\url('/local/recompletion/recompletion.php', ['id' => $params['courseid']]); throw new moodle_exception('localrecompletionnotondemand', 'enrol_semco', '', $localrecompletionurl->out()); } } @@ -1064,13 +1064,13 @@ public static function reset_course_completion($enrolid) { // Throw an exception if recompletion is not enabled at all. if (empty($recompletionconfig->recompletiontype)) { - $localrecompletionurl = new moodle_url('/local/recompletion/recompletion.php', ['id' => $instance->courseid]); + $localrecompletionurl = new \core\url('/local/recompletion/recompletion.php', ['id' => $instance->courseid]); throw new moodle_exception('localrecompletionnotenabled', 'enrol_semco', '', $localrecompletionurl->out()); } // Throw an exception if recompletion is not set to OnDemand. if ($recompletionconfig->recompletiontype != \local_recompletion_recompletion_form::RECOMPLETION_TYPE_ONDEMAND) { - $localrecompletionurl = new moodle_url('/local/recompletion/recompletion.php', ['id' => $instance->courseid]); + $localrecompletionurl = new \core\url('/local/recompletion/recompletion.php', ['id' => $instance->courseid]); throw new moodle_exception('localrecompletionnotondemand', 'enrol_semco', '', $localrecompletionurl->out()); } diff --git a/locallib.php b/locallib.php index bb94552..e45bfb2 100644 --- a/locallib.php +++ b/locallib.php @@ -283,7 +283,7 @@ function enrol_semco_callbackimpl_before_standard_top_of_body_html(&$hook = null // Create new navigation node for enrolment report. $reportnode = navigation_node::create(get_string('reportpagetitle', 'enrol_semco', null, true), - new moodle_url('/enrol/semco/enrolreport.php'), + new \core\url('/enrol/semco/enrolreport.php'), navigation_node::TYPE_SETTING, null, 'enrol_semco_enrolreport'); diff --git a/settings.php b/settings.php index 441fbbf..1d87a5a 100644 --- a/settings.php +++ b/settings.php @@ -33,7 +33,7 @@ // And if we are not during the initial install or if the script is called without setting the page URL // (which will happen during the plugin installation and will show a debug warning, that's why we suppress debugging messages // temporarily). - $settingsurl = new moodle_url('/admin/settings.php', ['section' => 'enrolsettingssemco']); + $settingsurl = new \core\url('/admin/settings.php', ['section' => 'enrolsettingssemco']); $olddebug = $CFG->debug; $CFG->debug = 0; $pageurl = $PAGE->url; @@ -84,7 +84,7 @@ // Create enrolment report heading. $name = 'enrol_semco/settings_enrolmentreportheading'; - $reporturl = new moodle_url('/enrol/semco/enrolreport.php'); + $reporturl = new \core\url('/enrol/semco/enrolreport.php'); $title = get_string('settings_enrolmentreportheading', 'enrol_semco', null, true); $description = get_string('settings_enrolmentreportheading_desc', 'enrol_semco', null, true).'
'. html_writer::link($reporturl, @@ -137,7 +137,7 @@ // Create information widget. $name = 'enrol_semco/settings_coursecompletionnotfound'; $title = ''; - $localrecompletionurl = new moodle_url('/admin/settings.php', ['section' => 'local_recompletion']); + $localrecompletionurl = new \core\url('/admin/settings.php', ['section' => 'local_recompletion']); $notification = new \core\output\notification(get_string('settings_coursecompletionlrcintro', 'enrol_semco', null, true). get_string('settings_coursecompletionlrcfound', 'enrol_semco', null, true). get_string('settings_coursecompletionnote', 'enrol_semco', $localrecompletionurl->out(), true), @@ -152,7 +152,7 @@ // Create information widget. $name = 'enrol_semco/settings_coursecompletionnotfound'; $title = ''; - $localrecompletionurl = new moodle_url('/admin/settings.php', ['section' => 'local_recompletion']); + $localrecompletionurl = new \core\url('/admin/settings.php', ['section' => 'local_recompletion']); $notification = new \core\output\notification(get_string('settings_coursecompletionlrcintro', 'enrol_semco', null, true). get_string('settings_coursecompletionlrcnotfound', 'enrol_semco', null, true). get_string('settings_coursecompletionnote', 'enrol_semco', $localrecompletionurl->out(), true),