Index: trunk/extensions/Survey/Survey.i18n.php |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | 'survey-navigation-edit' => '[[Special:Survey/$1|Edit this survey]]', |
49 | 49 | 'survey-navigation-take' => '[[Special:TakeSurvey/$1|Take this survey]]', |
50 | 50 | 'survey-navigation-list' => '[[Special:Surveys|Surveys list]]', |
| 51 | + 'survey-navigation-stats' => '[[Special:SurveyStats/$1|View statistics]]', |
51 | 52 | |
52 | 53 | // Special:Surveys |
53 | 54 | 'surveys-special-addnew' => 'Add a new survey', |
Index: trunk/extensions/Survey/specials/SpecialSurveyPage.php |
— | — | @@ -106,4 +106,15 @@ |
107 | 107 | ); |
108 | 108 | } |
109 | 109 | |
| 110 | + /** |
| 111 | + * Display navigation links. |
| 112 | + * |
| 113 | + * @since 0.1 |
| 114 | + * |
| 115 | + * @param array $links |
| 116 | + */ |
| 117 | + protected function displayNavigation( array $links ) { |
| 118 | + $this->getOutput()->addHTML( Html::rawElement( 'p', array(), implode( ' - ', $links ) ) ); |
| 119 | + } |
| 120 | + |
110 | 121 | } |
Index: trunk/extensions/Survey/specials/SpecialSurveyStats.php |
— | — | @@ -39,7 +39,13 @@ |
40 | 40 | |
41 | 41 | if ( Survey::has( array( 'name' => $subPage ) ) ) { |
42 | 42 | $survey = Survey::newFromName( $subPage ); |
43 | | - $this->displayNavigation( $survey ); |
| 43 | + |
| 44 | + $this->displayNavigation( array( |
| 45 | + wfMsgExt( 'survey-navigation-edit', 'parseinline', $survey->getField( 'name' ) ), |
| 46 | + wfMsgExt( 'survey-navigation-take', 'parseinline', $survey->getField( 'name' ) ), |
| 47 | + wfMsgExt( 'survey-navigation-list', 'parseinline' ) |
| 48 | + ) ); |
| 49 | + |
44 | 50 | $this->displayStats( $survey ); |
45 | 51 | } |
46 | 52 | else { |
— | — | @@ -49,23 +55,6 @@ |
50 | 56 | } |
51 | 57 | |
52 | 58 | /** |
53 | | - * Display links to edit and take the survey. |
54 | | - * |
55 | | - * @since 0.1 |
56 | | - * |
57 | | - * @param Survey $survey |
58 | | - */ |
59 | | - protected function displayNavigation( Survey $survey ) { |
60 | | - $links = array( |
61 | | - wfMsgExt( 'survey-navigation-edit', 'parseinline', $survey->getField( 'name' ) ), |
62 | | - wfMsgExt( 'survey-navigation-take', 'parseinline', $survey->getField( 'name' ) ), |
63 | | - wfMsgExt( 'survey-navigation-list', 'parseinline' ) |
64 | | - ); |
65 | | - |
66 | | - $this->getOutput()->addHTML( Html::rawElement( 'p', array(), implode( ' - ', $links ) ) ); |
67 | | - } |
68 | | - |
69 | | - /** |
70 | 59 | * Display the statistics that go with the survey. |
71 | 60 | * |
72 | 61 | * @since 0.1 |
Index: trunk/extensions/Survey/specials/SpecialSurvey.php |
— | — | @@ -47,6 +47,13 @@ |
48 | 48 | if ( $survey === false ) { |
49 | 49 | $survey = new Survey( array( 'name' => $subPage ), true ); |
50 | 50 | } |
| 51 | + else { |
| 52 | + $this->displayNavigation( array( |
| 53 | + wfMsgExt( 'survey-navigation-take', 'parseinline', $subPage ), |
| 54 | + wfMsgExt( 'survey-navigation-stats', 'parseinline', $subPage ), |
| 55 | + wfMsgExt( 'survey-navigation-list', 'parseinline' ) |
| 56 | + ) ); |
| 57 | + } |
51 | 58 | |
52 | 59 | $this->showSurvey( $survey ); |
53 | 60 | $this->addModules( 'ext.survey.special.survey' ); |
Index: trunk/extensions/Survey/specials/SpecialTakeSurvey.php |
— | — | @@ -62,6 +62,12 @@ |
63 | 63 | * @param string $subPage |
64 | 64 | */ |
65 | 65 | protected function displaySurvey( $subPage ) { |
| 66 | + $this->displayNavigation( array( |
| 67 | + wfMsgExt( 'survey-navigation-edit', 'parseinline', $subPage ), |
| 68 | + wfMsgExt( 'survey-navigation-stats', 'parseinline', $subPage ), |
| 69 | + wfMsgExt( 'survey-navigation-list', 'parseinline' ) |
| 70 | + ) ); |
| 71 | + |
66 | 72 | $this->getOutput()->addWikiText( Xml::element( |
67 | 73 | 'survey', |
68 | 74 | array( |