r92383 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92382‎ | r92383 | r92384 >
Date:21:21, 16 July 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
applied modified patch by Van de Bugger
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Info.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Info.php
@@ -26,8 +26,14 @@
2727 $params = func_get_args();
2828 array_shift( $params ); // We already know the $parser ...
2929
30 - $content = array_shift( $params ); // Use only first parameter, ignore the rest (may get meaning later).
31 - $result = smwfEncodeMessages( array( $content ), 'info' );
 30+ $content = array_shift( $params ); // First parameter is the info message.
 31+ $icon = array_shift( $params ); // Second parameter is icon to use or null when not provided.
 32+
 33+ if ( is_null( $icon ) || $icon === '' || !in_array( $icon, array( 'info', 'warning' ) ) ) {
 34+ $icon = 'info';
 35+ }
 36+
 37+ $result = smwfEncodeMessages( array( $content ), $icon );
3238
3339 // Starting from MW 1.16, there is a more suited method available: Title::isSpecialPage
3440 global $wgTitle;