Index: trunk/extensions/Reviews/includes/ReviewPager.php |
— | — | @@ -81,16 +81,16 @@ |
82 | 82 | |
83 | 83 | if ( is_null( $headers ) ) { |
84 | 84 | $headers = array( |
85 | | - 'reviews-pager-post-time', |
86 | | - 'reviews-pager-state', |
87 | | - 'reviews-pager-title', |
| 85 | + 'review_title' => 'reviews-pager-title', |
| 86 | + 'review_page_id' => 'reviews-pager-page', |
| 87 | + 'review_post_time' => 'reviews-pager-post-time', |
88 | 88 | ); |
89 | 89 | |
90 | 90 | if ( !array_key_exists( 'review_user_id', $this->conds ) ) { |
91 | | - $headers[] = 'reviews-pager-user'; |
| 91 | + $headers['review_user_id'] = 'reviews-pager-user'; |
92 | 92 | } |
93 | 93 | |
94 | | - $headers[] = 'reviews-pager-page'; |
| 94 | + $headers['review_state'] = 'reviews-pager-state'; |
95 | 95 | |
96 | 96 | $headers = array_map( 'wfMsg', $headers ); |
97 | 97 | } |
— | — | @@ -113,9 +113,31 @@ |
114 | 114 | */ |
115 | 115 | public function formatValue( $name, $value ) { |
116 | 116 | switch ( $name ) { |
117 | | - case '': |
118 | | - |
| 117 | + case 'review_post_time': |
| 118 | + $value = $this->getLang()->timeanddate( $value, true ); |
119 | 119 | break; |
| 120 | + case 'review_state': |
| 121 | + $value = Review::getStateMessage( $value ); |
| 122 | + break; |
| 123 | + case 'review_page_id': |
| 124 | + $title = Title::newFromID( $value ); |
| 125 | + $value = Html::element( |
| 126 | + 'a', |
| 127 | + array( 'href' => $title->getLocalURL() ), |
| 128 | + $title->getFullText() |
| 129 | + ); |
| 130 | + break; |
| 131 | + case 'review_user_id': |
| 132 | + $title = User::newFromId( $value )->getUserPage(); |
| 133 | + $value = Html::element( |
| 134 | + 'a', |
| 135 | + array( 'href' => $title->getLocalURL() ), |
| 136 | + $title->getFullText() |
| 137 | + ); |
| 138 | + break; |
| 139 | + case 'review_title': |
| 140 | + // TODO |
| 141 | + break; |
120 | 142 | } |
121 | 143 | |
122 | 144 | return $value; |
— | — | @@ -152,7 +174,8 @@ |
153 | 175 | return in_array( |
154 | 176 | $name, |
155 | 177 | array( |
156 | | - // TODO |
| 178 | + 'review_post_time', |
| 179 | + 'review_state', |
157 | 180 | ) |
158 | 181 | ); |
159 | 182 | } |
Index: trunk/extensions/Reviews/includes/Review.php |
— | — | @@ -146,5 +146,24 @@ |
147 | 147 | |
148 | 148 | return $ratings; |
149 | 149 | } |
| 150 | + |
| 151 | + /** |
| 152 | + * Get the message for a review state. |
| 153 | + * |
| 154 | + * @since 0.1 |
| 155 | + * |
| 156 | + * @param Review::STATE_ $state |
| 157 | + * |
| 158 | + * @return string |
| 159 | + */ |
| 160 | + public static function getStateMessage( $state ) { |
| 161 | + $map = array( |
| 162 | + self::STATUS_NEW => 'new', |
| 163 | + self::STATUS_FLAGGED => 'flagged', |
| 164 | + self::STATUS_REVIEWED => 'reviewed', |
| 165 | + ); |
| 166 | + |
| 167 | + return wfMsg( 'reviews-state-' . $map[$state] ); |
| 168 | + } |
150 | 169 | |
151 | 170 | } |
Index: trunk/extensions/Reviews/Reviews.i18n.php |
— | — | @@ -39,6 +39,11 @@ |
40 | 40 | 'group-reviewer-member' => '{{GENDER:$1|Reviewer}}', |
41 | 41 | 'grouppage-reviewer' => '{{ns:project}}:Reviewers', |
42 | 42 | |
| 43 | + // Review states |
| 44 | + 'reviews-state-new' => 'New', |
| 45 | + 'reviews-state-flagged' => 'Flagged', |
| 46 | + 'reviews-state-reviewed' => 'Reviewed', |
| 47 | + |
43 | 48 | // Preferences |
44 | 49 | 'prefs-reviews' => 'Reviews', |
45 | 50 | 'reviews-prefs-showtoplink' => 'Show a link to [[Special:MyReviews|your reviews]] at the top of every page.', |