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

Revision: 99638
Author:   jeroendedauw
Date:     2011-10-12 17:22:20 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
fixed success message and redirect after signup

Modified Paths:
--------------
    trunk/extensions/Contest/Contest.i18n.php
    trunk/extensions/Contest/specials/SpecialContest.php
    trunk/extensions/Contest/specials/SpecialContestSignup.php
    trunk/extensions/Contest/specials/SpecialMyContests.php

Modified: trunk/extensions/Contest/Contest.i18n.php
===================================================================
--- trunk/extensions/Contest/Contest.i18n.php   2011-10-12 17:15:20 UTC (rev 
99637)
+++ trunk/extensions/Contest/Contest.i18n.php   2011-10-12 17:22:20 UTC (rev 
99638)
@@ -147,6 +147,7 @@
        'contest-contest-status' => 'Status',
        'contest-contest-submissioncount' => 'Amount of participants',
        'contest-contest-contestants' => 'Contest contestants',
+       'contest-contest-contestants-text' => 'To judge an individual entry, 
click on the entry ID in the left column.',
 
        // Contestant pager
        'contest-contestant-id' => 'ID',

Modified: trunk/extensions/Contest/specials/SpecialContest.php
===================================================================
--- trunk/extensions/Contest/specials/SpecialContest.php        2011-10-12 
17:15:20 UTC (rev 99637)
+++ trunk/extensions/Contest/specials/SpecialContest.php        2011-10-12 
17:22:20 UTC (rev 99638)
@@ -134,6 +134,8 @@
                        }
                }
                
+               $out->addWikiMsg( 'contest-contest-contestants-text' );
+               
                $pager = new ContestantPager( $this, $conds );
                
                if ( $pager->getNumRows() ) {

Modified: trunk/extensions/Contest/specials/SpecialContestSignup.php
===================================================================
--- trunk/extensions/Contest/specials/SpecialContestSignup.php  2011-10-12 
17:15:20 UTC (rev 99637)
+++ trunk/extensions/Contest/specials/SpecialContestSignup.php  2011-10-12 
17:22:20 UTC (rev 99638)
@@ -190,8 +190,8 @@
         * @param Contest $contest
         */
        protected function showSucess( Contest $contest ) {
-               // TODO: insert something here so the mycontests page can 
identiy it's a signup and show a success message
-               $this->getOutput()->redirect( SpecialPage::getTitleFor( 
'MyContests', $contest->getField( 'name' ) ) );
+               $url = SpecialPage::getTitleFor( 'MyContests', 
$contest->getField( 'name' ) )->getLocalURL( 'new' );
+               $this->getOutput()->redirect( $url );
        }
        
        /**

Modified: trunk/extensions/Contest/specials/SpecialMyContests.php
===================================================================
--- trunk/extensions/Contest/specials/SpecialMyContests.php     2011-10-12 
17:15:20 UTC (rev 99637)
+++ trunk/extensions/Contest/specials/SpecialMyContests.php     2011-10-12 
17:22:20 UTC (rev 99638)
@@ -36,7 +36,8 @@
                        return;
                }
                
-               if ( $this->getRequest()->wasPosted() && 
$this->getUser()->matchEditToken( $this->getRequest()->getVal( 'wpEditToken' ) 
) ) {
+               if ( $this->getRequest()->wasPosted()
+                       && $this->getUser()->matchEditToken( 
$this->getRequest()->getVal( 'wpEditToken' ) ) ) {
                        $contestant = ContestContestant::s()->selectRow( null, 
array( 'id' => $this->getRequest()->getInt( 'wpcontestant-id' ) ) );
                        $this->showSubmissionPage( $contestant );
                }
@@ -235,12 +236,13 @@
         * @param ContestContestant $contestant
         */
        protected function showSubmissionPage( ContestContestant $contestant ) {
-               // TODO: redirects with fragment apparently don't work - need 
other solution here
-               if ( $this->getTitle()->getFragment() == 'new' ) {
+               if ( $this->getRequest()->getCheck( 'new' ) ) {
                        $this->showSuccess( 'contest-mycontests-signup-success' 
);
                }
                
                $this->getOutput()->setPageTitle( 
$contestant->getContest()->getField( 'name' ) );
+               
+               $this->getOutput()->addHTML('<div style="clear:both;"></div>');
                $this->getOutput()->addWikiMsg( 'contest-submission-header', 
$contestant->getContest()->getField( 'name' ) );
                
                $form = new HTMLForm( $this->getFormFields( $contestant ), 
$this->getContext() );


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

Reply via email to