original_string: public function maintenance_warning() {
          global $CFG;
  
          $output = '';
          if (isset($CFG->maintenance_later) and $CFG->maintenance_later > time()) {
              $timeleft = $CFG->maintenance_later - time();
              // If timeleft less than 30 sec, set the class on block to error to highlight.
              $errorclass = ($timeleft < 30) ? 'alert-error alert-danger' : 'alert-warning';
              $output .= $this->box_start($errorclass . ' moodle-has-zindex maintenancewarning m-a-1 alert');
              $a = new stdClass();
              $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', 'maintenancemodeisscheduledlong', 'sitemaintenance'),
                      'admin');
          }
          return $output;
      }
code: public function maintenance_warning() {
          global $CFG;
  
          $output = '';
          if (isset($CFG->maintenance_later) and $CFG->maintenance_later > time()) {
              $timeleft = $CFG->maintenance_later - time();
              // If timeleft less than 30 sec, set the class on block to error to highlight.
              $errorclass = ($timeleft < 30) ? 'alert-error alert-danger' : 'alert-warning';
              $output .= $this->box_start($errorclass . ' moodle-has-zindex maintenancewarning m-a-1 alert');
              $a = new stdClass();
              $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', 'maintenancemodeisscheduledlong', 'sitemaintenance'),
                      'admin');
          }
          return $output;
      }
code_tokens: public function maintenance_warning ( ) { global $ CFG ; $ output = '' ; if ( isset ( $ CFG -> maintenance_later ) and $ CFG -> maintenance_later > time ( ) ) { $ timeleft = $ CFG -> maintenance_later - time ( ) ; // If timeleft less than 30 sec, set the class on block to error to highlight. $ errorclass = ( $ timeleft < 30 ) ? 'alert-error alert-danger' : 'alert-warning' ; $ output .= $ this -> box_start ( $ errorclass . ' moodle-has-zindex maintenancewarning m-a-1 alert' ) ; $ a = new stdClass ( ) ; $ 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' , 'maintenancemodeisscheduledlong' , 'sitemaintenance' ) , 'admin' ) ; } return $ output ; }
docstring: Scheduled maintenance warning message.
  
  Note: This is a nasty hack to display maintenance notice, this should be moved
  to some general notification area once we have it.
  
  @return string
docstring_tokens: Scheduled maintenance warning message .