Index: trunk/extensions/Deployment/specials/SpecialExtensions.php |
— | — | @@ -188,53 +188,58 @@ |
189 | 189 | global $wgOut, $wgExtensionCredits; |
190 | 190 | |
191 | 191 | if ( !array_key_exists( $this->typeFilter, $wgExtensionCredits ) && $this->typeFilter != 'all' ) { |
192 | | - // TODO |
| 192 | + $wgOut->addWikiMsgArray( 'extension-invalid-category', $this->typeFilter ); |
| 193 | + $this->typeFilter = 'all'; |
193 | 194 | } |
| 195 | + |
| 196 | + $extensions = array(); |
| 197 | + |
| 198 | + if ( $this->typeFilter == 'all' ) { |
| 199 | + foreach ( $wgExtensionCredits as $type => $exts ) { |
| 200 | + $extensions = array_merge( $extensions, $exts ); |
| 201 | + } |
| 202 | + } |
194 | 203 | else { |
195 | | - $extensions = array(); |
196 | | - |
| 204 | + $extensions = $wgExtensionCredits[$this->typeFilter]; |
| 205 | + } |
| 206 | + |
| 207 | + if ( count( $extensions ) == 0 ) { |
197 | 208 | if ( $this->typeFilter == 'all' ) { |
198 | | - foreach ( $wgExtensionCredits as $type => $exts ) { |
199 | | - $extensions = array_merge( $extensions, $exts ); |
200 | | - } |
| 209 | + $wgOut->addWikiMsgArray( 'extension-none-installed', 'Special:Install' ); |
201 | 210 | } |
202 | 211 | else { |
203 | | - $extensions = $wgExtensionCredits[$this->typeFilter]; |
| 212 | + $wgOut->addWikiMsgArray( 'extension-empty-category', $this->typeFilter ); |
204 | 213 | } |
| 214 | + } |
| 215 | + else { |
| 216 | + $extensionObjects = array(); |
205 | 217 | |
206 | | - if ( count( $extensions ) == 0 ) { |
207 | | - // TODO |
| 218 | + foreach( $extensions as $extension ) { |
| 219 | + $infoObject = ExtensionInfo::newFromArray( $extension ); |
| 220 | + $extensionObjects[$infoObject->getName()] = $infoObject; |
208 | 221 | } |
209 | | - else { |
210 | | - $extensionObjects = array(); |
211 | | - |
212 | | - foreach( $extensions as $extension ) { |
213 | | - $infoObject = ExtensionInfo::newFromArray( $extension ); |
214 | | - $extensionObjects[$infoObject->getName()] = $infoObject; |
215 | | - } |
216 | | - |
217 | | - $extensionNames = array_keys( $extensionObjects ); |
218 | | - |
219 | | - natcasesort( $extensionNames ); |
220 | | - |
221 | | - $wgOut->addHTML( Html::openElement( |
222 | | - 'table', |
223 | | - array( 'class' => 'wikitable', 'style' => 'width:100%' ) |
224 | | - ) ); |
225 | | - |
226 | | - $wgOut->addHTML( |
227 | | - '<tr>' . |
228 | | - Html::element( 'th', array(), wfMsg( 'extension' ) ) . |
229 | | - Html::element( 'th', array(), wfMsg( 'extensionlist-description' ) ) |
230 | | - . '</tr>' |
231 | | - ); |
232 | | - |
233 | | - foreach ( $extensionNames as $extensionName ) { |
234 | | - $this->displayExtensionRow( $extensionObjects[$extensionName] ); |
235 | | - } |
236 | | - |
237 | | - $wgOut->addHTML( Html::closeElement( 'table' ) ); |
238 | | - } |
| 222 | + |
| 223 | + $extensionNames = array_keys( $extensionObjects ); |
| 224 | + |
| 225 | + natcasesort( $extensionNames ); |
| 226 | + |
| 227 | + $wgOut->addHTML( Html::openElement( |
| 228 | + 'table', |
| 229 | + array( 'class' => 'wikitable', 'style' => 'width:100%' ) |
| 230 | + ) ); |
| 231 | + |
| 232 | + $wgOut->addHTML( |
| 233 | + '<tr>' . |
| 234 | + Html::element( 'th', array(), wfMsg( 'extension' ) ) . |
| 235 | + Html::element( 'th', array(), wfMsg( 'extensionlist-description' ) ) |
| 236 | + . '</tr>' |
| 237 | + ); |
| 238 | + |
| 239 | + foreach ( $extensionNames as $extensionName ) { |
| 240 | + $this->displayExtensionRow( $extensionObjects[$extensionName] ); |
| 241 | + } |
| 242 | + |
| 243 | + $wgOut->addHTML( Html::closeElement( 'table' ) ); |
239 | 244 | } |
240 | 245 | } |
241 | 246 | |
Index: trunk/extensions/Deployment/Deployment.i18n.php |
— | — | @@ -56,6 +56,9 @@ |
57 | 57 | 'extension-type-all' => 'All', |
58 | 58 | 'extension-bulk-actions' => 'Bulk Actions', |
59 | 59 | 'extension-page-explanation' => 'This page lists the installed extensions on this wiki. For more info about this wiki installation, see [$1 Special:Version].', |
| 60 | + 'extension-none-installed' => 'There are currently no extensions installed. You can [[$1|add new ones]].', |
| 61 | + 'extension-empty-category' => 'There are no extensions of type \'\'$1\'\' installed.', |
| 62 | + 'extension-invalid-category' => 'Could not filter on extension type \'\'$1\'\', all extenions are shown instead.', |
60 | 63 | |
61 | 64 | // Special:Update |
62 | 65 | 'mediawiki-up-to-date' => 'You have the latest version of MediaWiki.', |