API:
[lhc/web/wiklou.git] / includes / SpecialContributions.php
index ae51cde..333898b 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;
@@ -45,7 +45,7 @@ class ContribsPager extends IndexPager {
                                'rev_user_text', 'rev_deleted'
                        ),
                        'conds' => $conds,
-                       'options' => array( 'FORCE INDEX' => $index )
+                       'options' => array( 'USE INDEX' => $index )
                );
        }
 
@@ -110,26 +110,6 @@ 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.
         *
@@ -143,7 +123,7 @@ class ContribsPager extends IndexPager {
        function formatRow( $row ) {
                wfProfileIn( __METHOD__ );
 
-               global $wgLang, $wgUser;
+               global $wgLang, $wgUser, $wgContLang;
 
                $sk = $this->getSkin();
                $rev = new Revision( $row );
@@ -171,7 +151,7 @@ class ContribsPager extends IndexPager {
                }
                $histlink='('.$sk->makeKnownLinkObj( $page, $this->messages['hist'], 'action=history' ) . ')';
 
-               $comment = $sk->revComment( $rev );
+               $comment = $wgContLang->getDirMark() . $sk->revComment( $rev );
                $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
                
                if( $this->target == 'newbies' ) {
@@ -265,7 +245,7 @@ function wfSpecialContributions( $par = null ) {
        } else {
                $options['namespace'] = '';
        }
-       if ( $wgUser->isAllowed( 'rollback' ) && $wgRequest->getBool( 'bot' ) ) {
+       if ( $wgUser->isAllowed( 'markbotedit' ) && $wgRequest->getBool( 'bot' ) ) {
                $options['bot'] = '1';
        }
        
@@ -361,6 +341,9 @@ function contributionsSub( $nt, $id ) {
                }
                # Other logs link
                $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() );
+
+               wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) );
+
                $links = implode( ' | ', $tools );
        }
 
@@ -423,13 +406,20 @@ function contributionsForm( $options ) {
                Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parseinline' ) ), 'contribs' , 'newbie' , 'newbie', $options['contribs'] == 'newbie' ? true : false ) . '<br />' .
                Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parseinline' ) ), 'contribs' , 'user', 'user', $options['contribs'] == 'user' ? true : false ) . ' ' .
                Xml::input( 'target', 20, $options['target']) . ' '.
-               Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
+               '<span style="white-space: nowrap">' .
+               Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
                Xml::namespaceSelector( $options['namespace'], '' ) .
+               '</span>' .
                Xml::openElement( 'p' ) .
+               '<span style="white-space: nowrap">' .
                Xml::label( wfMsg( 'year' ), 'year' ) . ' '.
-               Xml::input( 'year', 4, $options['year'], array('id' => 'year', 'maxlength' => 4) ) . ' '.
+               Xml::input( 'year', 4, $options['year'], array('id' => 'year', 'maxlength' => 4) ) .
+               '</span>' .
+               ' '.
+               '<span style="white-space: nowrap">' .
                Xml::label( wfMsg( 'month' ), 'month' ) . ' '.
                Xml::monthSelector( $options['month'], -1 ) . ' '.
+               '</span>' .
                Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) .
                Xml::closeElement( 'p' );
        
@@ -440,4 +430,4 @@ function contributionsForm( $options ) {
        $f .= '</fieldset>' .
                Xml::closeElement( 'form' );
        return $f;
-}
\ No newline at end of file
+}