Merge "Better grouping for code adding elements to arrays"
This commit is contained in:
commit
31a987345d
5 changed files with 12 additions and 9 deletions
|
|
@ -255,17 +255,18 @@ class FileDeleteForm {
|
||||||
|
|
||||||
$wgOut->enableOOUI();
|
$wgOut->enableOOUI();
|
||||||
|
|
||||||
|
$fields = [];
|
||||||
|
|
||||||
|
$fields[] = new OOUI\LabelWidget( [ 'label' => new OOUI\HtmlSnippet(
|
||||||
|
$this->prepareMessage( 'filedelete-intro' ) ) ]
|
||||||
|
);
|
||||||
|
|
||||||
$options = Xml::listDropDownOptions(
|
$options = Xml::listDropDownOptions(
|
||||||
$wgOut->msg( 'filedelete-reason-dropdown' )->inContentLanguage()->text(),
|
$wgOut->msg( 'filedelete-reason-dropdown' )->inContentLanguage()->text(),
|
||||||
[ 'other' => $wgOut->msg( 'filedelete-reason-otherlist' )->inContentLanguage()->text() ]
|
[ 'other' => $wgOut->msg( 'filedelete-reason-otherlist' )->inContentLanguage()->text() ]
|
||||||
);
|
);
|
||||||
$options = Xml::listDropDownOptionsOoui( $options );
|
$options = Xml::listDropDownOptionsOoui( $options );
|
||||||
|
|
||||||
$fields = [];
|
|
||||||
$fields[] = new OOUI\LabelWidget( [ 'label' => new OOUI\HtmlSnippet(
|
|
||||||
$this->prepareMessage( 'filedelete-intro' ) ) ]
|
|
||||||
);
|
|
||||||
|
|
||||||
$fields[] = new OOUI\FieldLayout(
|
$fields[] = new OOUI\FieldLayout(
|
||||||
new OOUI\DropdownInputWidget( [
|
new OOUI\DropdownInputWidget( [
|
||||||
'name' => 'wpDeleteReasonList',
|
'name' => 'wpDeleteReasonList',
|
||||||
|
|
|
||||||
|
|
@ -311,6 +311,7 @@ class LinkFilter {
|
||||||
*/
|
*/
|
||||||
public static function makeLikeArray( $filterEntry, $protocol = 'http://' ) {
|
public static function makeLikeArray( $filterEntry, $protocol = 'http://' ) {
|
||||||
$db = wfGetDB( DB_REPLICA );
|
$db = wfGetDB( DB_REPLICA );
|
||||||
|
$like = [];
|
||||||
|
|
||||||
$target = $protocol . $filterEntry;
|
$target = $protocol . $filterEntry;
|
||||||
$bits = wfParseUrl( $target );
|
$bits = wfParseUrl( $target );
|
||||||
|
|
@ -338,7 +339,6 @@ class LinkFilter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$like = [];
|
|
||||||
$like[] = $bits['scheme'] . $bits['delimiter'] . $bits['host'];
|
$like[] = $bits['scheme'] . $bits['delimiter'] . $bits['host'];
|
||||||
|
|
||||||
if ( $subdomains ) {
|
if ( $subdomains ) {
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,10 @@ class ApiBlock extends ApiBase {
|
||||||
$this->dieStatus( $this->errorArrayToStatus( $retval ) );
|
$this->dieStatus( $this->errorArrayToStatus( $retval ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
list( $target, /*...*/ ) = SpecialBlock::getTargetAndType( $params['user'] );
|
|
||||||
$res = [];
|
$res = [];
|
||||||
|
|
||||||
$res['user'] = $params['user'];
|
$res['user'] = $params['user'];
|
||||||
|
list( $target, /*...*/ ) = SpecialBlock::getTargetAndType( $params['user'] );
|
||||||
$res['userID'] = $target instanceof User ? $target->getId() : 0;
|
$res['userID'] = $target instanceof User ? $target->getId() : 0;
|
||||||
|
|
||||||
$block = DatabaseBlock::newFromTarget( $target, null, true );
|
$block = DatabaseBlock::newFromTarget( $target, null, true );
|
||||||
|
|
|
||||||
|
|
@ -793,8 +793,8 @@ class ApiUpload extends ApiBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = [];
|
|
||||||
// No errors, no warnings: do the upload
|
// No errors, no warnings: do the upload
|
||||||
|
$result = [];
|
||||||
if ( $this->mParams['async'] ) {
|
if ( $this->mParams['async'] ) {
|
||||||
$progress = UploadBase::getSessionStatus( $this->getUser(), $this->mParams['filekey'] );
|
$progress = UploadBase::getSessionStatus( $this->getUser(), $this->mParams['filekey'] );
|
||||||
if ( $progress && $progress['result'] === 'Poll' ) {
|
if ( $progress && $progress['result'] === 'Poll' ) {
|
||||||
|
|
|
||||||
|
|
@ -1929,13 +1929,14 @@ class Article implements Page {
|
||||||
|
|
||||||
$outputPage->enableOOUI();
|
$outputPage->enableOOUI();
|
||||||
|
|
||||||
|
$fields = [];
|
||||||
|
|
||||||
$options = Xml::listDropDownOptions(
|
$options = Xml::listDropDownOptions(
|
||||||
$ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->text(),
|
$ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->text(),
|
||||||
[ 'other' => $ctx->msg( 'deletereasonotherlist' )->inContentLanguage()->text() ]
|
[ 'other' => $ctx->msg( 'deletereasonotherlist' )->inContentLanguage()->text() ]
|
||||||
);
|
);
|
||||||
$options = Xml::listDropDownOptionsOoui( $options );
|
$options = Xml::listDropDownOptionsOoui( $options );
|
||||||
|
|
||||||
$fields = [];
|
|
||||||
$fields[] = new OOUI\FieldLayout(
|
$fields[] = new OOUI\FieldLayout(
|
||||||
new OOUI\DropdownInputWidget( [
|
new OOUI\DropdownInputWidget( [
|
||||||
'name' => 'wpDeleteReasonList',
|
'name' => 'wpDeleteReasonList',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue