r69097 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69096‎ | r69097 | r69098 >
Date:14:41, 6 July 2010
Author:demon
Status:ok
Tags:
Comment:
Turn getStatusErrorBox() into getStatusBox() so it can handle warnings too
Modified paths:
  • /trunk/phase3/includes/installer/WebInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/WebInstaller.php
@@ -731,11 +731,18 @@
732732 }
733733
734734 /**
735 - * Output an error box using a Status object
 735+ * Output an error or warning box using a Status object
736736 */
737 - function showStatusErrorBox( $status ) {
738 - $text = $status->getWikiText();
739 - $this->output->addHTML( $this->getErrorBox( $text ) );
 737+ function showStatusBox( $status ) {
 738+ if( !$status->isGood() ) {
 739+ $text = $status->getWikiText();
 740+ if( $status->isOk() ) {
 741+ $box = $this->getWarningBox( $text );
 742+ } else {
 743+ $box = $this->getErrorBox( $text );
 744+ }
 745+ $this->output->addHTML( $box );
 746+ }
740747 }
741748
742749 function showStatusMessage( $status ) {
@@ -985,7 +992,7 @@
986993 $this->setVar( '_UpgradeDone', false );
987994 return 'continue';
988995 } else {
989 - $this->parent->showStatusErrorBox( $status );
 996+ $this->parent->showStatusBox( $status );
990997 }
991998 }
992999
@@ -1112,7 +1119,7 @@
11131120 } elseif ( $status->isGood() ) {
11141121 return 'continue';
11151122 } else {
1116 - $this->parent->showStatusErrorBox( $status );
 1123+ $this->parent->showStatusBox( $status );
11171124 }
11181125 }
11191126
@@ -1588,7 +1595,7 @@
15891596
15901597 $ok = $status->isGood();
15911598 if ( !$ok ) {
1592 - $this->parent->showStatusErrorBox( $status );
 1599+ $this->parent->showStatusBox( $status );
15931600 }
15941601 $this->endStage( $ok );
15951602 }

Status & tagging log