From 757358b3ee8d4692ab5a29575d15504ad8cdfa97 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 17 Jun 2020 14:50:28 +1200 Subject: [PATCH] Fix #461 hard-coded admin path. --- lib.php | 2 +- resetcalendar.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib.php b/lib.php index 6c3f3a5..ee880f7 100644 --- a/lib.php +++ b/lib.php @@ -475,7 +475,7 @@ function attendance_print_settings_tabs($selected = 'settings') { global $CFG; // Print tabs for different settings pages. $tabs = array(); - $tabs[] = new tabobject('settings', $CFG->wwwroot.'/admin/settings.php?section=modsettingattendance', + $tabs[] = new tabobject('settings', "{$CFG->wwwroot}/{$CFG->admin}/settings.php?section=modsettingattendance", get_string('settings', 'attendance'), get_string('settings'), false); $tabs[] = new tabobject('defaultstatus', $CFG->wwwroot.'/mod/attendance/defaultstatus.php', diff --git a/resetcalendar.php b/resetcalendar.php index 2095325..129b5dd 100644 --- a/resetcalendar.php +++ b/resetcalendar.php @@ -61,7 +61,7 @@ if (get_config('attendance', 'enablecalendar')) { } else { if ($DB->record_exists('attendance_sessions', array('caleventid' => 0, 'calendarevent' => 1))) { $createurl = new moodle_url('/mod/attendance/resetcalendar.php', array('action' => 'create')); - $returnurl = new moodle_url('/admin/settings.php', array('section' => 'modsettingattendance')); + $returnurl = new moodle_url("/{$CFG->admin}/settings.php", array('section' => 'modsettingattendance')); echo $OUTPUT->confirm(get_string('resetcaledarcreate', 'mod_attendance'), $createurl, $returnurl); } else { @@ -79,7 +79,7 @@ if (get_config('attendance', 'enablecalendar')) { // Check to see if there are any events that need to be deleted. if ($DB->record_exists_select('attendance_sessions', 'caleventid > 0')) { $deleteurl = new moodle_url('/mod/attendance/resetcalendar.php', array('action' => 'delete')); - $returnurl = new moodle_url('/admin/settings.php', array('section' => 'modsettingattendance')); + $returnurl = new moodle_url("/{$CFG->admin}/settings.php", array('section' => 'modsettingattendance')); echo $OUTPUT->confirm(get_string('resetcaledardelete', 'mod_attendance'), $deleteurl, $returnurl); } else {