mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-16 21:41:31 +02:00
Applying moodle coding standards.
This commit is contained in:
@@ -21,52 +21,11 @@
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*
|
||||
* @var array $viewbag
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
if ($viewbag['admin']) {
|
||||
$adminlinks = [];
|
||||
foreach ([
|
||||
'startofwarning' => -$viewbag['outage']->get_warning_duration(),
|
||||
'15secondsbefore' => -15,
|
||||
'start' => 0,
|
||||
'endofoutage' => $viewbag['outage']->get_duration_planned() - 1,
|
||||
] as $title => $delta) {
|
||||
$adminlinks[] = html_writer::link(
|
||||
new moodle_url(
|
||||
'/auth/outage/info.php',
|
||||
[
|
||||
'id' => $viewbag['outage']->id,
|
||||
'auth_outage_preview' => $viewbag['outage']->id,
|
||||
'auth_outage_delta' => $delta,
|
||||
]
|
||||
),
|
||||
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')
|
||||
);
|
||||
$adminlinks[] = html_writer::link(
|
||||
new moodle_url('/auth/outage/preview.php', ['id' => $viewbag['outage']->id]),
|
||||
get_string('infostaticpage', 'auth_outage')
|
||||
);
|
||||
|
||||
$admineditlink = html_writer::link(
|
||||
new moodle_url('/auth/outage/edit.php', ['edit' => $viewbag['outage']->id]),
|
||||
get_string('outageedit', 'auth_outage')
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="auth_outage_info">
|
||||
@@ -82,6 +41,48 @@ if ($viewbag['admin']) {
|
||||
<div class="auth_outage_info_description"><?php echo $viewbag['outage']->get_description(); ?></div>
|
||||
|
||||
<?php if ($viewbag['admin']): ?>
|
||||
<?php
|
||||
$adminlinks = [];
|
||||
foreach ([
|
||||
'startofwarning' => -$viewbag['outage']->get_warning_duration(),
|
||||
'15secondsbefore' => -15,
|
||||
'start' => 0,
|
||||
'endofoutage' => $viewbag['outage']->get_duration_planned() - 1,
|
||||
] as $title => $delta) {
|
||||
$adminlinks[] = html_writer::link(
|
||||
new moodle_url(
|
||||
'/auth/outage/info.php',
|
||||
[
|
||||
'id' => $viewbag['outage']->id,
|
||||
'auth_outage_preview' => $viewbag['outage']->id,
|
||||
'auth_outage_delta' => $delta,
|
||||
]
|
||||
),
|
||||
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')
|
||||
);
|
||||
$adminlinks[] = html_writer::link(
|
||||
new moodle_url('/auth/outage/preview.php', ['id' => $viewbag['outage']->id]),
|
||||
get_string('infostaticpage', 'auth_outage')
|
||||
);
|
||||
|
||||
$admineditlink = html_writer::link(
|
||||
new moodle_url('/auth/outage/edit.php', ['edit' => $viewbag['outage']->id]),
|
||||
get_string('outageedit', 'auth_outage')
|
||||
);
|
||||
?>
|
||||
<div class="auth_outage_info_adminlinks">
|
||||
<b><?php echo get_string('preview'); ?>:</b>
|
||||
<?php echo implode(' | ', $adminlinks); ?><br/>
|
||||
|
||||
Reference in New Issue
Block a user