$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
$more = null;
}
+ $templateListFormatter = new TemplatesOnThisPageFormatter(
+ $this->getContext(),
+ $linkRenderer
+ );
+
$pageInfo['header-properties'][] = [
$this->msg( 'pageinfo-templates' )
->numParams( $pageCounts['transclusion']['from'] ),
- Linker::formatTemplates(
- $transcludedTemplates,
- false,
- false,
- $more )
+ $templateListFormatter->format( $transcludedTemplates, false, $more )
];
}
$more = null;
}
+ $templateListFormatter = new TemplatesOnThisPageFormatter(
+ $this->getContext(),
+ $linkRenderer
+ );
+
$pageInfo['header-properties'][] = [
$this->msg( 'pageinfo-transclusions' )
->numParams( $pageCounts['transclusion']['to'] ),
- Linker::formatTemplates(
- $transcludedTargets,
- false,
- false,
- $more )
+ $templateListFormatter->format( $transcludedTargets, false, $more )
];
}
}
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 );
$watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore();