Localisation updates for core and extension messages from translatewiki.net (2010...
[lhc/web/wiklou.git] / includes / ChangesList.php
index ee5611d..fe75bf0 100644 (file)
@@ -44,11 +44,13 @@ class ChangesList {
         * @return ChangesList derivative
         */
        public static function newFromUser( &$user ) {
+               global $wgRequest;
+
                $sk = $user->getSkin();
                $list = null;
                if( wfRunHooks( 'FetchChangesList', array( &$user, &$sk, &$list ) ) ) {
-                       return $user->getOption( 'usenewrc' ) ?
-                               new EnhancedChangesList( $sk ) : new OldChangesList( $sk );
+                       $new = $wgRequest->getBool( 'enhanced', $user->getOption( 'usenewrc' ) );
+                       return $new ? new EnhancedChangesList( $sk ) : new OldChangesList( $sk );
                } else {
                        return $list;
                }
@@ -85,7 +87,7 @@ class ChangesList {
         * @param $bot Boolean
         * @return String
         */
-       protected function recentChangesFlags( $new, $minor, $patrolled, $nothing = ' ', $bot = false ) {
+       protected function recentChangesFlags( $new, $minor, $patrolled, $nothing = ' ', $bot = false ) {
                $f = $new ? self::flag( 'newpage' ) : $nothing;
                $f .= $minor ? self::flag( 'minor' ) : $nothing;
                $f .= $bot ? self::flag( 'bot' ) : $nothing;
@@ -225,7 +227,7 @@ class ChangesList {
                }
        }
 
-       protected function insertMove( &$s, $rc ) {
+       public function insertMove( &$s, $rc ) {
                # Diff
                $s .= '(' . $this->message['diff'] . ') (';
                # Hist
@@ -257,7 +259,7 @@ class ChangesList {
                );
        }
 
-       protected function insertDateHeader( &$s, $rc_timestamp ) {
+       public function insertDateHeader( &$s, $rc_timestamp ) {
                global $wgLang;
                # Make date header if necessary
                $date = $wgLang->date( $rc_timestamp, true, true );
@@ -271,7 +273,7 @@ class ChangesList {
                }
        }
 
-       protected function insertLog( &$s, $title, $logtype ) {
+       public function insertLog( &$s, $title, $logtype ) {
                $logname = LogPage::logName( $logtype );
                $s .= '(' . $this->skin->link(
                        $title,
@@ -282,7 +284,7 @@ class ChangesList {
                ) . ')';
        }
 
-       protected function insertDiffHist( &$s, &$rc, $unpatrolled ) {
+       public function insertDiffHist( &$s, &$rc, $unpatrolled ) {
                # Diff link
                if( $rc->mAttribs['rc_type'] == RC_NEW || $rc->mAttribs['rc_type'] == RC_LOG ) {
                        $diffLink = $this->message['diff'];
@@ -322,7 +324,7 @@ class ChangesList {
                $s .= ') . . ';
        }
 
-       protected function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) {
+       public function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) {
                global $wgContLang;
                # If it's a new article, there is no diff link, but if it hasn't been
                # patrolled yet, we need to give users a way to do so
@@ -363,7 +365,7 @@ class ChangesList {
                $s .= " $articlelink";
        }
 
-       protected function insertTimestamp( &$s, $rc ) {
+       public function insertTimestamp( &$s, $rc ) {
                global $wgLang;
                $s .= $this->message['semicolon-separator'] . 
                        $wgLang->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . ';
@@ -380,7 +382,7 @@ class ChangesList {
        }
 
        /** insert a formatted action */
-       protected function insertAction( &$s, &$rc ) {
+       public function insertAction( &$s, &$rc ) {
                if( $rc->mAttribs['rc_type'] == RC_LOG ) {
                        if( $this->isDeleted( $rc, LogPage::DELETED_ACTION ) ) {
                                $s .= ' <span class="history-deleted">' . wfMsgHtml( 'rev-deleted-event' ) . '</span>';
@@ -392,7 +394,7 @@ class ChangesList {
        }
 
        /** insert a formatted comment */
-       protected function insertComment( &$s, &$rc ) {
+       public function insertComment( &$s, &$rc ) {
                if( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) {
                        if( $this->isDeleted( $rc, Revision::DELETED_COMMENT ) ) {
                                $s .= ' <span class="history-deleted">' . wfMsgHtml( 'rev-deleted-comment' ) . '</span>';
@@ -841,13 +843,13 @@ class EnhancedChangesList extends ChangesList {
 
                $tl = "<span id='mw-rc-openarrow-$jsid' class='mw-changeslist-expanded' style='visibility:hidden'><a href='#' $toggleLink title='$expandTitle'>" . $this->sideArrow() . "</a></span>";
                $tl .= "<span id='mw-rc-closearrow-$jsid' class='mw-changeslist-hidden' style='display:none'><a href='#' $toggleLink title='$closeTitle'>" . $this->downArrow() . "</a></span>";
-               $r .= '<td class="mw-enhanced-rc">'.$tl.'&nbsp;';
+               $r .= '<td class="mw-enhanced-rc">'.$tl.'&#160;';
 
                # Main line
-               $r .= $this->recentChangesFlags( $isnew, false, $unpatrolled, '&nbsp;', $bot );
+               $r .= $this->recentChangesFlags( $isnew, false, $unpatrolled, '&#160;', $bot );
 
                # Timestamp
-               $r .= '&nbsp;'.$block[0]->timestamp.'&nbsp;</td><td style="padding:0px;">';
+               $r .= '&#160;'.$block[0]->timestamp.'&#160;</td><td style="padding:0px;">';
 
                # Article link
                if( $namehidden ) {
@@ -951,8 +953,8 @@ class EnhancedChangesList extends ChangesList {
                        #$r .= '<tr><td valign="top">'.$this->spacerArrow();
                        $r .= '<tr><td style="vertical-align:top;font-family:monospace; padding:0px;">';
                        $r .= $this->spacerIndent() . $this->spacerIndent();
-                       $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled, '&nbsp;', $rc_bot );
-                       $r .= '&nbsp;</td><td style="vertical-align:top; padding:0px;"><span style="font-family:monospace">';
+                       $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled, '&#160;', $rc_bot );
+                       $r .= '&#160;</td><td style="vertical-align:top; padding:0px;"><span style="font-family:monospace">';
 
                        $params = $queryParams;
 
@@ -1067,7 +1069,7 @@ class EnhancedChangesList extends ChangesList {
         * @return String: HTML <td> tag
         */
        protected function spacerIndent() {
-               return '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
+               return '&#160;&#160;&#160;&#160;&#160;';
        }
 
        /**
@@ -1087,14 +1089,14 @@ class EnhancedChangesList extends ChangesList {
                $query['curid'] = $rc_cur_id;
 
                $r = '<table class="mw-enhanced-rc"><tr>';
-               $r .= '<td class="mw-enhanced-rc">' . $this->spacerArrow() . '&nbsp;';
+               $r .= '<td class="mw-enhanced-rc">' . $this->spacerArrow() . '&#160;';
                # Flag and Timestamp
                if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
-                       $r .= '&nbsp;&nbsp;&nbsp;&nbsp;'; // 4 flags -> 4 spaces
+                       $r .= '&#160;&#160;&#160;&#160;'; // 4 flags -> 4 spaces
                } else {
-                       $r .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $rcObj->unpatrolled, '&nbsp;', $rc_bot );
+                       $r .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $rcObj->unpatrolled, '&#160;', $rc_bot );
                }
-               $r .= '&nbsp;'.$rcObj->timestamp.'&nbsp;</td><td style="padding:0px;">';
+               $r .= '&#160;'.$rcObj->timestamp.'&#160;</td><td style="padding:0px;">';
                # Article or log link
                if( $rc_log_type ) {
                        $logtitle = Title::newFromText( "Log/$rc_log_type", NS_SPECIAL );