* @package MediaWiki
*/
-/** */
-include_once ( 'SpecialValidate.php' );
-
define('DIR_PREV', 0);
define('DIR_NEXT', 1);
var $lastdate;
var $linesonpage;
var $mNotificationTimestamp;
+ var $mLatestId = null;
/**
* Construct a new PageHistory.
* @returns nothing
*/
function history() {
- global $wgUser, $wgOut, $wgLang, $wgShowUpdatedMarker, $wgRequest,
- $wgTitle, $wgUseValidation;
+ global $wgUser, $wgOut, $wgRequest, $wgTitle;
/*
* Allow client caching.
$s .= $this->endHistoryList();
$s .= $navbar;
- /*
- * Article validation line.
- */
- if ($wgUseValidation)
- $s .= '<p>' . Validation::getStatisticsLink( $this->mArticle ) . '</p>' ;
-
$wgOut->addHTML( $s );
wfProfileOut( $fname );
}
$s = wfMsgWikiHtml( 'histlegend' );
$s .= '<form action="' . $wgTitle->escapeLocalURL( '-' ) . '" method="get">';
$prefixedkey = htmlspecialchars($wgTitle->getPrefixedDbKey());
-
+
// The following line is SUPPOSED to have double-quotes around the
// $prefixedkey variable, because htmlspecialchars() doesn't escape
// single-quotes.
// consideration and cooperation.
//
$s .= "<input type='hidden' name='title' value=\"{$prefixedkey}\" />\n";
-
+
$s .= $this->submitButton();
$s .= '<ul id="pagehistory">' . "\n";
return $s;
/** @todo document */
function historyLine( $row, $next, $counter = '', $notificationtimestamp = false, $latest = false, $firstInList = false ) {
- global $wgLang, $wgContLang;
if ( 0 == $row->rev_user ) {
$contribsPage =& Title::makeTitle( NS_SPECIAL, 'Contributions' );
function lastLink( $row, $next, $counter ) {
global $wgUser;
$last = htmlspecialchars( wfMsg( 'last' ) );
- if( is_null( $next )
- || ( $row->rev_deleted && !$wgUser->isAllowed( 'undelete' ) ) ) {
+ if( is_null( $next ) ) {
+ if( $row->rev_timestamp == $this->getEarliestOffset() ) {
+ return $last;
+ } else {
+ // Cut off by paging; there are more behind us...
+ return $this->mSkin->makeKnownLinkObj(
+ $this->mTitle,
+ $last,
+ "diff={$row->rev_id}&oldid=prev" );
+ }
+ } elseif( $row->rev_deleted && !$wgUser->isAllowed( 'undelete' ) ) {
return $last;
} else {
return $this->mSkin->makeKnownLinkObj(
}
/** @todo document */
- function getLatestID( $id = null ) {
- if ( $id === null) $id = $this->mTitle->getArticleID();
- $db =& wfGetDB(DB_SLAVE);
- return $db->selectField( 'revision',
- "max(rev_id)",
- array( 'rev_page' => $id ),
- 'PageHistory::getLatestID' );
+ function getLatestId() {
+ if( is_null( $this->mLatestId ) ) {
+ $id = $this->mTitle->getArticleID();
+ $db =& wfGetDB(DB_SLAVE);
+ $this->mLatestId = $db->selectField( 'revision',
+ "max(rev_id)",
+ array( 'rev_page' => $id ),
+ 'PageHistory::getLatestID' );
+ }
+ return $this->mLatestId;
}
/** @todo document */