Issue #15 - Added countdown to navbar, redirect to info.php when ended.

This commit is contained in:
Daniel Thee Roperto
2016-09-09 15:57:24 +10:00
parent 64d09721cf
commit 4c4df53402
5 changed files with 114 additions and 21 deletions

View File

@@ -152,6 +152,8 @@ class auth_outage_renderer extends plugin_renderer_base {
}
public function renderoutagebar(outage $outage) {
global $CFG;
$start = userdate($outage->starttime, get_string('strftimedatetimeshort'));
$stop = userdate($outage->stoptime, get_string('strftimedatetimeshort'));
@@ -161,24 +163,10 @@ class auth_outage_renderer extends plugin_renderer_base {
['start' => $start, 'stop' => $stop]
);
return
html_writer::tag('style', get_config('auth_outage', 'css'))
. html_writer::div(
html_writer::div(
html_writer::div($outage->get_title(), 'auth_outage_warningbar_box_title')
. html_writer::div(
$message . ' '
. html_writer::tag('small',
'[' . html_writer::link(
new moodle_url('/auth/outage/info.php'), 'more', ['target' => 'outage']
) . ']'
),
'auth_outage_warningbar_box_message'
),
'auth_outage_warningbar_box'
),
'auth_outage_warningbar'
)
. html_writer::div(' ', 'auth_outage_warningbar_spacer');
ob_start();
require($CFG->dirroot . '/auth/outage/views/warningbar.php');
$html = ob_get_contents();
ob_end_clean();
return $html;
}
}