Issue #42 - Refactoring code according to Moodle Coding Style.

This commit is contained in:
Daniel Thee Roperto
2016-09-21 18:38:12 +10:00
parent 19b66629a8
commit 708622bbcd
47 changed files with 687 additions and 645 deletions

View File

@@ -19,7 +19,7 @@
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright Catalyst IT
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -28,11 +28,11 @@ defined('MOODLE_INTERNAL') || die();
if ($this->has_admin_options()) {
$adminlinks = [];
foreach ([
'startofwarning' => -$this->outage->get_warning_duration(),
'15secondsbefore' => -15,
'start' => 0,
'endofoutage' => $this->outage->get_duration_planned(),
] as $title => $delta) {
'startofwarning' => -$this->outage->get_warning_duration(),
'15secondsbefore' => -15,
'start' => 0,
'endofoutage' => $this->outage->get_duration_planned(),
] as $title => $delta) {
$adminlinks[] = html_writer::link(
new moodle_url(
'/auth/outage/info.php',

View File

@@ -19,7 +19,7 @@
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright Catalyst IT
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -56,7 +56,7 @@ require($CFG->dirroot.'/auth/outage/views/warningbar.php');
<section>
<h2><?php echo $this->outage->get_title(); ?></h2>
<?php require('content.php'); ?>
<?php require(__DIR__.'/content.php'); ?>
</section>
<!-- <?php echo

View File

@@ -19,11 +19,11 @@
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright Catalyst IT
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use auth_outage\outagelib;
use auth_outage\local\outagelib;
defined('MOODLE_INTERNAL') || die();
@@ -64,11 +64,11 @@ echo html_writer::tag('style', outagelib::get_config()->css);
$text = html_writer::empty_tag('img', [
'src' => $OUTPUT->pix_url('t/check'),
'alt' => get_string('finish', 'auth_outage'),
'class' => 'iconsmall'
]) . ' ' . get_string('finish', 'auth_outage');
'class' => 'iconsmall',
]).' '.get_string('finish', 'auth_outage');
$attr = [
'title' => get_string('finish', 'auth_outage'),
'class' => 'auth_outage_warningbar_box_finish'
'class' => 'auth_outage_warningbar_box_finish',
];
echo html_writer::link($url, $text, $attr);
}
@@ -79,7 +79,7 @@ echo html_writer::tag('style', outagelib::get_config()->css);
<?php if (!$static && !$outage->is_ongoing($time)): ?>
<script>
<?php require($CFG->dirroot . '/auth/outage/views/warningbar.js'); ?>
<?php require($CFG->dirroot.'/auth/outage/views/warningbar.js'); ?>
auth_outage_countdown.init(
<?php echo($outage->starttime - $time); ?>,
<?php echo(is_siteadmin() ? 'true' : 'false'); ?>,