r58003 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58002‎ | r58003 | r58004 >
Date:13:54, 22 October 2009
Author:werdna
Status:ok (Comments)
Tags:
Comment:
Add some hook HTML injection points to EditForm, between the Copyright warning and the content, and after the preview content.
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -83,6 +83,8 @@
8484 public $editFormTextAfterWarn;
8585 public $editFormTextAfterTools;
8686 public $editFormTextBottom;
 87+ public $editFormTextAfterContent;
 88+ public $previewTextAfterContent;
8789
8890 /* $didSave should be set to true whenever an article was succesfully altered. */
8991 public $didSave = false;
@@ -106,6 +108,8 @@
107109 $this->editFormTextAfterWarn =
108110 $this->editFormTextAfterTools =
109111 $this->editFormTextBottom =
 112+ $this->editFormTextAfterContent =
 113+ $this->previewTextAfterContent =
110114 $this->mPreloadText = "";
111115 }
112116
@@ -1547,6 +1551,8 @@
15481552 END
15491553 );
15501554 $this->showTextbox1( $classes );
 1555+
 1556+ $wgOut->addHTML( $this->editFormTextAfterContent );
15511557
15521558 $wgOut->wrapWikiMsg( "<div id=\"editpage-copywarn\">\n$1\n</div>", $copywarnMsg );
15531559 $wgOut->addHTML( <<<END
@@ -1870,7 +1876,7 @@
18711877 $wgOut->parse( $note ) . $conflict . "</div>\n";
18721878
18731879 wfProfileOut( __METHOD__ );
1874 - return $previewhead . $previewHTML;
 1880+ return $previewhead . $previewHTML . $this->previewTextAfterContent;
18751881 }
18761882
18771883 function getTemplates() {

Comments

#Comment by Tim Starling (talk | contribs)   05:38, 17 December 2009

I think this coding style is mostly a holdover from C++. What's wrong with initialising member variables in the declaration? It's 3 times faster, looks nicer, and wouldn't break subclasses that attempt to set a value before they call parent::__construct().

Status & tagging log