(bug 8688) Handle underscores/spaces in Special:Blockip and Special:Ipblocklist in...
[lhc/web/wiklou.git] / includes / PageHistory.php
index 780b5a0..50dd21a 100644 (file)
@@ -106,12 +106,11 @@ class PageHistory {
                 * Do the list
                 */
                $pager = new PageHistoryPager( $this );
-               $navbar = $pager->getNavigationBar();
                $this->linesonpage = $pager->getNumRows();
                $wgOut->addHTML(
                        $pager->getNavigationBar() . 
                        $this->beginHistoryList() . 
-                       $pager->getBody() . 
+                       $pager->getBody() .
                        $this->endHistoryList() .
                        $pager->getNavigationBar()
                );
@@ -160,15 +159,27 @@ class PageHistory {
                                        'class'     => 'historysubmit',
                                        'type'      => 'submit',
                                        'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
-                                       'title'     => wfMsg( 'tooltip-compareselectedversions' ),
+                                       'title'     => wfMsg( 'tooltip-compareselectedversions' ).' ['.wfMsg( 'accesskey-compareselectedversions' ).']',
                                        'value'     => wfMsg( 'compareselectedversions' ),
                                ) ) )
                        : '';
        }
 
-       /** @todo document */
+       /**
+        * Returns a row from the history printout.
+        *
+        * @todo document some more, and maybe clean up the code (some params redundant?)
+        *
+        * @param object $row The database row corresponding to the line (or is it the previous line?).
+        * @param object $next The database row corresponding to the next line (or is it this one?).
+        * @param int $counter Apparently a counter of what row number we're at, counted from the top row = 1.
+        * @param $notificationtimestamp
+        * @param bool $latest Whether this row corresponds to the page's latest revision.
+        * @param bool $firstInList Whether this row corresponds to the first displayed on this history page.
+        * @return string HTML output for the row
+        */
        function historyLine( $row, $next, $counter = '', $notificationtimestamp = false, $latest = false, $firstInList = false ) {
-               global $wgUser, $wgRequest, $wgTitle;
+               global $wgUser;
                $rev = new Revision( $row );
                $rev->setTitle( $this->mTitle );
 
@@ -210,13 +221,8 @@ class PageHistory {
                if( $row->rev_deleted & Revision::DELETED_TEXT ) {
                        $s .= ' ' . wfMsgHtml( 'deletedrev' );
                }
-               if( $wgUser->isAllowed( 'rollback' ) && $firstInList ) {
-                       $extraRollback = $wgRequest->getBool( 'bot' ) ? '&bot=1' : '';
-                       $extraRollback .= '&token=' . urlencode(
-                               $wgUser->editToken( array( $wgTitle->getPrefixedText(), $rev->getUserText() ) ) );
-                       $s .= ' ['. $this->mSkin->makeKnownLinkObj( $wgTitle,
-                               wfMsg('rollbacklink'),
-                               'action=rollback&from=' . $rev->getUserText() . $extraRollback ) .']';
+               if( $wgUser->isAllowed( 'rollback' ) && $latest ) {
+                       $s .= ' '.$this->mSkin->generateRollback( $rev );
                }
                $s .= "</li>\n";