"mw-pageinfo-${header}"
) . "\n";
$table = "\n";
+ $below = "";
foreach ( $infoTable as $infoRow ) {
+ if ( $infoRow[0] == "below" ) {
+ $below = $infoRow[1] . "\n";
+ continue;
+ }
$name = ( $infoRow[0] instanceof Message ) ? $infoRow[0]->escaped() : $infoRow[0];
$value = ( $infoRow[1] instanceof Message ) ? $infoRow[1]->escaped() : $infoRow[1];
$id = ( $infoRow[0] instanceof Message ) ? $infoRow[0]->getKey() : null;
$table = $this->addRow( $table, $name, $value, $id ) . "\n";
}
- $content = $this->addTable( $content, $table ) . "\n";
+ $content = $this->addTable( $content, $table ) . "\n" . $below;
}
// Page footer
];
// Is it a redirect? If so, where to?
- if ( $title->isRedirect() ) {
+ $redirectTarget = $this->page->getRedirectTarget();
+ if ( $redirectTarget !== null ) {
$pageInfo['header-basic'][] = [
$this->msg( 'pageinfo-redirectsto' ),
- $linkRenderer->makeLink( $this->page->getRedirectTarget() ) .
+ $linkRenderer->makeLink( $redirectTarget ) .
$this->msg( 'word-separator' )->escaped() .
$this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink(
- $this->page->getRedirectTarget(),
+ $redirectTarget,
$this->msg( 'pageinfo-redirectsto-info' )->text(),
[],
[ 'action' => 'info' ]
$this->msg( 'pageinfo-length' ), $lang->formatNum( $title->getLength() )
];
+ // Page namespace
+ $pageNamespace = $title->getNsText();
+ if ( $pageNamespace ) {
+ $pageInfo['header-basic'][] = [ $this->msg( 'pageinfo-namespace' ), $pageNamespace ];
+ }
+
// Page ID (number not localised, as it's a database ID)
$pageInfo['header-basic'][] = [ $this->msg( 'pageinfo-article-id' ), $id ];
$this->msg( "restriction-$restrictionType" ), $message
];
}
+ $protectLog = SpecialPage::getTitleFor( 'Log' );
+ $pageInfo['header-restrictions'][] = [
+ 'below',
+ $linkRenderer->makeKnownLink(
+ $protectLog,
+ $this->msg( 'pageinfo-view-protect-log' )->text(),
+ [],
+ [ 'type' => 'protect', 'page' => $title->getPrefixedText() ]
+ ),
+ ];
if ( !$this->page->exists() ) {
return $pageInfo;
$dbrWatchlist = wfGetDB( DB_REPLICA, 'watchlist' );
$setOpts += Database::getCacheSetOptions( $dbr, $dbrWatchlist );
- if ( $wgActorTableSchemaMigrationStage === MIGRATION_NEW ) {
+ if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW ) {
$tables = [ 'revision_actor_temp' ];
$field = 'revactor_actor';
$pageField = 'revactor_page';
$tsField = 'revactor_timestamp';
$joins = [];
- } elseif ( $wgActorTableSchemaMigrationStage === MIGRATION_OLD ) {
+ } else {
$tables = [ 'revision' ];
$field = 'rev_user_text';
$pageField = 'rev_page';
$tsField = 'rev_timestamp';
$joins = [];
- } else {
- $tables = [ 'revision', 'revision_actor_temp', 'actor' ];
- $field = 'COALESCE( actor_name, rev_user_text)';
- $pageField = 'rev_page';
- $tsField = 'rev_timestamp';
- $joins = [
- 'revision_actor_temp' => [ 'LEFT JOIN', 'revactor_rev = rev_id' ],
- 'actor' => [ 'LEFT JOIN', 'revactor_actor = actor_id' ],
- ];
}
$watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore();