mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 15:30:42 +00:00
Fix casing of dropdown-related methods
Methods gets renamed to lowercase variant in core (f1d7e68c) Follow-Up: Ifda13ba9dee316709c424636ec3b285de8d0e9b1 Change-Id: I0ee5602536033268ff49aadf8d14320f8e5d03d2
This commit is contained in:
parent
b9e6d0bc65
commit
5ab7282b4a
|
@ -81,10 +81,10 @@ abstract class EditBoxBuilder {
|
|||
$output = $this->getEditBox( $rules, $isUserAllowed, $externalForm );
|
||||
|
||||
if ( $isUserAllowed ) {
|
||||
$dropDown = $this->getSuggestionsDropdown();
|
||||
$dropdown = $this->getSuggestionsDropdown();
|
||||
|
||||
$formElements = [
|
||||
new FieldLayout( $dropDown ),
|
||||
new FieldLayout( $dropdown ),
|
||||
new FieldLayout( $this->getEditorControls() )
|
||||
];
|
||||
|
||||
|
@ -111,37 +111,37 @@ abstract class EditBoxBuilder {
|
|||
* @return DropdownInputWidget
|
||||
*/
|
||||
private function getSuggestionsDropdown(): DropdownInputWidget {
|
||||
$rawDropDown = $this->keywordsManager->getBuilderValues();
|
||||
$rawDropdown = $this->keywordsManager->getBuilderValues();
|
||||
|
||||
// The array needs to be rearranged to be understood by OOUI. It comes with the format
|
||||
// [ group-msg-key => [ text-to-add => text-msg-key ] ] and we need it as
|
||||
// [ group-msg => [ text-msg => text-to-add ] ]
|
||||
// Also, the 'other' element must be the first one.
|
||||
$dropDownOptions = [ $this->localizer->msg( 'abusefilter-edit-builder-select' )->text() => 'other' ];
|
||||
foreach ( $rawDropDown as $group => $values ) {
|
||||
$dropdownOptions = [ $this->localizer->msg( 'abusefilter-edit-builder-select' )->text() => 'other' ];
|
||||
foreach ( $rawDropdown as $group => $values ) {
|
||||
// Give grep a chance to find the usages:
|
||||
// abusefilter-edit-builder-group-op-arithmetic, abusefilter-edit-builder-group-op-comparison,
|
||||
// abusefilter-edit-builder-group-op-bool, abusefilter-edit-builder-group-misc,
|
||||
// abusefilter-edit-builder-group-funcs, abusefilter-edit-builder-group-vars
|
||||
$localisedGroup = $this->localizer->msg( "abusefilter-edit-builder-group-$group" )->text();
|
||||
$dropDownOptions[ $localisedGroup ] = array_flip( $values );
|
||||
$dropdownOptions[ $localisedGroup ] = array_flip( $values );
|
||||
$newKeys = array_map(
|
||||
function ( $key ) use ( $group ) {
|
||||
return $this->localizer->msg( "abusefilter-edit-builder-$group-$key" )->text();
|
||||
},
|
||||
array_keys( $dropDownOptions[ $localisedGroup ] )
|
||||
array_keys( $dropdownOptions[ $localisedGroup ] )
|
||||
);
|
||||
$dropDownOptions[ $localisedGroup ] = array_combine(
|
||||
$dropdownOptions[ $localisedGroup ] = array_combine(
|
||||
$newKeys,
|
||||
$dropDownOptions[ $localisedGroup ]
|
||||
$dropdownOptions[ $localisedGroup ]
|
||||
);
|
||||
}
|
||||
|
||||
$dropDownList = Xml::listDropDownOptionsOoui( $dropDownOptions );
|
||||
$dropdownList = Xml::listDropdownOptionsOoui( $dropdownOptions );
|
||||
return new DropdownInputWidget( [
|
||||
'name' => 'wpFilterBuilder',
|
||||
'inputId' => 'wpFilterBuilder',
|
||||
'options' => $dropDownList
|
||||
'options' => $dropdownList
|
||||
] );
|
||||
}
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
$options += [ $this->specsFormatter->nameGroup( $group ) => $group ];
|
||||
}
|
||||
|
||||
$options = Xml::listDropDownOptionsOoui( $options );
|
||||
$options = Xml::listDropdownOptionsOoui( $options );
|
||||
$groupSelector->setOptions( $options );
|
||||
|
||||
$fields['abusefilter-edit-group'] = $groupSelector;
|
||||
|
@ -952,7 +952,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
);
|
||||
$output .= $checkbox;
|
||||
|
||||
$suggestedBlocks = Xml::listDropDownOptionsOoui( $suggestedBlocks );
|
||||
$suggestedBlocks = Xml::listDropdownOptionsOoui( $suggestedBlocks );
|
||||
|
||||
$anonDuration =
|
||||
new OOUI\DropdownInputWidget( [
|
||||
|
@ -1105,7 +1105,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
// abusefilter-edit-warn-other, abusefilter-edit-disallow-other
|
||||
$options[ $this->msg( "abusefilter-edit-$formId-other" )->text() ] = 'other';
|
||||
|
||||
$options = Xml::listDropDownOptionsOoui( $options );
|
||||
$options = Xml::listDropdownOptionsOoui( $options );
|
||||
$existingSelector->setOptions( $options );
|
||||
|
||||
$existingSelector =
|
||||
|
|
|
@ -89,7 +89,7 @@ class HideAbuseLog extends AbuseFilterView {
|
|||
|
||||
$hideReasonsOther = $this->msg( 'revdelete-reasonotherlist' )->text();
|
||||
$hideReasons = $this->msg( 'revdelete-reason-dropdown-suppress' )->inContentLanguage()->text();
|
||||
$hideReasons = Xml::listDropDownOptions( $hideReasons, [ 'other' => $hideReasonsOther ] );
|
||||
$hideReasons = Xml::listDropdownOptions( $hideReasons, [ 'other' => $hideReasonsOther ] );
|
||||
|
||||
$formInfo = [
|
||||
'showorhide' => [
|
||||
|
|
Loading…
Reference in a new issue