X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Factions%2FInfoAction.php;h=c039388783bde1401d40ee890a7c5f64ee8a4ed2;hb=6d9704caefde82e494a8eeffe7abee5978f9f7b1;hp=ea66900f6952819eb0cd731a0690ad33dc134b4c;hpb=dc36560cdf22db860133ecb58db1898e285f25ea;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index ea66900f69..c039388783 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -202,6 +202,7 @@ class InfoAction extends FormlessAction { $title = $this->getTitle(); $id = $title->getArticleID(); $config = $this->context->getConfig(); + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); $pageCounts = $this->pageCounts( $this->page ); @@ -279,9 +280,18 @@ class InfoAction extends FormlessAction { . ' ' . $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 @@ -621,14 +631,15 @@ class InfoAction extends FormlessAction { $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 ) ]; } @@ -644,14 +655,15 @@ class InfoAction extends FormlessAction { $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 ) ]; } } @@ -676,9 +688,8 @@ class InfoAction extends FormlessAction { $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();