X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Factions%2FInfoAction.php;h=49a6bb5a5f6f6da1e7c0e7c8f30f2f7eee394ee8;hb=6228415557b1206dce035c9a2751378d120e34e7;hp=11b8badabfcc4e46e8d2c97ab35bc545e7c6d1d1;hpb=97af92da48f0d434cf4b541e7a3f2d96619a95b2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 11b8badabf..49a6bb5a5f 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -132,13 +132,18 @@ class InfoAction extends FormlessAction { "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 @@ -169,7 +174,7 @@ class InfoAction extends FormlessAction { * @param string $table The table that will be added to the content * @param string $name The name of the row * @param string $value The value of the row - * @param string $id The ID to use for the 'tr' element + * @param string|null $id The ID to use for the 'tr' element * @return string The table with the row added */ protected function addRow( $table, $name, $value, $id ) { @@ -259,6 +264,12 @@ class InfoAction extends FormlessAction { $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 ]; @@ -504,6 +515,16 @@ class InfoAction extends FormlessAction { $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; @@ -724,27 +745,18 @@ class InfoAction extends FormlessAction { $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();