diff --git a/classes/local/outagelib.php b/classes/local/outagelib.php index 26d513e..5906d21 100644 --- a/classes/local/outagelib.php +++ b/classes/local/outagelib.php @@ -71,6 +71,11 @@ class outagelib { return; } + // Check if warning bar should be hidden. + if (optional_param('auth_outage_hide_warning', false, PARAM_BOOL)) { + return; + } + // Used to test the try block in case of errors. if (PHPUNIT_TEST && optional_param('auth_outage_break_code', false, PARAM_INT)) { (new stdClass())->invalidfield; diff --git a/views/info/content.php b/views/info/content.php index b02a4d3..080f807 100644 --- a/views/info/content.php +++ b/views/info/content.php @@ -45,6 +45,18 @@ if ($viewbag['admin']) { get_string('info'.$title, 'auth_outage') ); } + $adminlinks[] = html_writer::link( + new moodle_url( + '/auth/outage/info.php', + [ + 'id' => $viewbag['outage']->id, + 'auth_outage_preview' => $viewbag['outage']->id, + 'auth_outage_delta' => 0, + 'auth_outage_hide_warning' => 1, + ] + ), + get_string('infohidewarning', 'auth_outage') + ); $admineditlink = html_writer::link( new moodle_url('/auth/outage/edit.php', ['edit' => $viewbag['outage']->id]),