$title = $this->getTitle();
$id = $title->getArticleID();
$config = $this->context->getConfig();
+ $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
$pageCounts = $this->pageCounts( $this->page );
. ' ' . $this->msg( 'parentheses', $pageLang )->escaped() ];
// Content model of the page
+ $modelHtml = htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) );
+ // If the user can change it, add a link to Special:ChangeContentModel
+ if ( $title->quickUserCan( 'editcontentmodel' ) ) {
+ $modelHtml .= ' ' . $this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink(
+ SpecialPage::getTitleValueFor( 'ChangeContentModel', $title->getPrefixedText() ),
+ $this->msg( 'pageinfo-content-model-change' )->text()
+ ) )->escaped();
+ }
+
$pageInfo['header-basic'][] = [
$this->msg( 'pageinfo-content-model' ),
- htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) )
+ $modelHtml
];
// Search engine status
return ObjectCache::getMainWANInstance()->getWithSetCallback(
self::getCacheKey( $page->getTitle(), $page->getLatest() ),
- 86400 * 7,
+ WANObjectCache::TTL_WEEK,
function ( $oldValue, &$ttl, &$setOpts ) use ( $page, $config, $fname ) {
$title = $page->getTitle();
$id = $title->getArticleID();
- $dbr = wfGetDB( DB_SLAVE );
- $dbrWatchlist = wfGetDB( DB_SLAVE, 'watchlist' );
+ $dbr = wfGetDB( DB_REPLICA );
+ $dbrWatchlist = wfGetDB( DB_REPLICA, 'watchlist' );
$setOpts += Database::getCacheSetOptions( $dbr, $dbrWatchlist );