From: Aryeh Gregor Date: Sun, 19 Nov 2006 17:16:34 +0000 (+0000) Subject: Fix minor bug in r17715: don't display rollback link on history page for non-latest... X-Git-Tag: 1.31.0-rc.0~55146 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=a94544b0177a64dd7adb77581357117e202e6ad9;p=lhc%2Fweb%2Fwiklou.git Fix minor bug in r17715: don't display rollback link on history page for non-latest revision, even if it's at the top of the page. Also add some documentation to PageHistory::historyLine. --- diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 16c405c43c..fd6a6d2748 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -111,7 +111,7 @@ class PageHistory { $wgOut->addHTML( $pager->getNavigationBar() . $this->beginHistoryList() . - $pager->getBody() . + $pager->getBody() . $this->endHistoryList() . $pager->getNavigationBar() ); @@ -166,7 +166,19 @@ class PageHistory { : ''; } - /** @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; $rev = new Revision( $row ); @@ -210,7 +222,7 @@ class PageHistory { if( $row->rev_deleted & Revision::DELETED_TEXT ) { $s .= ' ' . wfMsgHtml( 'deletedrev' ); } - if( $wgUser->isAllowed( 'rollback' ) && $firstInList ) { + if( $wgUser->isAllowed( 'rollback' ) && $latest ) { $s .= ' '.$this->mSkin->generateRollback( $rev ); } $s .= "\n";