r99571 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99570‎ | r99571 | r99572 >
Date:21:13, 11 October 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
some work on showing success messages
Modified paths:
  • /trunk/extensions/Contest/Contest.i18n.php (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialContestPage.php (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialContestSignup.php (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialMyContests.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/Contest.i18n.php
@@ -191,6 +191,7 @@
192192 'contest-mycontests-finished-text' => 'These are the passed contests you have participated in.',
193193 'contest-mycontests-header-contest' => 'Contest',
194194 'contest-mycontests-header-challenge' => 'Challenge',
 195+ 'contest-mycontests-signup-success' => 'You have successfully signed up for this contest.',
195196
196197 'contest-submission-submit' => 'Submit',
197198 'contest-submission-unknown' => 'There is no contest with the provided name.',
Index: trunk/extensions/Contest/specials/SpecialMyContests.php
@@ -235,6 +235,11 @@
236236 * @param ContestContestant $contestant
237237 */
238238 protected function showSubmissionPage( ContestContestant $contestant ) {
 239+ // TODO: redirects with fragment apparenelt don't work - need other solution here
 240+ if ( $this->getTitle()->getFragment() == 'new' ) {
 241+ $this->showSuccess( 'contest-mycontests-signup-success' );
 242+ }
 243+
239244 $this->getOutput()->setPageTitle( $contestant->getContest()->getField( 'name' ) );
240245 $this->getOutput()->addWikiMsg( 'contest-submission-header', $contestant->getContest()->getField( 'name' ) );
241246
Index: trunk/extensions/Contest/specials/SpecialContestPage.php
@@ -86,6 +86,19 @@
8787 }
8888
8989 /**
 90+ * Show a message in a success box.
 91+ *
 92+ * @since 0.1
 93+ *
 94+ * @param string $message
 95+ */
 96+ protected function showSuccess( $message ) {
 97+ $this->getOutput()->addHTML(
 98+ '<div class="successbox"><strong><p>' . wfMsgExt( $message, 'parseinline' ) . '</p></strong></div>'
 99+ );
 100+ }
 101+
 102+ /**
90103 * Get an array of navigation links.
91104 *
92105 * @param string $contestName
Index: trunk/extensions/Contest/specials/SpecialContestSignup.php
@@ -178,7 +178,8 @@
179179 * @param Contest $contest
180180 */
181181 protected function showSucess( Contest $contest ) {
182 - $this->getOutput()->redirect( SpecialPage::getTitleFor( 'MyContests', $contest->getField( 'name' ) )->getLocalURL() );
 182+ // TODO: insert something here so the mycontests page can identiy it's a signup and show a success message
 183+ $this->getOutput()->redirect( SpecialPage::getTitleFor( 'MyContests', $contest->getField( 'name' ) ) );
183184 }
184185
185186 /**

Status & tagging log