) {
$this->doSubmit();
} else {
- $this->showForm( array() );
+ $this->showForm( [] );
}
}
) {
$out->wrapWikiMsg(
"<div class='warningbox'>\n$1\n</div>\n",
- array( 'delete_and_move_text', $newTitle->getPrefixedText() )
+ [ 'delete_and_move_text', $newTitle->getPrefixedText() ]
);
$deleteAndMove = true;
- $err = array();
+ $err = [];
}
if ( count( $err ) == 1 && isset( $err[0][0] ) && $err[0][0] == 'file-exists-sharedrepo'
) {
$out->wrapWikiMsg(
"<div class='warningbox'>\n$1\n</div>\n",
- array(
+ [
'move-over-sharedrepo',
$newTitle->getPrefixedText()
- )
+ ]
);
$moveOverShared = true;
- $err = array();
+ $err = [];
}
$oldTalk = $this->oldTitle->getTalkPage();
$dbr = wfGetDB( DB_SLAVE );
if ( $this->getConfig()->get( 'FixDoubleRedirects' ) ) {
$hasRedirects = $dbr->selectField( 'redirect', '1',
- array(
+ [
'rd_namespace' => $this->oldTitle->getNamespace(),
'rd_title' => $this->oldTitle->getDBkey(),
- ), __METHOD__ );
+ ], __METHOD__ );
} else {
$hasRedirects = false;
}
$out->addWikiMsgArray( $errMsgName, $errMsg );
}
} else {
- $errStr = array();
+ $errStr = [];
foreach ( $err as $errMsg ) {
if ( $errMsg[0] == 'hookaborted' ) {
'protect',
$this->oldTitle,
'',
- array( 'lim' => 1 )
+ [ 'lim' => 1 ]
);
$out->addHTML( "</div>\n" );
}
// Byte limit (not string length limit) for wpReason and wpNewTitleMain
// is enforced in the mediawiki.special.movePage module
- $immovableNamespaces = array();
+ $immovableNamespaces = [];
foreach ( array_keys( $this->getLanguage()->getNamespaces() ) as $nsId ) {
if ( !MWNamespace::isMovable( $nsId ) ) {
$immovableNamespaces[] = $nsId;
$handler = ContentHandler::getForTitle( $this->oldTitle );
$out->enableOOUI();
- $fields = array();
+ $fields = [];
$fields[] = new OOUI\FieldLayout(
- new MediaWiki\Widget\ComplexTitleInputWidget( array(
+ new MediaWiki\Widget\ComplexTitleInputWidget( [
'id' => 'wpNewTitle',
- 'namespace' => array(
+ 'namespace' => [
'id' => 'wpNewTitleNs',
'name' => 'wpNewTitleNs',
'value' => $newTitle->getNamespace(),
'exclude' => $immovableNamespaces,
- ),
- 'title' => array(
+ ],
+ 'title' => [
'id' => 'wpNewTitleMain',
'name' => 'wpNewTitleMain',
'value' => $wgContLang->recodeForEdit( $newTitle->getText() ),
// Inappropriate, since we're expecting the user to input a non-existent page's title
'suggestions' => false,
- ),
+ ],
'infusable' => true,
- ) ),
- array(
+ ] ),
+ [
'label' => $this->msg( 'newtitle' )->text(),
'align' => 'top',
- )
+ ]
);
$fields[] = new OOUI\FieldLayout(
- new OOUI\TextInputWidget( array(
+ new OOUI\TextInputWidget( [
'name' => 'wpReason',
'id' => 'wpReason',
'maxLength' => 200,
'infusable' => true,
'value' => $this->reason,
- ) ),
- array(
+ ] ),
+ [
'label' => $this->msg( 'movereason' )->text(),
'align' => 'top',
- )
+ ]
);
if ( $considerTalk ) {
$fields[] = new OOUI\FieldLayout(
- new OOUI\CheckboxInputWidget( array(
+ new OOUI\CheckboxInputWidget( [
'name' => 'wpMovetalk',
'id' => 'wpMovetalk',
'value' => '1',
'selected' => $this->moveTalk,
- ) ),
- array(
+ ] ),
+ [
'label' => $this->msg( 'movetalk' )->text(),
'help' => new OOUI\HtmlSnippet( $this->msg( 'movepagetalktext' )->parseAsBlock() ),
'align' => 'inline',
'infusable' => true,
- )
+ ]
);
}
$isDisabled = true;
}
$fields[] = new OOUI\FieldLayout(
- new OOUI\CheckboxInputWidget( array(
+ new OOUI\CheckboxInputWidget( [
'name' => 'wpLeaveRedirect',
'id' => 'wpLeaveRedirect',
'value' => '1',
'selected' => $isChecked,
'disabled' => $isDisabled,
- ) ),
- array(
+ ] ),
+ [
'label' => $this->msg( 'move-leave-redirect' )->text(),
'align' => 'inline',
- )
+ ]
);
}
if ( $hasRedirects ) {
$fields[] = new OOUI\FieldLayout(
- new OOUI\CheckboxInputWidget( array(
+ new OOUI\CheckboxInputWidget( [
'name' => 'wpFixRedirects',
'id' => 'wpFixRedirects',
'value' => '1',
'selected' => $this->fixRedirects,
- ) ),
- array(
+ ] ),
+ [
'label' => $this->msg( 'fix-double-redirects' )->text(),
'align' => 'inline',
- )
+ ]
);
}
if ( $canMoveSubpage ) {
$maximumMovedPages = $this->getConfig()->get( 'MaximumMovedPages' );
$fields[] = new OOUI\FieldLayout(
- new OOUI\CheckboxInputWidget( array(
+ new OOUI\CheckboxInputWidget( [
'name' => 'wpMovesubpages',
'id' => 'wpMovesubpages',
'value' => '1',
# Don't check the box if we only have talk subpages to
# move and we aren't moving the talk page.
'selected' => $this->moveSubpages && ( $this->oldTitle->hasSubpages() || $this->moveTalk ),
- ) ),
- array(
+ ] ),
+ [
'label' => new OOUI\HtmlSnippet(
$this->msg(
( $this->oldTitle->hasSubpages()
)->numParams( $maximumMovedPages )->params( $maximumMovedPages )->parse()
),
'align' => 'inline',
- )
+ ]
);
}
$watchChecked = $user->isLoggedIn() && ( $this->watch || $user->getBoolOption( 'watchmoves' )
|| $user->isWatched( $this->oldTitle ) );
$fields[] = new OOUI\FieldLayout(
- new OOUI\CheckboxInputWidget( array(
+ new OOUI\CheckboxInputWidget( [
'name' => 'wpWatch',
'id' => 'watch', # ew
'value' => '1',
'selected' => $watchChecked,
- ) ),
- array(
+ ] ),
+ [
'label' => $this->msg( 'move-watch' )->text(),
'align' => 'inline',
- )
+ ]
);
}
if ( $deleteAndMove ) {
$fields[] = new OOUI\FieldLayout(
- new OOUI\CheckboxInputWidget( array(
+ new OOUI\CheckboxInputWidget( [
'name' => 'wpDeleteAndMove',
'id' => 'wpDeleteAndMove',
'value' => '1',
- ) ),
- array(
+ ] ),
+ [
'label' => $this->msg( 'delete_and_move_confirm' )->text(),
'align' => 'inline',
- )
+ ]
);
}
$fields[] = new OOUI\FieldLayout(
- new OOUI\ButtonInputWidget( array(
+ new OOUI\ButtonInputWidget( [
'name' => 'wpMove',
'value' => $this->msg( 'movepagebtn' )->text(),
'label' => $this->msg( 'movepagebtn' )->text(),
- 'flags' => array( 'constructive', 'primary' ),
+ 'flags' => [ 'constructive', 'primary' ],
'type' => 'submit',
- ) ),
- array(
+ ] ),
+ [
'align' => 'top',
- )
+ ]
);
- $fieldset = new OOUI\FieldsetLayout( array(
+ $fieldset = new OOUI\FieldsetLayout( [
'label' => $this->msg( 'move-page-legend' )->text(),
'id' => 'mw-movepage-table',
'items' => $fields,
- ) );
+ ] );
- $form = new OOUI\FormLayout( array(
+ $form = new OOUI\FormLayout( [
'method' => 'post',
'action' => $this->getPageTitle()->getLocalURL( 'action=submit' ),
'id' => 'movepage',
- ) );
+ ] );
$form->appendContent(
$fieldset,
new OOUI\HtmlSnippet(
);
$out->addHTML(
- new OOUI\PanelLayout( array(
- 'classes' => array( 'movepage-wrapper' ),
+ new OOUI\PanelLayout( [
+ 'classes' => [ 'movepage-wrapper' ],
'expanded' => false,
'padded' => true,
'framed' => true,
'content' => $form,
- ) )
+ ] )
);
$this->showLogFragment( $this->oldTitle );
# don't allow moving to pages with # in
if ( !$nt || $nt->hasFragment() ) {
- $this->showForm( array( array( 'badtitletext' ) ) );
+ $this->showForm( [ [ 'badtitletext' ] ] );
return;
}
&& !RepoGroup::singleton()->getLocalRepo()->findFile( $nt )
&& wfFindFile( $nt )
) {
- $this->showForm( array( array( 'file-exists-sharedrepo' ) ) );
+ $this->showForm( [ [ 'file-exists-sharedrepo' ] ] );
return;
}
$oldLink = Linker::link(
$ot,
null,
- array( 'id' => 'movepage-oldlink' ),
- array( 'redirect' => 'no' )
+ [ 'id' => 'movepage-oldlink' ],
+ [ 'redirect' => 'no' ]
);
$newLink = Linker::linkKnown(
$nt,
null,
- array( 'id' => 'movepage-newlink' )
+ [ 'id' => 'movepage-newlink' ]
);
$oldText = $ot->getPrefixedText();
$newText = $nt->getPrefixedText();
$newLink )->params( $oldText, $newText )->parseAsBlock() );
$out->addWikiMsg( $msgName );
- Hooks::run( 'SpecialMovepageAfterMove', array( &$this, &$ot, &$nt ) );
+ Hooks::run( 'SpecialMovepageAfterMove', [ &$this, &$ot, &$nt ] );
# Now we move extra pages we've been asked to move: subpages and talk
# pages. First, if the old page or the new page is a talk page, we
&& MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
)
) ) {
- $conds = array(
+ $conds = [
'page_title' . $dbr->buildLike( $ot->getDBkey() . '/', $dbr->anyString() )
. ' OR page_title = ' . $dbr->addQuotes( $ot->getDBkey() )
- );
- $conds['page_namespace'] = array();
+ ];
+ $conds['page_namespace'] = [];
if ( MWNamespace::hasSubpages( $nt->getNamespace() ) ) {
$conds['page_namespace'][] = $ot->getNamespace();
}
$conds['page_namespace'][] = $ot->getTalkPage()->getNamespace();
}
} elseif ( $this->moveTalk ) {
- $conds = array(
+ $conds = [
'page_namespace' => $ot->getTalkPage()->getNamespace(),
'page_title' => $ot->getDBkey()
- );
+ ];
} else {
# Skip the query
$conds = null;
}
- $extraPages = array();
+ $extraPages = [];
if ( !is_null( $conds ) ) {
$extraPages = TitleArray::newFromResult(
$dbr->select( 'page',
- array( 'page_id', 'page_namespace', 'page_title' ),
+ [ 'page_id', 'page_namespace', 'page_title' ],
$conds,
__METHOD__
)
);
}
- $extraOutput = array();
+ $extraOutput = [];
$count = 1;
foreach ( $extraPages as $oldSubpage ) {
if ( $ot->equals( $oldSubpage ) || $nt->equals( $oldSubpage ) ) {
$oldLink = Linker::link(
$oldSubpage,
null,
- array(),
- array( 'redirect' => 'no' )
+ [],
+ [ 'redirect' => 'no' ]
);
$newLink = Linker::linkKnown( $newSubpage );
}
}
- if ( $extraOutput !== array() ) {
+ if ( $extraOutput !== [] ) {
$out->addHTML( "<ul>\n<li>" . implode( "</li>\n<li>", $extraOutput ) . "</li>\n</ul>" );
}
$count = $subpages instanceof TitleArray ? $subpages->count() : 0;
$out = $this->getOutput();
- $out->wrapWikiMsg( '== $1 ==', array( 'movesubpage', $count ) );
+ $out->wrapWikiMsg( '== $1 ==', [ 'movesubpage', $count ] );
# No subpages.
if ( $count == 0 ) {