* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
* @since 1.26
*/
+use MediaWiki\MediaWikiServices;
/**
* This class formats protect log entries.
$subtype = $this->entry->getSubtype();
if ( $subtype === 'move_prot' ) {
$params = $this->extractParameters();
- return array( Title::newFromText( $params[3] ) );
+ return [ Title::newFromText( $params[3] ) ];
}
- return array();
+ return [];
}
protected function getMessageKey() {
unset( $params[4] );
}
} elseif ( $subtype === 'move_prot' ) {
- $oldname = $this->makePageLink( Title::newFromText( $params[3] ), array( 'redirect' => 'no' ) );
+ $oldname = $this->makePageLink( Title::newFromText( $params[3] ), [ 'redirect' => 'no' ] );
$params[3] = Message::rawParam( $oldname );
}
}
public function getActionLinks() {
+ $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
$subtype = $this->entry->getSubtype();
if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden
|| $subtype === 'move_prot' // the move log entry has the right action link
// Show history link for all changes after the protection
$title = $this->entry->getTarget();
- $links = array(
- Linker::link( $title,
- $this->msg( 'hist' )->escaped(),
- array(),
- array(
+ $links = [
+ $linkRenderer->makeLink( $title,
+ $this->msg( 'hist' )->text(),
+ [],
+ [
'action' => 'history',
'offset' => $this->entry->getTimestamp(),
- )
+ ]
)
- );
+ ];
// Show change protection link
if ( $this->context->getUser()->isAllowed( 'protect' ) ) {
- $links[] = Linker::linkKnown(
+ $links[] = $linkRenderer->makeKnownLink(
$title,
- $this->msg( 'protect_change' )->escaped(),
- array(),
- array( 'action' => 'protect' )
+ $this->msg( 'protect_change' )->text(),
+ [],
+ [ 'action' => 'protect' ]
);
}
$subtype = $this->entry->getSubtype();
$params = $entry->getParameters();
- $map = array();
+ $map = [];
if ( $subtype === 'protect' || $subtype === 'modify' ) {
- $map = array(
+ $map = [
'4::description',
'5:bool:cascade',
'details' => ':array:details',
- );
+ ];
} elseif ( $subtype === 'move_prot' ) {
- $map = array(
+ $map = [
'4:title:oldtitle',
'4::oldtitle' => '4:title:oldtitle',
- );
+ ];
}
foreach ( $map as $index => $key ) {
if ( isset( $params[$index] ) ) {