r54081 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54080‎ | r54081 | r54082 >
Date:09:40, 31 July 2009
Author:raymond
Status:reverted
Tags:
Comment:
* The description message in $wgExtensionCredits can be an array with parameters now
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -2765,8 +2765,8 @@
27662766 * <code>
27672767 * $wgExtensionCredits[$type][] = array(
27682768 * 'name' => 'Example extension',
2769 - * 'version' => 1.9,
2770 - * 'path' => __FILE__,
 2769+ * 'version' => 1.9,
 2770+ * 'path' => __FILE__,
27712771 * 'author' => 'Foo Barstein',
27722772 * 'url' => 'http://wwww.example.com/Example%20Extension/',
27732773 * 'description' => 'An example extension',
@@ -2775,6 +2775,8 @@
27762776 * </code>
27772777 *
27782778 * Where $type is 'specialpage', 'parserhook', 'variable', 'media' or 'other'.
 2779+ * Where 'descriptionmsg' can be an array with message key and parameters:
 2780+ * 'descriptionmsg' => array( 'exampleextension-desc', param1, param2, ... ),
27792781 */
27802782 $wgExtensionCredits = array();
27812783 /*
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -473,7 +473,14 @@
474474
475475 # Look for a localized description
476476 if( isset( $descriptionMsg ) ) {
477 - $msg = wfMsg( $descriptionMsg );
 477+ if( is_array( $descriptionMsg ) ) {
 478+ $descriptionMsgKey = $descriptionMsg[0]; // Get the message key
 479+ array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only
 480+ array_map( "htmlspecialchars", $descriptionMsg ); // For sanity
 481+ $msg = wfMsg( $descriptionMsgKey, $descriptionMsg );
 482+ } else {
 483+ $msg = wfMsg( $descriptionMsg );
 484+ }
478485 if ( !wfEmptyMsg( $descriptionMsg, $msg ) && $msg != '' ) {
479486 $description = $msg;
480487 }
Index: trunk/phase3/RELEASE-NOTES
@@ -171,6 +171,7 @@
172172 extension version in Special:Version
173173 * (bug 20014) Added CSS class "mw-listgrouprights-right-name" is wrapped on the
174174 right name in Special:ListGroupRights
 175+* The description message in $wgExtensionCredits can be an array with parameters
175176
176177 === Bug fixes in 1.16 ===
177178

Follow-up revisions

RevisionCommit summaryAuthorDate
r54082Use the new possibility from r54081: Pass the parameter to 'descriptionmsg' too.raymond09:45, 31 July 2009
r54772Recommit r54081 after general revert r54735: The description message in $wgEx...raymond07:08, 11 August 2009

Status & tagging log