From 32b333e7585800007f69246aaad0165dda76180f Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 6 Jul 2010 14:41:15 +0000 Subject: [PATCH] Turn getStatusErrorBox() into getStatusBox() so it can handle warnings too --- includes/installer/WebInstaller.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index b5f22d5031..bbdbb7f250 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -731,11 +731,18 @@ class WebInstaller extends Installer { } /** - * Output an error box using a Status object + * Output an error or warning box using a Status object */ - function showStatusErrorBox( $status ) { - $text = $status->getWikiText(); - $this->output->addHTML( $this->getErrorBox( $text ) ); + function showStatusBox( $status ) { + if( !$status->isGood() ) { + $text = $status->getWikiText(); + if( $status->isOk() ) { + $box = $this->getWarningBox( $text ); + } else { + $box = $this->getErrorBox( $text ); + } + $this->output->addHTML( $box ); + } } function showStatusMessage( $status ) { @@ -985,7 +992,7 @@ class WebInstaller_DBConnect extends WebInstallerPage { $this->setVar( '_UpgradeDone', false ); return 'continue'; } else { - $this->parent->showStatusErrorBox( $status ); + $this->parent->showStatusBox( $status ); } } @@ -1112,7 +1119,7 @@ class WebInstaller_DBSettings extends WebInstallerPage { } elseif ( $status->isGood() ) { return 'continue'; } else { - $this->parent->showStatusErrorBox( $status ); + $this->parent->showStatusBox( $status ); } } @@ -1588,7 +1595,7 @@ class WebInstaller_Install extends WebInstallerPage { $ok = $status->isGood(); if ( !$ok ) { - $this->parent->showStatusErrorBox( $status ); + $this->parent->showStatusBox( $status ); } $this->endStage( $ok ); } -- 2.20.1