From: Siebrand Mazeland Date: Mon, 14 Sep 2009 18:58:25 +0000 (+0000) Subject: Support GENDER in 'renameuser-renamed-notice', changing LogEventsList::showLogExtract... X-Git-Tag: 1.31.0-rc.0~39738 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=c17bd28e1e3d2dbfc88b5aa078887a5a6d478be3;p=lhc%2Fweb%2Fwiklou.git Support GENDER in 'renameuser-renamed-notice', changing LogEventsList::showLogExtract for that: * param $msgKey from String to Array, where first element is the message key, additional elements are parameters for the key Comment by Nikerabbit: "... that is cargo train number of parameters :o". I tried not to make it worse. --- diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 04063a9feb..d70a4da857 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -575,10 +575,13 @@ class LogEventsList { * @param $conds Array Extra conditions for the query * @param $showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty * if set to true (default), "No matching items in log" is displayed if loglist is empty - * @param $msgKey String if you want a nice box with a message, set this to the key of the message + * @param $msgKey Array If you want a nice box with a message, set this + * to the key of the message. First element is the message + * key, additional optional elements are parameters for the + * key that are processed with wgMsgExt and option 'parse' * @return Integer Number of total log items (not limited by $lim) */ - public static function showLogExtract( &$out, $types=array(), $page='', $user='', $lim=0, $conds=array(), $showIfEmpty = true, $msgKey = '' ) { + public static function showLogExtract( &$out, $types=array(), $page='', $user='', $lim=0, $conds=array(), $showIfEmpty = true, $msgKey = array() ) { global $wgUser, $wgOut; # Insert list of top 50 or so items $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 ); @@ -587,8 +590,17 @@ class LogEventsList { $logBody = $pager->getBody(); $s = ''; if( $logBody ) { - if ( $msgKey ) - $s = '
' . wfMsgExt( $msgKey, array('parse') ) ; + if ( $msgKey ) { + $s = '
'; + + if ( sizeof( $msgKey ) == 1 ) { + $s .= wfMsgExt( $msgKey[0], array('parse') ); + } else { // Process additional arguments + $args = $msgKey; + unset( $args[0] ); + $s .= wfMsgExt( $msgKey[0], array('parse'), $args ); + } + } $s .= $loglist->beginLogEventsList() . $logBody . $loglist->endLogEventsList();