r69966 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69965‎ | r69966 | r69967 >
Date:20:22, 26 July 2010
Author:nimishg
Status:deferred (Comments)
Tags:
Comment:
Updates, including redirect
Modified paths:
  • /trunk/extensions/SimpleSurvey/SimpleSurvey.i18n.php (modified) (history)
  • /trunk/extensions/SimpleSurvey/SpecialSimpleSurvey.php (modified) (history)
  • /trunk/extensions/SimpleSurvey/Surveys.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SimpleSurvey/Surveys.php
@@ -1,5 +1,6 @@
22 <?php
33
 4+$wgSimpleSurveyRedirectURL = "";
45
56 $wgValidSurveys[] = 'vitals-07-2010';
67
Index: trunk/extensions/SimpleSurvey/SimpleSurvey.i18n.php
@@ -10,6 +10,7 @@
1111 'simple-survey-invalid' => 'That is not a valid survey at this time',
1212 'simple-survey-back' => 'Go back',
1313 'simple-survey-title' => 'Simple Survey',
 14+ 'simple-survey-confirm' => 'Thanks! Your data has been submited.',
1415
1516 /*vitals 07 2010 */
1617 'simple-survey-intro-vitals-07-2010' => 'This is a quick survey to give us a better idea of who you are',
@@ -17,8 +18,8 @@
1819
1920 'vitals-07-2010-question-use' => 'How often do you use Wikipedia?',
2021 'vitals-07-2010-question-edit' => 'Do you edit Wikipedia?',
21 - 'vitals-07-2010-question-nonprofit' => 'Did you know Wikipedia is a non-profit?',
22 - 'vitals-07-2010-question-wikimedia'=> 'Please describe your knowledge of the Wikimedia Foundation, the organization that hosts Wikipedia and its sitser projects such as Wiktionary and Wikiquote:',
 22+ 'vitals-07-2010-question-nonprofit' => 'Did you know Wikipedia is a non-profit project?',
 23+ 'vitals-07-2010-question-wikimedia'=> 'Which of these describes your knowledge of the Wikimedia Foundation, the organization that hosts Wikipedia and its sister projects such as Wiktionary and Wikiquote:',
2324 'vitals-07-2010-question-age'=> 'Please tell us your age',
2425 'vitals-07-2010-question-programming' => 'Please tell us which one of these describes you:',
2526 'vitals-07-2010-question-gender'=> 'Please tell us your gender',
Index: trunk/extensions/SimpleSurvey/SpecialSimpleSurvey.php
@@ -26,7 +26,7 @@
2727
2828
2929 public function execute( $par ) {
30 - global $wgRequest, $wgOut, $wgUser, $wgPrefSwitchSurveys, $wgPrefSwitchStyleVersion, $wgValidSurveys;
 30+ global $wgRequest, $wgOut, $wgUser, $wgPrefSwitchSurveys, $wgPrefSwitchStyleVersion, $wgValidSurveys, $wgSimpleSurveyRedirectURL;
3131 $this->setHeaders();
3232 // Set page title
3333 $wgOut->setPageTitle( wfMsg( 'simple-survey-title' ) );
@@ -38,6 +38,10 @@
3939 $wgOut->addHtml("<b>" . wfMsg( 'simple-survey-confirm' ). "</b>");
4040 }
4141 //forward to new page
 42+ if($wgSimpleSurveyRedirectURL){
 43+ $wgRequest->response()->header("Location: $wgSimpleSurveyRedirectURL");
 44+ }
 45+
4246 return;
4347 }
4448

Follow-up revisions

RevisionCommit summaryAuthorDate
r71746Followup r69966, use $wgOut->redirect()reedy20:41, 26 August 2010

Comments

#Comment by Catrope (talk | contribs)   16:35, 3 August 2010
+				if($wgSimpleSurveyRedirectURL){
+					$wgRequest->response()->header("Location: $wgSimpleSurveyRedirectURL");
+				}

Please use $wgOut->redirect() for this. For example usage grep the core code.

Status & tagging log