// Add various resources if required
if ( $user->isLoggedIn()
- && $user->isAllowedAll( 'writeapi', 'viewmywatchlist', 'editmywatchlist' )
+ && MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasAllRights( $user, 'writeapi', 'viewmywatchlist', 'editmywatchlist' )
&& $this->getRelevantTitle()->canExist()
) {
$modules['watch'][] = 'mediawiki.page.watch.ajax';
/**
* Get the current revision ID
*
+ * @deprecated since 1.34, use OutputPage::getRevisionId instead
* @return int
*/
public function getRevisionId() {
/**
* Whether the revision displayed is the latest revision of the page
*
+ * @deprecated since 1.34, use OutputPage::isRevisionCurrent instead
* @return bool
*/
public function isRevisionCurrent() {
- $revID = $this->getRevisionId();
- return $revID == 0 || $revID == $this->getTitle()->getLatestRevID();
+ return $this->getOutput()->isRevisionCurrent();
}
/**
* @return string HTML text with an URL
*/
function printSource() {
- $oldid = $this->getRevisionId();
+ $oldid = $this->getOutput()->getRevisionId();
if ( $oldid ) {
$canonicalUrl = $this->getTitle()->getCanonicalURL( 'oldid=' . $oldid );
$url = htmlspecialchars( wfExpandIRI( $canonicalUrl ) );
function getCopyright( $type = 'detect' ) {
$linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
if ( $type == 'detect' ) {
- if ( !$this->isRevisionCurrent()
+ if ( !$this->getOutput()->isRevisionCurrent()
&& !$this->msg( 'history_copyright' )->inContentLanguage()->isDisabled()
) {
$type = 'history';
# No cached timestamp, load it from the database
if ( $timestamp === null ) {
- $timestamp = Revision::getTimestampFromId( $this->getTitle(), $this->getRevisionId() );
+ $timestamp = Revision::getTimestampFromId( $this->getTitle(),
+ $this->getOutput()->getRevisionId() );
}
if ( $timestamp ) {
function editUrlOptions() {
$options = [ 'action' => 'edit' ];
- if ( !$this->isRevisionCurrent() ) {
- $options['oldid'] = intval( $this->getRevisionId() );
+ if ( !$this->getOutput()->isRevisionCurrent() ) {
+ $options['oldid'] = intval( $this->getOutput()->getRevisionId() );
}
return $options;