diff --git a/views/warningbar.css b/views/warningbar.css index 475fa9e..5f1e410 100644 --- a/views/warningbar.css +++ b/views/warningbar.css @@ -17,13 +17,15 @@ If you need to make changes here, remember to update your settings inside Moodle width: 100%; z-index: 9999; } + #auth_outage_warningbar_box.imminent { background: purple; } + .auth_outage_warningbar_center { + margin-top: -45px; position: relative; top: 50%; - margin-top: -45px; } #auth_outage_warningbar_countdown { diff --git a/views/warningbar.js b/views/warningbar.js index a509d47..cba2047 100644 --- a/views/warningbar.js +++ b/views/warningbar.js @@ -2,9 +2,10 @@ var auth_outage_countdown = { timer: null, clienttime: Date.now(), siteadmin: false, - init: function (countdown, siteadmin) { + init: function (countdown, siteadmin, redirectto) { this.countdown = countdown; this.siteadmin = siteadmin; + this.redirectto = redirectto; this.divtext = document.getElementById('auth_outage_warningbar_countdown'); this.divblock = document.getElementById('auth_outage_warningbar_box'); this.text = this.divtext.innerHTML; @@ -25,7 +26,7 @@ var auth_outage_countdown = { missing = 0; clearInterval(this.timer); if (!this.siteadmin) { - location = '/auth/outage/info.php'; + window.location = this.redirectto; } } this.divtext.innerHTML = this.text.replace('{{countdown}}', this.seconds2hms(missing)); diff --git a/views/warningbar.php b/views/warningbar.php index f76061b..67fc604 100644 --- a/views/warningbar.php +++ b/views/warningbar.php @@ -27,6 +27,8 @@ if (!defined('MOODLE_INTERNAL')) { die('Direct access to this script is forbidden.'); // It must be included from a Moodle page. } +$infolink = new moodle_url('/auth/outage/info.php', ['id' => $outage->id]); + echo html_writer::tag('style', get_config('auth_outage', 'css')); ?> @@ -34,11 +36,7 @@ echo html_writer::tag('style', get_config('auth_outage', 'css'));
- $outage->id]), - $outage->get_title(), - ['target' => 'outage'] - ); ?> + get_title(), ['target' => '_blank']); ?>
@@ -47,8 +45,9 @@ echo html_writer::tag('style', get_config('auth_outage', 'css'));