Index: trunk/extensions/Deployment/specials/SpecialExtensions.php |
— | — | @@ -148,7 +148,7 @@ |
149 | 149 | $name = Html::element( |
150 | 150 | 'a', |
151 | 151 | array( |
152 | | - 'href' => self::getTitle( $type )->getFullURL() |
| 152 | + 'href' => self::getTitle( $type == 'all' ? null : $type )->getFullURL() |
153 | 153 | ), |
154 | 154 | $message |
155 | 155 | ); |
— | — | @@ -201,7 +201,7 @@ |
202 | 202 | ); |
203 | 203 | |
204 | 204 | $listHtml .= '<tr>' . |
205 | | - Html::element( 'th', array(), wfMsg( 'extensionlist-name' ) ) . |
| 205 | + Html::element( 'th', array(), wfMsg( 'extension' ) ) . |
206 | 206 | Html::element( 'th', array(), wfMsg( 'extensionlist-description' ) ) |
207 | 207 | . '</tr>'; |
208 | 208 | |
— | — | @@ -231,30 +231,12 @@ |
232 | 232 | $html .= Html::rawElement( |
233 | 233 | 'td', |
234 | 234 | array(), |
235 | | - Html::element( 'b', array(), $extension['name'] ) . |
236 | | - '<br />' . |
237 | | - Html::element( |
238 | | - 'a', |
239 | | - array( |
240 | | - 'href' => $extension['url'], |
241 | | - 'class' => 'external text' |
242 | | - ), |
243 | | - wfMsg( 'extensionlist-details' ) |
244 | | - ) . |
245 | | - ' | ' . |
246 | | - Html::element( |
247 | | - 'a', |
248 | | - array( |
249 | | - 'href' => '', |
250 | | - 'class' => 'external text' |
251 | | - ), |
252 | | - wfMsg( 'extensionlist-download' ) |
253 | | - ) |
| 235 | + $this->getItemNameTdContents( $extension ) |
254 | 236 | ); |
255 | 237 | |
256 | 238 | $description = self::getExtensionDescription( $extension ); |
257 | 239 | $authors = self::getExtensionAuthors( $extension ); |
258 | | - $version = self::getExtensionVersion( $extension ); |
| 240 | + $version = wfMsgExt( 'extensionlist-version-number', 'parsemag', self::getExtensionVersion( $extension ) ); |
259 | 241 | |
260 | 242 | $html .= Html::rawElement( |
261 | 243 | 'td', |
— | — | @@ -266,6 +248,44 @@ |
267 | 249 | } |
268 | 250 | |
269 | 251 | /** |
| 252 | + * Returns the contents for the first field in an extension row. |
| 253 | + * If the user has the required permissions, controls will be shown. |
| 254 | + * |
| 255 | + * @since 0.1 |
| 256 | + * |
| 257 | + * @param $extension Array |
| 258 | + * |
| 259 | + * @return string |
| 260 | + */ |
| 261 | + protected function getItemNameTdContents( array $extension ) { |
| 262 | + $name = Html::element( 'b', array(), $extension['name'] ); |
| 263 | + |
| 264 | + $controls = array(); |
| 265 | + |
| 266 | + $controls[] = Html::element( |
| 267 | + 'a', |
| 268 | + array( |
| 269 | + 'href' => $extension['url'], |
| 270 | + 'class' => 'external text' |
| 271 | + ), |
| 272 | + wfMsg( 'extensionlist-details' ) |
| 273 | + ); |
| 274 | + |
| 275 | + // TODO: permission check |
| 276 | + if ( true ) { |
| 277 | + $controls[] = Html::element( |
| 278 | + 'a', |
| 279 | + array( |
| 280 | + 'href' => '', |
| 281 | + ), |
| 282 | + wfMsg( 'extensionlist-deactivate' ) |
| 283 | + ); |
| 284 | + } |
| 285 | + |
| 286 | + return $name . '<br />' . implode( ' | ', $controls ); |
| 287 | + } |
| 288 | + |
| 289 | + /** |
270 | 290 | * Returns the decription for an extension. |
271 | 291 | * |
272 | 292 | * @since 0.1 |
— | — | @@ -327,8 +347,7 @@ |
328 | 348 | * @return string |
329 | 349 | */ |
330 | 350 | public static function getExtensionVersion( array $extension ) { |
331 | | - // TODO: add "version " i18n stuff and escape |
332 | | - return array_key_exists( 'version', $extension ) ? $extension['version'] : ''; |
| 351 | + return array_key_exists( 'version', $extension ) ? $extension['version'] : wfMsg( 'extensionlist-version-unknown' ); |
333 | 352 | } |
334 | 353 | |
335 | 354 | } |
\ No newline at end of file |
Index: trunk/extensions/Deployment/Deployment.i18n.php |
— | — | @@ -31,11 +31,28 @@ |
32 | 32 | 'update-title' => 'MediaWiki updates', |
33 | 33 | 'install-title' => 'Install extensions', |
34 | 34 | |
| 35 | + // Special:Extensions and Special:Install extension lists |
| 36 | + 'extensionlist-name' => 'Name', |
| 37 | + 'extensionlist-version' => 'Version', |
| 38 | + 'extensionlist-version-number' => 'Version $1', |
| 39 | + 'extensionlist-version-unknown' => 'unknown', |
| 40 | + 'extensionlist-stability' => 'Stability', |
| 41 | + 'extensionlist-rating' => 'Rating', |
| 42 | + 'extensionlist-description' => 'Description', |
| 43 | + 'extensionlist-details' => 'Details', |
| 44 | + 'extensionlist-download' => 'Download', |
| 45 | + 'extensionlist-installnow' => 'Install now', |
| 46 | + 'extensionlist-createdby' => 'By $1', |
| 47 | + 'extensionlist-deactivate' => 'Deactivate', |
| 48 | + 'extensionlist-activate' => 'Activate', |
| 49 | + 'extensionlist-delete' => 'Delete', |
| 50 | + |
35 | 51 | // Special:Dashboard |
36 | 52 | |
37 | 53 | // Special:Extensions |
38 | 54 | 'add-new-extensions' => 'Add new', |
39 | 55 | 'extension-type-all' => 'All', |
| 56 | + 'extension-bulk-actions' => 'Bulk Actions', |
40 | 57 | |
41 | 58 | // Special:Update |
42 | 59 | 'mediawiki-up-to-date' => 'You have the latest version of MediaWiki.', |
— | — | @@ -53,16 +70,6 @@ |
54 | 71 | 'popular-extension-tags' => 'Popular tags', |
55 | 72 | 'popular-extension-tags-long' => 'You may also browse based on the most popular tags in the Extension Repository:', |
56 | 73 | |
57 | | - 'extensionlist-name' => 'Name', |
58 | | - 'extensionlist-version' => 'Version', |
59 | | - 'extensionlist-stability' => 'Stability', |
60 | | - 'extensionlist-rating' => 'Rating', |
61 | | - 'extensionlist-description' => 'Description', |
62 | | - 'extensionlist-details' => 'Details', |
63 | | - 'extensionlist-download' => 'Download', |
64 | | - 'extensionlist-installnow' => 'Install now', |
65 | | - 'extensionlist-createdby' => 'By $1.', |
66 | | - |
67 | 74 | 'stability-alpha' => 'Alpha', |
68 | 75 | 'stability-beta' => 'Beta', |
69 | 76 | 'stability-dev' => 'Experimental', |