r71084 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71083‎ | r71084 | r71085 >
Date:19:56, 14 August 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added error messages
Modified paths:
  • /trunk/extensions/Deployment/Deployment.i18n.php (modified) (history)
  • /trunk/extensions/Deployment/specials/SpecialExtensions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Deployment/specials/SpecialExtensions.php
@@ -188,53 +188,58 @@
189189 global $wgOut, $wgExtensionCredits;
190190
191191 if ( !array_key_exists( $this->typeFilter, $wgExtensionCredits ) && $this->typeFilter != 'all' ) {
192 - // TODO
 192+ $wgOut->addWikiMsgArray( 'extension-invalid-category', $this->typeFilter );
 193+ $this->typeFilter = 'all';
193194 }
 195+
 196+ $extensions = array();
 197+
 198+ if ( $this->typeFilter == 'all' ) {
 199+ foreach ( $wgExtensionCredits as $type => $exts ) {
 200+ $extensions = array_merge( $extensions, $exts );
 201+ }
 202+ }
194203 else {
195 - $extensions = array();
196 -
 204+ $extensions = $wgExtensionCredits[$this->typeFilter];
 205+ }
 206+
 207+ if ( count( $extensions ) == 0 ) {
197208 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' );
201210 }
202211 else {
203 - $extensions = $wgExtensionCredits[$this->typeFilter];
 212+ $wgOut->addWikiMsgArray( 'extension-empty-category', $this->typeFilter );
204213 }
 214+ }
 215+ else {
 216+ $extensionObjects = array();
205217
206 - if ( count( $extensions ) == 0 ) {
207 - // TODO
 218+ foreach( $extensions as $extension ) {
 219+ $infoObject = ExtensionInfo::newFromArray( $extension );
 220+ $extensionObjects[$infoObject->getName()] = $infoObject;
208221 }
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' ) );
239244 }
240245 }
241246
Index: trunk/extensions/Deployment/Deployment.i18n.php
@@ -56,6 +56,9 @@
5757 'extension-type-all' => 'All',
5858 'extension-bulk-actions' => 'Bulk Actions',
5959 '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.',
6063
6164 // Special:Update
6265 'mediawiki-up-to-date' => 'You have the latest version of MediaWiki.',

Status & tagging log