From e5c159ae2ec8444ec43e568219b259d8f8f36a80 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Tue, 4 Oct 2011 00:12:09 +0000 Subject: [PATCH] The general fix is setting the directionality of added or removed bytes in recent changes. It is always supposed to be LTR. Details: * Spelling of variable names and comments: formated -> formatted * Replaced "<$tag" with Xml::element * Added a dirmark before the username (otherwise the added or removed appear on the other side) --- includes/ChangesList.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 19cc53b8e0..86ad736813 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -193,10 +193,10 @@ class ChangesList extends ContextSource { $fastCharDiff[$code] = $wgMiserMode || wfMsgNoTrans( 'rc-change-size' ) === '$1'; } - $formatedSize = $wgLang->formatNum($szdiff); + $formattedSize = $wgLang->formatNum($szdiff); if ( !$fastCharDiff[$code] ) { - $formatedSize = wfMsgExt( 'rc-change-size', array( 'parsemag', 'escape' ), $formatedSize ); + $formattedSize = wfMsgExt( 'rc-change-size', array( 'parsemag', 'escape' ), $formattedSize ); } if( abs( $szdiff ) > abs( $wgRCChangedSizeThreshold ) ) { @@ -204,13 +204,20 @@ class ChangesList extends ContextSource { } else { $tag = 'span'; } - if( $szdiff === 0 ) { - return "<$tag class='mw-plusminus-null'>($formatedSize)"; - } elseif( $szdiff > 0 ) { - return "<$tag class='mw-plusminus-pos'>(+$formatedSize)"; - } else { - return "<$tag class='mw-plusminus-neg'>($formatedSize)"; + $formattedSizeClass = 'mw-plusminus-'; + if ( $szdiff === 0 ) { + $formattedSizeClass .= 'null'; + } + if ( $szdiff > 0 ) { + $formattedSize = '+' . $formattedSize; + $formattedSizeClass .= 'pos'; + } + if ( $szdiff < 0 ) { + $formattedSizeClass .= 'neg'; } + return Xml::element($tag, + array('dir' => 'ltr', 'class' => $formattedSizeClass), + "($formattedSize)"); } /** @@ -344,7 +351,7 @@ class ChangesList extends ContextSource { if( $this->isDeleted( $rc, Revision::DELETED_USER ) ) { $s .= ' ' . wfMsgHtml( 'rev-deleted-user' ) . ''; } else { - $s .= Linker::userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); + $s .= $this->getLang()->getDirMark() . Linker::userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); $s .= Linker::userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); } } @@ -1068,7 +1075,7 @@ class EnhancedChangesList extends ChangesList { * Enhanced RC ungrouped line. * * @param $rcObj RecentChange - * @return String: a HTML formated line (generated using $r) + * @return String: a HTML formatted line (generated using $r) */ protected function recentChangesBlockLine( $rcObj ) { global $wgRCShowChangedSize; -- 2.20.1