From 596644ef327e96df8d55331c69fb5b2865ae353a Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 8 Mar 2017 10:57:15 +1300 Subject: [PATCH] Add ability to set default value for subnet restriction. --- lang/en/attendance.php | 2 ++ settings.php | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lang/en/attendance.php b/lang/en/attendance.php index 210f821..8530210 100644 --- a/lang/en/attendance.php +++ b/lang/en/attendance.php @@ -363,3 +363,5 @@ $string['extrarestrictions'] = 'Extra restrictions'; $string['requiresubnet'] = 'Students can only record own attendance from these computers.'; $string['subnetwrong'] = 'Attendance can only be recorded from certain locations, and this computer is not on the allowed list.'; $string['requiresubnet_help'] = 'Attendance recording may be restricted to particular subnets by specifying a comma-separated list of partial or full IP addresses.'; +$string['defaultsettings'] = 'Default attendance settings'; +$string['defaultsettings_help'] = 'These settings define the defaults for all new attendances'; \ No newline at end of file diff --git a/settings.php b/settings.php index 81ebf6c..ffa3f99 100644 --- a/settings.php +++ b/settings.php @@ -44,4 +44,11 @@ if ($ADMIN->fulltree) { $settings->add(new admin_setting_configcheckbox('attendance/studentscanmark', get_string('studentscanmark', 'attendance'), get_string('studentscanmark_desc', 'attendance'), 1)); + + $name = new lang_string('defaultsettings', 'mod_attendance'); + $description = new lang_string('defaultsettings_help', 'mod_attendance'); + $settings->add(new admin_setting_heading('defaultsettings', $name, $description)); + + $settings->add(new admin_setting_configtext('attendance/subnet', + get_string('requiresubnet', 'attendance'), get_string('requiresubnet_help', 'attendance'), '', PARAM_RAW)); }