*/
var $mWatchLinkNum = 0; // Appended to end of watch link id's
/**#@-*/
- protected $mRevisionId; // The revision ID we're looking at, null if not applicable.
protected $skinname = 'standard';
protected $mRelevantTitle = null;
protected $mRelevantUser = null;
function initPage( OutputPage $out ) {
wfProfileIn( __METHOD__ );
- $this->mRevisionId = $out->mRevisionId;
$this->preloadExistence();
$this->setMembers();
$this->usercss = false;
}
- /**
- * Whether the revision displayed is the latest revision of the page
- *
- * @return Boolean
- */
- public function isRevisionCurrent() {
- return $this->mRevisionId == 0 || $this->mRevisionId == $this->getTitle()->getLatestRevID();
- }
-
/**
* Set the RequestContext used in this instance
*
return $this->getContext()->getUser();
}
+ /**
+ * Get the current revision ID
+ *
+ * @return Integer
+ */
+ public function getRevisionId() {
+ return $this->getContext()->getOutput()->getRevisionId();
+ }
+
+ /**
+ * Whether the revision displayed is the latest revision of the page
+ *
+ * @return Boolean
+ */
+ public function isRevisionCurrent() {
+ $revID = $this->getRevisionId();
+ return $revID == 0 || $revID == $this->getTitle()->getLatestRevID();
+ }
+
/**
* Set the "relevant" title
* @see self::getRelevantTitle()
*/
protected function lastModified( $article ) {
if ( !$this->isRevisionCurrent() ) {
- $timestamp = Revision::getTimestampFromId( $this->getTitle(), $this->mRevisionId );
+ $timestamp = Revision::getTimestampFromId( $this->getTitle(), $this->getRevisionId() );
} else {
$timestamp = $article->getTimestamp();
}
$options = array( 'action' => 'edit' );
if ( !$this->isRevisionCurrent() ) {
- $options['oldid'] = intval( $this->mRevisionId );
+ $options['oldid'] = intval( $this->getRevisionId() );
}
return $options;
}
// Also add a "permalink" while we're at it
- if ( $this->mRevisionId ) {
+ $revid = $this->getRevisionId();
+ if ( $revid ) {
$nav_urls['permalink'] = array(
'text' => wfMsg( 'permalink' ),
- 'href' => $out->getTitle()->getLocalURL( "oldid=$this->mRevisionId" )
+ 'href' => $out->getTitle()->getLocalURL( "oldid=$revid" )
);
}
- // Copy in case this undocumented, shady hook tries to mess with internals
- $revid = $this->mRevisionId;
+ // Use the copy of revision ID in case this undocumented, shady hook tries to mess with internals
wfRunHooks( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink', array( &$this, &$nav_urls, &$revid, &$revid ) );
}