Fix fatal error in Special:Export -- invalid title when using Template inclusion
[lhc/web/wiklou.git] / includes / SpecialContributions.php
index b4e9bbf..59bd77c 100644 (file)
@@ -4,7 +4,7 @@
  * @addtogroup SpecialPage
  */
 
-class ContribsPager extends IndexPager {
+class ContribsPager extends ReverseChronologicalPager {
        public $mDefaultDirection = true;
        var $messages, $target;
        var $namespace = '', $mDb;
@@ -110,33 +110,13 @@ class ContribsPager extends IndexPager {
                return "</ul>\n";
        }
 
-       function getNavigationBar() {
-               if ( isset( $this->mNavigationBar ) ) {
-                       return $this->mNavigationBar;
-               }
-               $linkTexts = array(
-                       'prev' => wfMsgHtml( "sp-contributions-newer", $this->mLimit ),
-                       'next' => wfMsgHtml( 'sp-contributions-older', $this->mLimit ),
-                       'first' => wfMsgHtml('sp-contributions-newest'),
-                       'last' => wfMsgHtml( 'sp-contributions-oldest' )
-               );
-
-               $pagingLinks = $this->getPagingLinks( $linkTexts );
-               $limitLinks = $this->getLimitLinks();
-               $limits = implode( ' | ', $limitLinks );
-               
-               $this->mNavigationBar = "({$pagingLinks['first']} | {$pagingLinks['last']}) " . 
-                       wfMsgHtml("viewprevnext", $pagingLinks['prev'], $pagingLinks['next'], $limits);
-               return $this->mNavigationBar;
-       }
-
        /**
         * Generates each row in the contributions list.
         *
         * Contributions which are marked "top" are currently on top of the history.
-        * For these contributions, a [rollback] link is shown for users with sysop
-        * privileges. The rollback link restores the most recent version that was not
-        * written by the target user.
+        * For these contributions, a [rollback] link is shown for users with roll-
+        * back privileges. The rollback link restores the most recent version that
+        * was not written by the target user.
         *
         * @todo This would probably look a lot nicer in a table.
         */
@@ -159,7 +139,8 @@ class ContribsPager extends IndexPager {
                                $difftext .= $this->messages['newarticle'];
                        }
 
-                       if( $wgUser->isAllowed( 'rollback' ) ) {
+                       if( !$page->getUserPermissionsErrors( 'rollback', $wgUser )
+                       &&  !$page->getUserPermissionsErrors( 'edit', $wgUser ) ) {
                                $topmarktext .= ' '.$sk->generateRollback( $rev );
                        }
 
@@ -171,7 +152,7 @@ class ContribsPager extends IndexPager {
                }
                $histlink='('.$sk->makeKnownLinkObj( $page, $this->messages['hist'], 'action=history' ) . ')';
 
-               $comment = $wgContLang->getDirMark() . $sk->revComment( $rev );
+               $comment = $wgContLang->getDirMark() . $sk->revComment( $rev, false, true );
                $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
                
                if( $this->target == 'newbies' ) {
@@ -302,7 +283,7 @@ function wfSpecialContributions( $par = null ) {
 
        $pager = new ContribsPager( $target, $options['namespace'], $options['year'], $options['month'] );
        if ( !$pager->getNumRows() ) {
-               $wgOut->addWikiText( wfMsg( 'nocontribs' ) );
+               $wgOut->addWikiMsg( 'nocontribs' );
                return;
        }
 
@@ -323,7 +304,7 @@ function wfSpecialContributions( $par = null ) {
                        : 'sp-contributions-footer';
 
 
-               $text = wfMsg( $message, $target );
+               $text = wfMsgNoTrans( $message, $target );
                if( !wfEmptyMsg( $message, $text ) && $text != '-' ) {
                        $wgOut->addHtml( '<div class="mw-contributions-footer">' );
                        $wgOut->addWikiText( $text );