Merge branch '44729-27' of git://github.com/samhemelryk/moodle

This commit is contained in:
Dan Poltawski
2014-05-02 09:44:49 +08:00
@@ -221,3 +221,48 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
}
}
}
/**
* Overridden core maintenance renderer.
*
* This renderer gets used instead of the standard core_renderer during maintenance
* tasks such as installation and upgrade.
* We override it in order to style those scenarios consistently with the regular
* bootstrap look and feel.
*
* @package theme_bootstrapbase
* @copyright 2014 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class theme_bootstrapbase_core_renderer_maintenance extends core_renderer_maintenance {
/**
* Renders notifications for maintenance scripts.
*
* We need to override this method in the same way we do for the core_renderer maintenance method
* found above.
* Please note this isn't required of every function, only functions used during maintenance.
* In this case notification is used to print errors and we want pretty errors.
*
* @param string $message
* @param string $classes
* @return string
*/
public function notification($message, $classes = 'notifyproblem') {
$message = clean_text($message);
$type = '';
if (($classes == 'notifyproblem') || ($classes == 'notifytiny')) {
$type = 'alert alert-error';
}
if ($classes == 'notifysuccess') {
$type = 'alert alert-success';
}
if ($classes == 'notifymessage') {
$type = 'alert alert-info';
}
if ($classes == 'redirectmessage') {
$type = 'alert alert-block alert-info';
}
return "<div class=\"$type\">$message</div>";
}
}