mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-56442-master' of https://github.com/StudiUM/moodle
This commit is contained in:
commit
3b89ce210d
@ -663,6 +663,7 @@ $string['logstoressupported'] = 'Log stores that support this report';
|
||||
$string['longtimewarning'] = '<b>Please note that this process can take a long time.</b>';
|
||||
$string['maintenancemode'] = 'In maintenance mode';
|
||||
$string['maintenancemodeisscheduled'] = 'This site will be switched to maintenance mode in {$a->min} mins {$a->sec} secs';
|
||||
$string['maintenancemodeisscheduledlong'] = 'This site will be switched to maintenance mode in {$a->hour} hours {$a->min} mins {$a->sec} secs';
|
||||
$string['maintfileopenerror'] = 'Error opening maintenance files!';
|
||||
$string['maintinprogress'] = 'Maintenance is in progress...';
|
||||
$string['manageformats'] = 'Manage course formats';
|
||||
|
@ -659,14 +659,20 @@ class core_renderer extends renderer_base {
|
||||
$errorclass = ($timeleft < 30) ? 'error' : 'warning';
|
||||
$output .= $this->box_start($errorclass . ' moodle-has-zindex maintenancewarning');
|
||||
$a = new stdClass();
|
||||
$a->min = (int)($timeleft/60);
|
||||
$a->hour = (int)($timeleft / 3600);
|
||||
$a->min = (int)(($timeleft / 60) % 60);
|
||||
$a->sec = (int)($timeleft % 60);
|
||||
if ($a->hour > 0) {
|
||||
$output .= get_string('maintenancemodeisscheduledlong', 'admin', $a);
|
||||
} else {
|
||||
$output .= get_string('maintenancemodeisscheduled', 'admin', $a);
|
||||
}
|
||||
|
||||
$output .= $this->box_end();
|
||||
$this->page->requires->yui_module('moodle-core-maintenancemodetimer', 'M.core.maintenancemodetimer',
|
||||
array(array('timeleftinsec' => $timeleft)));
|
||||
$this->page->requires->strings_for_js(
|
||||
array('maintenancemodeisscheduled', 'sitemaintenance'),
|
||||
array('maintenancemodeisscheduled', 'maintenancemodeisscheduledlong', 'sitemaintenance'),
|
||||
'admin');
|
||||
}
|
||||
return $output;
|
||||
|
@ -39,9 +39,14 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, {
|
||||
} else {
|
||||
var a = {};
|
||||
a.sec = this.timeleftinsec % 60;
|
||||
a.min = Math.floor(this.timeleftinsec / 60);
|
||||
a.min = Math.floor(this.timeleftinsec / 60) % 60;
|
||||
a.hour = Math.floor(this.timeleftinsec / 3600);
|
||||
if (a.hour > 0) {
|
||||
this.maintenancenode.set('text', M.util.get_string('maintenancemodeisscheduledlong', 'admin', a));
|
||||
} else {
|
||||
this.maintenancenode.set('text', M.util.get_string('maintenancemodeisscheduled', 'admin', a));
|
||||
}
|
||||
}
|
||||
// Set error class to highlight the importance.
|
||||
if (this.timeleftinsec < 30) {
|
||||
this.maintenancenode.addClass('error')
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-core-maintenancemodetimer",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{timeleftinsec:0,maintenancenode:e.one(".box.maintenancewarning"),initializer:function(t){this.maintenancenode&&(this.timeleftinsec=t.timeleftinsec,this.maintenancenode.setAttribute("aria-live","polite"),e.later(1e3,this,"updatetimer",null,!0))},updatetimer:function(){this.timeleftinsec-=1;if(this.timeleftinsec<=0)this.maintenancenode.set("text",M.util.get_string("sitemaintenance","admin"));else{var e={};e.sec=this.timeleftinsec%60,e.min=Math.floor(this.timeleftinsec/60),this.maintenancenode.set("text",M.util.get_string("maintenancemodeisscheduled","admin",e))}this.timeleftinsec<30?this.maintenancenode.addClass("error").removeClass("warning"):this.maintenancenode.addClass("warning").removeClass("error")}}),M.core=M.core||{},M.core.maintenancemodetimer=M.core.maintenancemodetimer||function(e){return new n(e)}},"@VERSION@",{requires:["base","node"]});
|
||||
YUI.add("moodle-core-maintenancemodetimer",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{timeleftinsec:0,maintenancenode:e.one(".box.maintenancewarning"),initializer:function(t){this.maintenancenode&&(this.timeleftinsec=t.timeleftinsec,this.maintenancenode.setAttribute("aria-live","polite"),e.later(1e3,this,"updatetimer",null,!0))},updatetimer:function(){this.timeleftinsec-=1;if(this.timeleftinsec<=0)this.maintenancenode.set("text",M.util.get_string("sitemaintenance","admin"));else{var e={};e.sec=this.timeleftinsec%60,e.min=Math.floor(this.timeleftinsec/60)%60,e.hour=Math.floor(this.timeleftinsec/3600),e.hour>0?this.maintenancenode.set("text",M.util.get_string("maintenancemodeisscheduledlong","admin",e)):this.maintenancenode.set("text",M.util.get_string("maintenancemodeisscheduled","admin",e))}this.timeleftinsec<30?this.maintenancenode.addClass("error").removeClass("warning"):this.maintenancenode.addClass("warning").removeClass("error")}}),M.core=M.core||{},M.core.maintenancemodetimer=M.core.maintenancemodetimer||function(e){return new n(e)}},"@VERSION@",{requires:["base","node"]});
|
||||
|
@ -39,9 +39,14 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, {
|
||||
} else {
|
||||
var a = {};
|
||||
a.sec = this.timeleftinsec % 60;
|
||||
a.min = Math.floor(this.timeleftinsec / 60);
|
||||
a.min = Math.floor(this.timeleftinsec / 60) % 60;
|
||||
a.hour = Math.floor(this.timeleftinsec / 3600);
|
||||
if (a.hour > 0) {
|
||||
this.maintenancenode.set('text', M.util.get_string('maintenancemodeisscheduledlong', 'admin', a));
|
||||
} else {
|
||||
this.maintenancenode.set('text', M.util.get_string('maintenancemodeisscheduled', 'admin', a));
|
||||
}
|
||||
}
|
||||
// Set error class to highlight the importance.
|
||||
if (this.timeleftinsec < 30) {
|
||||
this.maintenancenode.addClass('error')
|
||||
|
@ -37,9 +37,14 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, {
|
||||
} else {
|
||||
var a = {};
|
||||
a.sec = this.timeleftinsec % 60;
|
||||
a.min = Math.floor(this.timeleftinsec / 60);
|
||||
a.min = Math.floor(this.timeleftinsec / 60) % 60;
|
||||
a.hour = Math.floor(this.timeleftinsec / 3600);
|
||||
if (a.hour > 0) {
|
||||
this.maintenancenode.set('text', M.util.get_string('maintenancemodeisscheduledlong', 'admin', a));
|
||||
} else {
|
||||
this.maintenancenode.set('text', M.util.get_string('maintenancemodeisscheduled', 'admin', a));
|
||||
}
|
||||
}
|
||||
// Set error class to highlight the importance.
|
||||
if (this.timeleftinsec < 30) {
|
||||
this.maintenancenode.addClass('error')
|
||||
|
Loading…
x
Reference in New Issue
Block a user