http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100246

Revision: 100246
Author:   reedy
Date:     2011-10-19 17:51:49 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
1.18wmf1 MFT r100240, r100245

Modified Paths:
--------------
    branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php
    branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestWelcome.php
    branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialMyContests.php

Property Changed:
----------------
    branches/wmf/1.18wmf1/extensions/Contest/


Property changes on: branches/wmf/1.18wmf1/extensions/Contest
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/extensions/Contest:51646
/branches/REL1_17/phase3/extensions/Contest:81445,81448
/branches/new-installer/phase3/extensions/Contest:43664-66004
/branches/sqlite/extensions/Contest:58211-58321
/trunk/extensions/Contest:99592,99653,100190-100191,100193,100198,100200
/trunk/phase3/extensions/Contest:92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,98578,98598,98656
   + /branches/REL1_15/phase3/extensions/Contest:51646
/branches/REL1_17/phase3/extensions/Contest:81445,81448
/branches/new-installer/phase3/extensions/Contest:43664-66004
/branches/sqlite/extensions/Contest:58211-58321
/trunk/extensions/Contest:99592,99653,100190-100191,100193,100198,100200,100240,100245
/trunk/phase3/extensions/Contest:92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,98578,98598,98656

Modified: branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php   2011-10-19 
17:48:54 UTC (rev 100245)
+++ branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php   2011-10-19 
17:51:49 UTC (rev 100246)
@@ -207,7 +207,8 @@
        'contest-submission-invalid-url' => 'This URL does not match one of the 
allowed formats.',
        'contest-submission-new-submission' => 'You still need to enter the URL 
to your submission. This needs to be done before the deadline.',
        'contest-submission-current-submission' => 'This is the URL to your 
submission, which you can modify untill the deadline.',
-       'contest-submission-challenge' => 'You are currently on the $1 
challenge',
+       'contest-submission-challenge' => 'You are currently participating in 
the $1 challenge.',
+       'contest-submission-challenge-description' => "'''Current challenge: 
$1''' -- $2",
 
        // TODO: how can this be done properly in JS?
        'contest-submission-domains' => 'Submissions are restricted to these 
sites: $1',
@@ -288,6 +289,9 @@
        'contest-mycontests-addition-success' => 'Message shown when a user has 
added a submission',
        'contest-mycontests-updated-success' => 'Message shown when a user has 
editied a submission',
        'contest-mycontests-sessionfail' => 'Session failure',
+
+       'contest-submission-challenge' => 'Tells the user which challenge they 
are part of. $1 is the challenge name',
+       'contest-submission-challenge-description' => 'Output of challenge name 
and description. $1 is the challenge name, $2 is the challenge description',
 );
 
 /** German (Deutsch)

Modified: 
branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestWelcome.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestWelcome.php 
2011-10-19 17:48:54 UTC (rev 100245)
+++ branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestWelcome.php 
2011-10-19 17:51:49 UTC (rev 100246)
@@ -38,11 +38,10 @@
 
                $out = $this->getOutput();
 
-               $contest = Contest::s()->selectRow( null, array( 'name' => 
$subPage ) );
-
                /**
                 * @var $contest Contest
                 */
+               $contest = Contest::s()->selectRow( null, array( 'name' => 
$subPage ) );
 
                if ( $contest === false ) {
                        $this->showError( 'contest-welcome-unknown' );
@@ -50,7 +49,7 @@
                        $out->returnToMain();
                }
                else if ( ( $contest->getStatus() == Contest::STATUS_FINISHED ) 
||
-                         ( $contest->getStatus() == Contest::STATUS_EXPIRED ) 
) {
+                       ( $contest->getStatus() == Contest::STATUS_EXPIRED ) ) {
                        $this->showWarning( 'contest-signup-finished' );
                        $out->addHTML( '<br /><br /><br /><br />' );
                        $out->returnToMain();
@@ -132,9 +131,14 @@
        protected function addContestJS( Contest $contest ) {
                $challenges = array();
 
+               $output = $this->getOutput();
+               /**
+                * @var $challenge ContestChallenge
+                */
                foreach ( $contest->getChallenges() as /* ContestChallenge */ 
$challenge ) {
                        $data = $challenge->toArray();
                        $data['target'] = $this->getSignupLink( 
$contest->getField( 'name' ), $challenge->getId() );
+                       $data['text'] = $output->parse( $data['text'] );
                        $challenges[] = $data;
                }
 

Modified: 
branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialMyContests.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialMyContests.php     
2011-10-19 17:48:54 UTC (rev 100245)
+++ branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialMyContests.php     
2011-10-19 17:51:49 UTC (rev 100246)
@@ -303,9 +303,26 @@
                $form->setSubmitText( wfMsg( 'contest-submission-submit' ) );
 
                $challengeId = $contestant->getField( 'challenge_id' );
-               $challenge = ContestChallenge::getTitlesForIds( $challengeId );
-               $output->addWikiMsg( 'contest-submission-challenge', 
$challenge[$challengeId] );
+               $challenges = $contest->getChallenges();
 
+               /**
+                * @var $challenge ContestChallenge
+                */
+               $challenge = null;
+               foreach( $challenges as $challenge ) {
+                       if ( $challenge->getId() == $challengeId ) {
+                               break;
+                       }
+               }
+
+               if ( $challenge !== null ) {
+                       $challengeName = $challenge->getField( 'title' );
+                       $challengeDescription = $challenge->getField( 'text' );
+
+                       $output->addWikiMsg( 'contest-submission-challenge', 
$challengeName );
+                       $output->addWikiMsg( 
'contest-submission-challenge-description', $challengeName, 
$challengeDescription );
+               }
+
                if( $form->show() ) {
                        $query = is_null( $this->submissionState ) ? '' : 
$this->submissionState;
                        $output->redirect( $this->getTitle( $contest->getField( 
'name' ) )->getLocalURL( $query ) );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to