diff --git a/theme/bootstrapbase/renderers/core_renderer.php b/theme/bootstrapbase/renderers/core_renderer.php index 7f0663dfd68..318f3849442 100644 --- a/theme/bootstrapbase/renderers/core_renderer.php +++ b/theme/bootstrapbase/renderers/core_renderer.php @@ -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 "
$message
"; + } +}