r64268 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64267‎ | r64268 | r64269 >
Date:18:01, 27 March 2010
Author:maxsem
Status:ok
Tags:
Comment:
Closed a tag, shortened calls like $this->parent->output->addHTML to improve readability
Modified paths:
  • /branches/new-installer/phase3/includes/installer/WebInstaller.php (modified) (history)

Diff [purge]

Index: branches/new-installer/phase3/includes/installer/WebInstaller.php
@@ -751,8 +751,12 @@
752752 $this->parent = $parent;
753753 }
754754
 755+ function addHTML( $html ) {
 756+ $this->parent->output->addHTML( $html );
 757+ }
 758+
755759 function startForm() {
756 - $this->parent->output->addHTML(
 760+ $this->addHTML(
757761 "<div class=\"config-section\">\n" .
758762 Xml::openElement(
759763 'form',
@@ -790,7 +794,7 @@
791795 ) ) . "\n";
792796 }
793797 $s .= "</div></form></div>\n";
794 - $this->parent->output->addHTML( $s );
 798+ $this->addHTML( $s );
795799 }
796800
797801 function getName() {
@@ -806,7 +810,7 @@
807811 return 'continue';
808812 } else {
809813 $this->startForm();
810 - $this->parent->output->addHTML( 'Mockup' );
 814+ $this->addHTML( 'Mockup' );
811815 $this->endForm();
812816 }
813817 }
@@ -883,7 +887,7 @@
884888 $this->parent->getHelpBox( 'config-wiki-language-help' );
885889
886890
887 - $this->parent->output->addHTML( $s );
 891+ $this->addHTML( $s );
888892 $this->endForm();
889893 }
890894
@@ -967,7 +971,7 @@
968972 $types .= "</ul><br clear=\"left\"/>\n";
969973 $encType = Xml::encodeJsVar( $defaultType );
970974
971 - $this->parent->output->addHTML(
 975+ $this->addHTML(
972976 $this->parent->label( 'config-db-type', false, $types ) .
973977 $settings .
974978 "<script type=\"text/javascript\">resetDBArea();</script>\n"
@@ -1021,14 +1025,14 @@
10221026 }
10231027
10241028 $this->startForm();
1025 - $this->parent->output->addHTML( $this->parent->getInfoBox(
 1029+ $this->addHTML( $this->parent->getInfoBox(
10261030 wfMsgNoTrans( 'config-can-upgrade', $GLOBALS['wgVersion'] ) ) );
10271031 $this->endForm();
10281032 }
10291033
10301034 function showDoneMessage() {
10311035 $this->startForm();
1032 - $this->parent->output->addHTML(
 1036+ $this->addHTML(
10331037 $this->parent->getInfoBox(
10341038 wfMsgNoTrans( 'config-upgrade-done',
10351039 $GLOBALS['wgServer'] .
@@ -1063,7 +1067,7 @@
10641068 }
10651069
10661070 $this->startForm();
1067 - $this->parent->output->addHTML( $form );
 1071+ $this->addHTML( $form );
10681072 $this->endForm();
10691073 }
10701074
@@ -1086,7 +1090,7 @@
10871091 $js = 'enableControlArray("config__NamespaceType_other", ["config_wgMetaNamespace"])';
10881092 $attribs = array( 'onclick' => $js );
10891093
1090 - $this->parent->output->addHTML(
 1094+ $this->addHTML(
10911095 $this->parent->getTextBox( array(
10921096 'var' => 'wgSitename',
10931097 'label' => 'config-site-name',
@@ -1245,7 +1249,7 @@
12461250 $uploadJs = 'enableControlArray("config_wgEnableUploads", ["config_wgDeletedDirectory"]);';
12471251
12481252 $this->startForm();
1249 - $this->parent->output->addHTML(
 1253+ $this->addHTML(
12501254 # User Rights
12511255 $this->parent->getRadioSet( array(
12521256 'var' => '_RightsProfile',
@@ -1313,10 +1317,10 @@
13141318 ) );
13151319 }
13161320 $extHtml .= $this->parent->getFieldsetEnd();
1317 - $this->parent->output->addHTML( $extHtml );
 1321+ $this->addHTML( $extHtml );
13181322 }
13191323
1320 - $this->parent->output->addHTML(
 1324+ $this->addHTML(
13211325 # Uploading
13221326 $this->parent->getFieldsetStart( 'config-upload-settings' ) .
13231327 $this->parent->getCheckBox( array(
@@ -1344,7 +1348,7 @@
13451349 }
13461350 $caches[] = 'memcached';
13471351
1348 - $this->parent->output->addHTML(
 1352+ $this->addHTML(
13491353 # Advanced settings
13501354 $this->parent->getFieldsetStart( 'config-advanced-settings' ) .
13511355 # Object cache settings
@@ -1447,7 +1451,7 @@
14481452 return;
14491453 }
14501454 $this->setVar( '_CCDone', true );
1451 - $this->parent->output->addHTML( $this->getCCDoneBox() );
 1455+ $this->addHTML( $this->getCCDoneBox() );
14521456 }
14531457
14541458 function submit() {
@@ -1502,20 +1506,21 @@
15031507 }
15041508 $this->startForm();
15051509 $this->parent->exportVars();
1506 - $this->parent->output->addHTML("<ul>");
 1510+ $this->addHTML("<ul>");
15071511 foreach( $this->parent->getInstallSteps() as $step ) {
15081512 $this->startStage( "config-install-$step" );
15091513 $func = 'install' . ucfirst( $step );
15101514 $success = $this->parent->{$func}();
15111515 $this->endStage( $success );
15121516 }
 1517+ $this->addHTML("</ul>");
15131518 $this->endForm();
15141519 return true;
15151520
15161521 }
15171522
15181523 private function startStage( $msg ) {
1519 - $this->parent->output->addHTML( "<li>" . wfMsgHtml( $msg ) . wfMsg( 'ellipsis') );
 1524+ $this->addHTML( "<li>" . wfMsgHtml( $msg ) . wfMsg( 'ellipsis') );
15201525 }
15211526
15221527 private function endStage( $success = true ) {
@@ -1524,7 +1529,7 @@
15251530 if ( !$success ) {
15261531 $html = "<span class=\"error\">$html</span>";
15271532 }
1528 - $this->parent->output->addHTML( $html . "</li>\n" );
 1533+ $this->addHTML( $html . "</li>\n" );
15291534 }
15301535 }
15311536 class WebInstaller_Complete extends WebInstallerPage {
@@ -1532,7 +1537,7 @@
15331538 global $IP;
15341539 $this->startForm();
15351540 $msg = file_exists( "$IP/LocalSettings.php" ) ? 'config-install-done-moved' : 'config-install-done';
1536 - $this->parent->output->addHTML(
 1541+ $this->addHTML(
15371542 $this->parent->getInfoBox(
15381543 wfMsgNoTrans( $msg,
15391544 $GLOBALS['wgServer'] .
@@ -1559,7 +1564,7 @@
15601565
15611566 $this->startForm();
15621567 $s = $this->parent->getWarningBox( wfMsgNoTrans( 'config-help-restart' ) );
1563 - $this->parent->output->addHTML( $s );
 1568+ $this->addHTML( $s );
15641569 $this->endForm( 'restart' );
15651570 }
15661571 }

Status & tagging log