From: Niklas Laxström Date: Wed, 17 Jan 2007 18:13:56 +0000 (+0000) Subject: * Unsupport html X-Git-Tag: 1.31.0-rc.0~54340 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=eb4be84871bf71228d955cc7cadc4965876b88e5;p=lhc%2Fweb%2Fwiklou.git * Unsupport html --- diff --git a/includes/ChangesList.php b/includes/ChangesList.php index a8d3ba8a95..52e2627a50 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -212,6 +212,23 @@ class ChangesList { global $wgUseRCPatrol, $wgUser; return( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) ); } + + /** + * Returns the string which indicates the number of watching users + */ + function numberofWatchingusers( $count ) { + global $wgLang; + static $cache = array(); + if ( $count > 0 ) { + if ( !isset( $cache[$count] ) ) { + $cache[$count] = wfMsgExt('number_of_watching_users_RCview', + array('parsemag', 'escape'), $wgLang->formatNum($count)); + } + return $cache[$count]; + } else { + return ''; + } + } } @@ -274,9 +291,7 @@ class OldChangesList extends ChangesList { $this->insertUserRelatedLinks($s,$rc); $this->insertComment($s, $rc); - if($rc->numberofWatchingusers > 0) { - $s .= ' ' . wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rc->numberofWatchingusers)); - } + $s .= rtrim(' ' . $this->numberofWatchingusers($rc->numberofWatchingusers)); $s .= "\n"; @@ -498,10 +513,7 @@ class EnhancedChangesList extends ChangesList { $r .= $users; - if($block[0]->numberofWatchingusers > 0) { - global $wgContLang; - $r .= wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($block[0]->numberofWatchingusers)); - } + $r .= $this->numberofWatchingusers($block[0]->numberofWatchingusers); $r .= "
\n"; # Sub-entries @@ -653,9 +665,7 @@ class EnhancedChangesList extends ChangesList { $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() ); } - if( $rcObj->numberofWatchingusers > 0 ) { - $r .= wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rcObj->numberofWatchingusers)); - } + $r .= $this->numberofWatchingusers($rcObj->numberofWatchingusers); $r .= "
\n"; return $r;