r98940 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98939‎ | r98940 | r98941 >
Date:22:25, 4 October 2011
Author:krinkle
Status:ok
Tags:
Comment:
[RL2] Address r98729 CR
* Fix i18n issue in page title usage
* Whitespace fixes
* Remove duplicate comment line that was left from a copy/paste from the showExportForm function below
Modified paths:
  • /branches/RL2/extensions/Gadgets/SpecialGadgets.php (modified) (history)

Diff [purge]

Index: branches/RL2/extensions/Gadgets/SpecialGadgets.php
@@ -137,7 +137,7 @@
138138 array( 'action' => 'edit' )
139139 );
140140 }
141 -
 141+
142142 if ( $user->isAllowed( 'gadgets-definition-delete' ) ) {
143143 $extra[] = Linker::link(
144144 $gadgetDefinitionTitle,
@@ -234,7 +234,7 @@
235235
236236 // There is atleast one gadget, let's get started.
237237 $out->addWikiMsg( 'gadgets-pagetext',
238 - Title::newFromText( 'Special:Recentchanges/namespace=' . NS_GADGET_DEFINITION )->getPrefixedText()
 238+ SpecialPage::getTitleFor( 'Recentchanges', 'namespace=' . NS_GADGET_DEFINITION )->getPrefixedText()
239239 );
240240
241241 // Sort categories alphabetically
@@ -338,37 +338,38 @@
339339 $exportTitles = array();
340340
341341 // NS_GADGET_DEFINITION page of this gadget
342 - $exportTitles[] = GadgetsHooks::getDefinitionTitleFromID( $gadget->getId() );
 342+ $exportTitles[] = GadgetsHooks::getDefinitionTitleFromID( $gadget->getId() );
343343
344344 // Title message in NS_MEDIAWIKI
345 - $exportTitles[] = Title::makeTitleSafe( NS_MEDIAWIKI, $gadget->getTitleMessageKey() );
 345+ $exportTitles[] = Title::makeTitleSafe( NS_MEDIAWIKI, $gadget->getTitleMessageKey() );
346346
347347 // Translation subpages of title message
348 - // @todo
 348+ // @todo
349349
350350 // Description message in NS_MEDIAWIKI
351 - $exportTitles[] = Title::makeTitleSafe( NS_MEDIAWIKI, $gadget->getDescriptionMessageKey() );
 351+ $exportTitles[] = Title::makeTitleSafe( NS_MEDIAWIKI, $gadget->getDescriptionMessageKey() );
352352
353353 // Translation subpages of description message
354 - // @todo
 354+ // @todo
355355
356356 // Module script and styles in NS_GADGET
357 - foreach ( $gadget->getScripts() as $script ) {
358 - $exportTitles[] = Title::makeTitleSafe( NS_GADGET, $script );
359 - }
360 - foreach ( $gadget->getStyles() as $style ) {
361 - $exportTitles[] = Title::makeTitleSafe( NS_GADGET, $style );
362 - }
 357+ foreach ( $gadget->getScripts() as $script ) {
 358+ $exportTitles[] = Title::makeTitleSafe( NS_GADGET, $script );
 359+ }
363360
 361+ foreach ( $gadget->getStyles() as $style ) {
 362+ $exportTitles[] = Title::makeTitleSafe( NS_GADGET, $style );
 363+ }
 364+
364365 $gadgetModule = $gadget->getModule();
365366
366367 // Module messages in NS_MEDIAWIKI
367 - foreach( $gadgetModule->getMessages() as $message ) {
368 - $exportTitles[] = Title::makeTitleSafe( NS_MEDIAWIKI, $message );
369 - }
 368+ foreach( $gadgetModule->getMessages() as $message ) {
 369+ $exportTitles[] = Title::makeTitleSafe( NS_MEDIAWIKI, $message );
 370+ }
370371
371372 // Translation subpages of module messages
372 - // @todo
 373+ // @todo
373374
374375 // Build line-break separated string of prefixed titles
375376 $exportList = '';
@@ -416,7 +417,7 @@
417418 }
418419
419420 /**
420 - * Exports a gadget with its dependencies in a serialized form.
 421+ * Handles [[Special:Gadgets/id]].
421422 * Should not be called if the gadget does not exist. $gadget must be
422423 * an instance of Gadget, not null.
423424 * @param $gadget Gadget

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98729[RL2] Merge gadget manager into SpecialGadgets...krinkle01:26, 3 October 2011

Status & tagging log