Index: trunk/extensions/MoodBar/SpecialMoodBarFeedback.php |
— | — | @@ -36,6 +36,7 @@ |
37 | 37 | } |
38 | 38 | |
39 | 39 | public function buildForm() { |
| 40 | + global $wgRequest; |
40 | 41 | $filtersMsg = wfMessage( 'moodbar-feedback-filters' )->escaped(); |
41 | 42 | $typeMsg = wfMessage( 'moodbar-feedback-filters-type' )->escaped(); |
42 | 43 | $praiseMsg = wfMessage( 'moodbar-feedback-filters-type-happy' )->escaped(); |
— | — | @@ -45,6 +46,16 @@ |
46 | 47 | $setFiltersMsg = wfMessage( 'moodbar-feedback-filters-button' )->escaped(); |
47 | 48 | $whatIsMsg = wfMessage( 'moodbar-feedback-whatis' )->escaped(); |
48 | 49 | |
| 50 | + $types = $wgRequest->getArray( 'type' ); |
| 51 | + $happyCheckbox = Xml::check( 'type[]', in_array( 'happy', $types ), |
| 52 | + array( 'id' => 'fbd-filters-type-praise', 'value' => 'happy' ) ); |
| 53 | + $confusedCheckbox = Xml::check( 'type[]', in_array( 'confused', $types ), |
| 54 | + array( 'id' => 'fbd-filters-type-confusion', 'value' => 'confused' ) ); |
| 55 | + $sadCheckbox = Xml::check( 'type[]', in_array( 'sad', $types ), |
| 56 | + array( 'id' => 'fbd-filters-type-issues', 'value' => 'sad' ) ); |
| 57 | + $usernameTextbox = Html::input( 'username', $wgRequest->getText( 'username' ), 'text', |
| 58 | + array( 'id' => 'fbd-filters-username', 'class' => 'fbd-filters-input' ) ); |
| 59 | + |
49 | 60 | return <<<HTML |
50 | 61 | <div id="fbd-filters"> |
51 | 62 | <form> |
— | — | @@ -53,21 +64,21 @@ |
54 | 65 | <legend class="fbd-filters-label">$typeMsg</legend> |
55 | 66 | <ul> |
56 | 67 | <li> |
57 | | - <input type="checkbox" id="fbd-filters-type-praise" name="type[]" value="happy"> |
| 68 | + $happyCheckbox |
58 | 69 | <label for="fbd-filters-type-praise" id="fbd-filters-type-praise-label">$praiseMsg</label> |
59 | 70 | </li> |
60 | 71 | <li> |
61 | | - <input type="checkbox" id="fbd-filters-type-confusion" name="type[]" value="confused"> |
| 72 | + $confusedCheckbox |
62 | 73 | <label for="fbd-filters-type-confusion" id="fbd-filters-type-confusion-label">$confusionMsg</label> |
63 | 74 | </li> |
64 | 75 | <li> |
65 | | - <input type="checkbox" id="fbd-filters-type-issues" name="type[]" value="sad"> |
| 76 | + $sadCheckbox |
66 | 77 | <label for="fbd-filters-type-issues" id="fbd-filters-type-issues-label">$issuesMsg</label> |
67 | 78 | </li> |
68 | 79 | </ul> |
69 | 80 | </fieldset> |
70 | 81 | <label for="fbd-filters-username" class="fbd-filters-label">$usernameMsg</label> |
71 | | - <input type="text" id="fbd-filters-username" class="fbd-filters-input" name="username" /> |
| 82 | + $usernameTextbox |
72 | 83 | <button type="submit" id="fbd-filters-set">$setFiltersMsg</button> |
73 | 84 | </form> |
74 | 85 | <a href="#" id="fbd-about">$whatIsMsg</a> |