Show createpage preference only when feature is available

Bug: T310053
Change-Id: I13262ecbe2d2c45c0ffb8706da17bc806ab2a5b7
This commit is contained in:
na1307 2022-06-07 18:59:15 +09:00
parent 790ef19cd3
commit edb276e047
No known key found for this signature in database
GPG key ID: 569FA09548161BA5

View file

@ -83,22 +83,22 @@ class PreferenceHooks implements
'help-message' => "discussiontools-preference-$feature-help",
'section' => 'editing/discussion',
];
}
// Option to enable/disable new topic tool on pages that haven't been created
// (it's inside this loop to place the options in a nice order)
if ( $feature === HookUtils::NEWTOPICTOOL ) {
$preferences["discussiontools-newtopictool-createpage"] = [
'type' => 'radio',
'cssclass' => 'mw-htmlform-checkradio-indent',
'label-message' => 'discussiontools-preference-newtopictool-createpage',
'options-messages' => [
'discussiontools-preference-newtopictool-createpage-newtopictool' => 1,
'discussiontools-preference-newtopictool-createpage-editor' => 0,
],
'disable-if' => [ '===', 'discussiontools-' . HookUtils::NEWTOPICTOOL, '' ],
'section' => 'editing/discussion',
];
// Option to enable/disable new topic tool on pages that haven't been created
// (it's inside this loop to place the options in a nice order)
if ( $feature === HookUtils::NEWTOPICTOOL ) {
$preferences["discussiontools-newtopictool-createpage"] = [
'type' => 'radio',
'cssclass' => 'mw-htmlform-checkradio-indent',
'label-message' => 'discussiontools-preference-newtopictool-createpage',
'options-messages' => [
'discussiontools-preference-newtopictool-createpage-newtopictool' => 1,
'discussiontools-preference-newtopictool-createpage-editor' => 0,
],
'disable-if' => [ '===', 'discussiontools-' . HookUtils::NEWTOPICTOOL, '' ],
'section' => 'editing/discussion',
];
}
}
}