r100240 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100239‎ | r100240 | r100241 >
Date:17:09, 19 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Parse Wikitext out of challenge text, doesn't feel like the right place to be doing this, but struggling for anywhere to add some formatting in the ContestChallenge class
Tweak documentation
Modified paths:
  • /trunk/extensions/Contest/specials/SpecialContestWelcome.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/specials/SpecialContestWelcome.php
@@ -38,11 +38,10 @@
3939
4040 $out = $this->getOutput();
4141
42 - $contest = Contest::s()->selectRow( null, array( 'name' => $subPage ) );
43 -
4442 /**
4543 * @var $contest Contest
4644 */
 45+ $contest = Contest::s()->selectRow( null, array( 'name' => $subPage ) );
4746
4847 if ( $contest === false ) {
4948 $this->showError( 'contest-welcome-unknown' );
@@ -50,7 +49,7 @@
5150 $out->returnToMain();
5251 }
5352 else if ( ( $contest->getStatus() == Contest::STATUS_FINISHED ) ||
54 - ( $contest->getStatus() == Contest::STATUS_EXPIRED ) ) {
 53+ ( $contest->getStatus() == Contest::STATUS_EXPIRED ) ) {
5554 $this->showWarning( 'contest-signup-finished' );
5655 $out->addHTML( '<br /><br /><br /><br />' );
5756 $out->returnToMain();
@@ -132,9 +131,14 @@
133132 protected function addContestJS( Contest $contest ) {
134133 $challenges = array();
135134
 135+ $output = $this->getOutput();
 136+ /**
 137+ * @var $challenge ContestChallenge
 138+ */
136139 foreach ( $contest->getChallenges() as /* ContestChallenge */ $challenge ) {
137140 $data = $challenge->toArray();
138141 $data['target'] = $this->getSignupLink( $contest->getField( 'name' ), $challenge->getId() );
 142+ $data['text'] = $output->parse( $data['text'] );
139143 $challenges[] = $data;
140144 }
141145

Follow-up revisions

RevisionCommit summaryAuthorDate
r1002461.18wmf1 MFT r100240, r100245reedy17:51, 19 October 2011

Status & tagging log