logo       

[MediaWiki-CVS] SVN: [54081] trunk/phase3: msg#01459

mediawiki-cvs

Subject: [MediaWiki-CVS] SVN: [54081] trunk/phase3

http://www.mediawiki.org/wiki/Special:Code/MediaWiki/54081

Revision: 54081
Author: raymond
Date: 2009-07-31 09:40:11 +0000 (Fri, 31 Jul 2009)

Log Message:
-----------
* The description message in $wgExtensionCredits can be an array with
parameters now

Modified Paths:
--------------
trunk/phase3/RELEASE-NOTES
trunk/phase3/includes/DefaultSettings.php
trunk/phase3/includes/specials/SpecialVersion.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES 2009-07-31 09:36:29 UTC (rev 54080)
+++ trunk/phase3/RELEASE-NOTES 2009-07-31 09:40:11 UTC (rev 54081)
@@ -171,6 +171,7 @@
extension version in Special:Version
* (bug 20014) Added CSS class "mw-listgrouprights-right-name" is wrapped on the
right name in Special:ListGroupRights
+* The description message in $wgExtensionCredits can be an array with
parameters

=== Bug fixes in 1.16 ===


Modified: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php 2009-07-31 09:36:29 UTC (rev
54080)
+++ trunk/phase3/includes/DefaultSettings.php 2009-07-31 09:40:11 UTC (rev
54081)
@@ -2765,8 +2765,8 @@
* <code>
* $wgExtensionCredits[$type][] = array(
* 'name' => 'Example extension',
- * 'version' => 1.9,
- * 'path' => __FILE__,
+ * 'version' => 1.9,
+ * 'path' => __FILE__,
* 'author' => 'Foo Barstein',
* 'url' => 'http://wwww.example.com/Example%20Extension/',
* 'description' => 'An example extension',
@@ -2775,6 +2775,8 @@
* </code>
*
* Where $type is 'specialpage', 'parserhook', 'variable', 'media' or 'other'.
+ * Where 'descriptionmsg' can be an array with message key and parameters:
+ * 'descriptionmsg' => array( 'exampleextension-desc', param1, param2, ... ),
*/
$wgExtensionCredits = array();
/*

Modified: trunk/phase3/includes/specials/SpecialVersion.php
===================================================================
--- trunk/phase3/includes/specials/SpecialVersion.php 2009-07-31 09:36:29 UTC
(rev 54080)
+++ trunk/phase3/includes/specials/SpecialVersion.php 2009-07-31 09:40:11 UTC
(rev 54081)
@@ -473,7 +473,14 @@

# Look for a localized description
if( isset( $descriptionMsg ) ) {
- $msg = wfMsg( $descriptionMsg );
+ if( is_array( $descriptionMsg ) ) {
+ $descriptionMsgKey = $descriptionMsg[0]; // Get
the message key
+ array_shift( $descriptionMsg ); // Shift out
the message key to get the parameters only
+ array_map( "htmlspecialchars", $descriptionMsg
); // For sanity
+ $msg = wfMsg( $descriptionMsgKey,
$descriptionMsg );
+ } else {
+ $msg = wfMsg( $descriptionMsg );
+ }
if ( !wfEmptyMsg( $descriptionMsg, $msg ) && $msg != ''
) {
$description = $msg;
}



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@xxxxxxxxxxxxxxxxxxx
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise